84 if (ignore_render_viewer && sima->
image &&
110 if (efa ==
nullptr) {
114 Image *ima =
nullptr;
117 if (ima != sima->
image) {
148 if (sima && sima->
image) {
153 return BIF_render_spare_imbuf();
186 if (sima && sima->
image) {
198 const bool color = ibuf->
channels >= 3;
199 const bool alpha = ibuf->
channels == 4;
200 const bool zbuf = ibuf->
channels == 1;
206 result &= ~SI_SHOW_ZBUF;
221 has_buffer = (ibuf !=
nullptr);
236 if (ibuf && ibuf->
x > 0 && ibuf->
y > 0) {
258 r_size[0] = size_i[0];
259 r_size[1] = size_i[1];
265 if ((ima ==
nullptr) || (ima->
aspx == 0.0f || ima->
aspy == 0.0f)) {
266 *r_aspx = *r_aspy = 1.0;
298 if (*r_aspx < *r_aspy) {
299 *r_aspy = *r_aspy / *r_aspx;
303 *r_aspx = *r_aspx / *r_aspy;
327 int sx, sy, width, height;
335 co[0] = ((mval[0] - sx) / zoomx) / width;
336 co[1] = ((mval[1] - sy) / zoomy) / height;
347 sima->
xof = (x - 0.5f) * width * aspx;
348 sima->
yof = (y - 0.5f) * height * aspy;
352 SpaceImage *sima,
const ARegion *region,
float x,
float y,
float *r_x,
float *r_y)
354 int sx, sy, width, height;
362 *r_x = ((x - sx) / zoomx) / width;
363 *r_y = ((y - sy) / zoomy) / height;
379 r_co[0] = (co[0] * width * zoomx) +
float(sx);
380 r_co[1] = (co[1] * height * zoomy) +
float(sy);
385 const int cur = image->render_slot;
391 for (i = 1; i < num_slots; i++) {
392 slot = (cur + ((direction == -1) ? -i : i)) % num_slots;
398 if ((render_slot && render_slot->
render) || slot == image->last_render_slot) {
399 image->render_slot = slot;
404 if (num_slots == 1) {
405 image->render_slot = 0;
407 else if (i == num_slots) {
408 image->render_slot = ((cur == 1) ? 0 : 1);
411 if (cur != image->render_slot) {
414 return (cur != image->render_slot);
420 bool use_view_settings)
434 if (
G.is_rendering) {
443 use_view_settings ? &scene->view_settings :
nullptr,
444 &scene->display_settings);
SpaceImage * CTX_wm_space_image(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
ToolSettings * CTX_data_tool_settings(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
BMEditMesh * BKE_editmesh_from_object(Object *ob)
Return the BMEditMesh for a given object.
RenderSlot * BKE_image_get_renderslot(Image *ima, int index)
ImBuf * BKE_image_acquire_ibuf(Image *ima, ImageUser *iuser, void **r_lock)
void BKE_image_get_aspect(Image *image, float *r_aspx, float *r_aspy)
void BKE_image_release_ibuf(Image *ima, ImBuf *ibuf, void *lock)
#define IMA_SIGNAL_USER_NEW_IMAGE
void BKE_image_get_size(Image *image, ImageUser *iuser, int *r_width, int *r_height)
void BKE_image_signal(Main *bmain, Image *ima, ImageUser *iuser, int signal)
void BKE_image_partial_update_mark_full_update(Image *image)
Mark the whole image to be updated.
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
Object * BKE_view_layer_edit_object_get(const ViewLayer *view_layer)
void id_us_ensure_real(ID *id)
Brush * BKE_paint_brush(Paint *paint)
void BKE_render_resolution(const RenderData *r, const bool use_crop, int *r_width, int *r_height)
#define LISTBASE_FOREACH(type, var, list)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
Object is a sort of wrapper for general info.
#define IMG_SIZE_FALLBACK
bool EDBM_uv_check(BMEditMesh *em)
bool ED_operator_uvedit_space_image(bContext *C)
bool ED_object_get_active_image(Object *ob, int mat_nr, Image **r_ima, ImageUser **r_iuser, const bNode **r_node, const bNodeTree **r_ntree)
Contains defines and structs used throughout the imbuf module.
void UI_view2d_view_to_region(const View2D *v2d, float x, float y, int *r_region_x, int *r_region_y) ATTR_NONNULL()
ATTR_WARN_UNUSED_RESULT BMesh * bm
BMFace * BM_mesh_active_face_get(BMesh *bm, const bool is_sloppy, const bool is_selected)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
draw_view in_light_buf[] float
void ED_space_image_release_buffer(SpaceImage *sima, ImBuf *ibuf, void *lock)
void ED_space_image_auto_set(const bContext *C, SpaceImage *sima)
void ED_space_image_sync(Main *bmain, Image *image, bool ignore_render_viewer)
void ED_space_image_get_size(SpaceImage *sima, int *r_width, int *r_height)
bool ED_space_image_maskedit_visible_splines_poll(bContext *C)
bool ED_space_image_maskedit_mask_visible_splines_poll(bContext *C)
int ED_space_image_get_display_channel_mask(ImBuf *ibuf)
ImBuf * ED_space_image_acquire_buffer(SpaceImage *sima, void **r_lock, int tile)
bool ED_space_image_maskedit_mask_poll(bContext *C)
bool ED_space_image_show_paint(const SpaceImage *sima)
void ED_image_mouse_pos(SpaceImage *sima, const ARegion *region, const int mval[2], float co[2])
void ED_space_image_get_uv_aspect(SpaceImage *sima, float *r_aspx, float *r_aspy)
bool ED_space_image_paint_curve(const bContext *C)
bool ED_space_image_check_show_maskedit(SpaceImage *sima, Object *obedit)
bool ED_space_image_show_render(const SpaceImage *sima)
void ED_image_point_pos(SpaceImage *sima, const ARegion *region, float x, float y, float *r_x, float *r_y)
void ED_space_image_set(Main *bmain, SpaceImage *sima, Image *ima, bool automatic)
void ED_image_get_uv_aspect(Image *ima, ImageUser *iuser, float *r_aspx, float *r_aspy)
bool ED_space_image_has_buffer(SpaceImage *sima)
bool ED_space_image_show_uvedit(const SpaceImage *sima, Object *obedit)
bool ED_space_image_maskedit_poll(bContext *C)
bool ED_image_slot_cycle(Image *image, int direction)
void ED_space_image_get_aspect(SpaceImage *sima, float *r_aspx, float *r_aspy)
void ED_space_image_scopes_update(const bContext *C, SpaceImage *sima, ImBuf *ibuf, bool use_view_settings)
void ED_space_image_get_size_fl(SpaceImage *sima, float r_size[2])
void ED_space_image_get_zoom(SpaceImage *sima, const ARegion *region, float *r_zoomx, float *r_zoomy)
void ED_space_image_set_mask(bContext *C, SpaceImage *sima, Mask *mask)
void ED_image_point_pos__reverse(SpaceImage *sima, const ARegion *region, const float co[2], float r_co[2])
bool ED_space_image_cursor_poll(bContext *C)
Image * ED_space_image(const SpaceImage *sima)
void ED_image_view_center_to_point(SpaceImage *sima, float x, float y)
Mask * ED_space_image_get_mask(const SpaceImage *sima)
ccl_global const KernelWorkTile * tile
ccl_device_inline float4 mask(const int4 mask, const float4 a)
ImBufFloatBuffer float_buffer
ImBufByteBuffer byte_buffer
struct RenderResult * render
void WM_main_add_notifier(uint type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
bScreen * WM_window_get_active_screen(const wmWindow *win)