Blender  V3.3
image_edit.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2008 Blender Foundation. All rights reserved. */
3 
8 #include "DNA_brush_types.h"
9 #include "DNA_mask_types.h"
10 #include "DNA_object_types.h"
11 #include "DNA_scene_types.h"
12 
13 #include "BLI_listbase.h"
14 #include "BLI_rect.h"
15 
16 #include "BKE_colortools.h"
17 #include "BKE_context.h"
18 #include "BKE_editmesh.h"
19 #include "BKE_global.h"
20 #include "BKE_image.h"
21 #include "BKE_lib_id.h"
22 #include "BKE_main.h"
23 #include "BKE_scene.h"
24 
25 #include "IMB_imbuf_types.h"
26 
27 #include "DEG_depsgraph.h"
28 
29 #include "ED_image.h" /* own include */
30 #include "ED_mesh.h"
31 #include "ED_screen.h"
32 #include "ED_uvedit.h"
33 
34 #include "UI_view2d.h"
35 
36 #include "WM_api.h"
37 #include "WM_types.h"
38 
39 /* NOTE: image_panel_properties() uses pointer to sima->image directly. */
41 {
42  return sima->image;
43 }
44 
45 void ED_space_image_set(Main *bmain, SpaceImage *sima, Image *ima, bool automatic)
46 {
47  /* Automatically pin image when manually assigned, otherwise it follows object. */
48  if (!automatic && sima->image != ima && sima->mode == SI_MODE_UV) {
49  sima->pin = true;
50  }
51 
52  sima->image = ima;
53 
54  if (ima == NULL || ima->type == IMA_TYPE_R_RESULT || ima->type == IMA_TYPE_COMPOSITE) {
55  if (sima->mode == SI_MODE_PAINT) {
56  sima->mode = SI_MODE_VIEW;
57  }
58  }
59 
60  if (sima->image) {
62  }
63 
64  id_us_ensure_real((ID *)sima->image);
65 
67 }
68 
70 {
71  if (sima->mode != SI_MODE_UV || sima->pin) {
72  return;
73  }
74 
75  /* Track image assigned to active face in edit mode. */
77  if (!(ob && (ob->mode & OB_MODE_EDIT) && ED_space_image_show_uvedit(sima, ob))) {
78  return;
79  }
80 
82  BMesh *bm = em->bm;
83  BMFace *efa = BM_mesh_active_face_get(bm, true, false);
84  if (efa == NULL) {
85  return;
86  }
87 
88  Image *ima = NULL;
89  ED_object_get_active_image(ob, efa->mat_nr + 1, &ima, NULL, NULL, NULL);
90 
91  if (ima != sima->image) {
92  sima->image = ima;
93 
94  if (sima->image) {
95  Main *bmain = CTX_data_main(C);
97  }
98  }
99 }
100 
102 {
103  return sima->mask_info.mask;
104 }
105 
107 {
108  sima->mask_info.mask = mask;
109 
110  /* weak, but same as image/space */
112 
113  if (C) {
115  }
116 }
117 
119 {
120  ImBuf *ibuf;
121 
122  if (sima && sima->image) {
123  const Image *image = sima->image;
124 
125 #if 0
126  if (image->type == IMA_TYPE_R_RESULT && BIF_show_render_spare()) {
127  return BIF_render_spare_imbuf();
128  }
129  else
130 #endif
131  {
132  sima->iuser.tile = tile;
133  ibuf = BKE_image_acquire_ibuf(sima->image, &sima->iuser, r_lock);
134  sima->iuser.tile = 0;
135  }
136 
137  if (ibuf) {
138  if (image->type == IMA_TYPE_R_RESULT && ibuf->x != 0 && ibuf->y != 0) {
139  /* Render result might be lazily allocated. Return ibuf without buffers to indicate that
140  * there is image buffer but it has no data yet. */
141  return ibuf;
142  }
143 
144  if (ibuf->rect || ibuf->rect_float) {
145  return ibuf;
146  }
147  BKE_image_release_ibuf(sima->image, ibuf, *r_lock);
148  *r_lock = NULL;
149  }
150  }
151  else {
152  *r_lock = NULL;
153  }
154 
155  return NULL;
156 }
157 
159 {
160  if (sima && sima->image) {
161  BKE_image_release_ibuf(sima->image, ibuf, lock);
162  }
163 }
164 
166 {
168  if (!ibuf) {
169  return result;
170  }
171 
172  const bool color = ibuf->channels >= 3;
173  const bool alpha = ibuf->channels == 4;
174  const bool zbuf = ibuf->zbuf || ibuf->zbuf_float || (ibuf->channels == 1);
175 
176  if (!alpha) {
178  }
179  if (!zbuf) {
180  result &= ~SI_SHOW_ZBUF;
181  }
182  if (!color) {
184  }
185  return result;
186 }
187 
189 {
190  ImBuf *ibuf;
191  void *lock;
192  bool has_buffer;
193 
194  ibuf = ED_space_image_acquire_buffer(sima, &lock, 0);
195  has_buffer = (ibuf != NULL);
196  ED_space_image_release_buffer(sima, ibuf, lock);
197 
198  return has_buffer;
199 }
200 
201 void ED_space_image_get_size(SpaceImage *sima, int *r_width, int *r_height)
202 {
203  Scene *scene = sima->iuser.scene;
204  ImBuf *ibuf;
205  void *lock;
206 
207  /* TODO(lukas): Support tiled images with different sizes */
208  ibuf = ED_space_image_acquire_buffer(sima, &lock, 0);
209 
210  if (ibuf && ibuf->x > 0 && ibuf->y > 0) {
211  *r_width = ibuf->x;
212  *r_height = ibuf->y;
213  }
214  else if (sima->image && sima->image->type == IMA_TYPE_R_RESULT && scene) {
215  /* not very important, just nice */
216  BKE_render_resolution(&scene->r, true, r_width, r_height);
217  }
218  /* I know a bit weak... but preview uses not actual image size */
219  // XXX else if (image_preview_active(sima, r_width, r_height));
220  else {
221  *r_width = IMG_SIZE_FALLBACK;
222  *r_height = IMG_SIZE_FALLBACK;
223  }
224 
225  ED_space_image_release_buffer(sima, ibuf, lock);
226 }
227 
228 void ED_space_image_get_size_fl(SpaceImage *sima, float r_size[2])
229 {
230  int size_i[2];
231  ED_space_image_get_size(sima, &size_i[0], &size_i[1]);
232  r_size[0] = size_i[0];
233  r_size[1] = size_i[1];
234 }
235 
236 void ED_space_image_get_aspect(SpaceImage *sima, float *r_aspx, float *r_aspy)
237 {
238  Image *ima = sima->image;
239  if ((ima == NULL) || (ima->aspx == 0.0f || ima->aspy == 0.0f)) {
240  *r_aspx = *r_aspy = 1.0;
241  }
242  else {
243  BKE_image_get_aspect(ima, r_aspx, r_aspy);
244  }
245 }
246 
248  const ARegion *region,
249  float *r_zoomx,
250  float *r_zoomy)
251 {
252  int width, height;
253 
255 
256  *r_zoomx = (float)(BLI_rcti_size_x(&region->winrct) + 1) /
257  (float)(BLI_rctf_size_x(&region->v2d.cur) * width);
258  *r_zoomy = (float)(BLI_rcti_size_y(&region->winrct) + 1) /
259  (float)(BLI_rctf_size_y(&region->v2d.cur) * height);
260 }
261 
262 void ED_space_image_get_uv_aspect(SpaceImage *sima, float *r_aspx, float *r_aspy)
263 {
264  int w, h;
265 
266  ED_space_image_get_aspect(sima, r_aspx, r_aspy);
267  ED_space_image_get_size(sima, &w, &h);
268 
269  *r_aspx *= (float)w;
270  *r_aspy *= (float)h;
271 
272  if (*r_aspx < *r_aspy) {
273  *r_aspy = *r_aspy / *r_aspx;
274  *r_aspx = 1.0f;
275  }
276  else {
277  *r_aspx = *r_aspx / *r_aspy;
278  *r_aspy = 1.0f;
279  }
280 }
281 
282 void ED_image_get_uv_aspect(Image *ima, ImageUser *iuser, float *r_aspx, float *r_aspy)
283 {
284  if (ima) {
285  int w, h;
286 
287  BKE_image_get_aspect(ima, r_aspx, r_aspy);
288  BKE_image_get_size(ima, iuser, &w, &h);
289 
290  *r_aspx *= (float)w;
291  *r_aspy *= (float)h;
292  }
293  else {
294  *r_aspx = 1.0f;
295  *r_aspy = 1.0f;
296  }
297 }
298 
299 void ED_image_mouse_pos(SpaceImage *sima, const ARegion *region, const int mval[2], float co[2])
300 {
301  int sx, sy, width, height;
302  float zoomx, zoomy;
303 
304  ED_space_image_get_zoom(sima, region, &zoomx, &zoomy);
306 
307  UI_view2d_view_to_region(&region->v2d, 0.0f, 0.0f, &sx, &sy);
308 
309  co[0] = ((mval[0] - sx) / zoomx) / width;
310  co[1] = ((mval[1] - sy) / zoomy) / height;
311 }
312 
313 void ED_image_view_center_to_point(SpaceImage *sima, float x, float y)
314 {
315  int width, height;
316  float aspx, aspy;
317 
319  ED_space_image_get_aspect(sima, &aspx, &aspy);
320 
321  sima->xof = (x - 0.5f) * width * aspx;
322  sima->yof = (y - 0.5f) * height * aspy;
323 }
324 
326  SpaceImage *sima, const ARegion *region, float x, float y, float *r_x, float *r_y)
327 {
328  int sx, sy, width, height;
329  float zoomx, zoomy;
330 
331  ED_space_image_get_zoom(sima, region, &zoomx, &zoomy);
333 
334  UI_view2d_view_to_region(&region->v2d, 0.0f, 0.0f, &sx, &sy);
335 
336  *r_x = ((x - sx) / zoomx) / width;
337  *r_y = ((y - sy) / zoomy) / height;
338 }
339 
341  const ARegion *region,
342  const float co[2],
343  float r_co[2])
344 {
345  float zoomx, zoomy;
346  int width, height;
347  int sx, sy;
348 
349  UI_view2d_view_to_region(&region->v2d, 0.0f, 0.0f, &sx, &sy);
351  ED_space_image_get_zoom(sima, region, &zoomx, &zoomy);
352 
353  r_co[0] = (co[0] * width * zoomx) + (float)sx;
354  r_co[1] = (co[1] * height * zoomy) + (float)sy;
355 }
356 
357 bool ED_image_slot_cycle(struct Image *image, int direction)
358 {
359  const int cur = image->render_slot;
360  int i, slot;
361 
362  BLI_assert(ELEM(direction, -1, 1));
363 
364  int num_slots = BLI_listbase_count(&image->renderslots);
365  for (i = 1; i < num_slots; i++) {
366  slot = (cur + ((direction == -1) ? -i : i)) % num_slots;
367  if (slot < 0) {
368  slot += num_slots;
369  }
370 
371  RenderSlot *render_slot = BKE_image_get_renderslot(image, slot);
372  if ((render_slot && render_slot->render) || slot == image->last_render_slot) {
373  image->render_slot = slot;
374  break;
375  }
376  }
377 
378  if (num_slots == 1) {
379  image->render_slot = 0;
380  }
381  else if (i == num_slots) {
382  image->render_slot = ((cur == 1) ? 0 : 1);
383  }
384 
385  if ((cur != image->render_slot)) {
387  }
388  return (cur != image->render_slot);
389 }
390 
392  struct SpaceImage *sima,
393  struct ImBuf *ibuf,
394  bool use_view_settings)
395 {
398 
399  /* scope update can be expensive, don't update during paint modes */
400  if (sima->mode == SI_MODE_PAINT) {
401  return;
402  }
403  if (ob && ((ob->mode & (OB_MODE_TEXTURE_PAINT | OB_MODE_EDIT)) != 0)) {
404  return;
405  }
406 
407  /* We also don't update scopes of render result during render. */
408  if (G.is_rendering) {
409  const Image *image = sima->image;
410  if (image != NULL && (ELEM(image->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE))) {
411  return;
412  }
413  }
414 
415  BKE_scopes_update(&sima->scopes,
416  ibuf,
417  use_view_settings ? &scene->view_settings : NULL,
419 }
420 
422 {
423  return (sima->image && ELEM(sima->image->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE));
424 }
425 
427 {
428  if (ED_space_image_show_render(sima)) {
429  return false;
430  }
431 
432  return (sima->mode == SI_MODE_PAINT);
433 }
434 
435 bool ED_space_image_show_uvedit(const SpaceImage *sima, Object *obedit)
436 {
437  if (sima) {
438  if (ED_space_image_show_render(sima)) {
439  return false;
440  }
441  if (sima->mode != SI_MODE_UV) {
442  return false;
443  }
444  }
445 
446  if (obedit && obedit->type == OB_MESH) {
447  struct BMEditMesh *em = BKE_editmesh_from_object(obedit);
448  bool ret;
449 
450  ret = EDBM_uv_check(em);
451 
452  return ret;
453  }
454 
455  return false;
456 }
457 
459 {
460  /* check editmode - this is reserved for UV editing */
461  if (obedit && ED_space_image_show_uvedit(sima, obedit)) {
462  return false;
463  }
464 
465  return (sima->mode == SI_MODE_MASK);
466 }
467 
469 {
471 
472  if (sima) {
473  ViewLayer *view_layer = CTX_data_view_layer(C);
474  Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer);
475  return ED_space_image_check_show_maskedit(sima, obedit);
476  }
477 
478  return false;
479 }
480 
482 {
484  return false;
485  }
486 
487  const SpaceImage *space_image = CTX_wm_space_image(C);
488  return space_image->mask_info.draw_flag & MASK_DRAWFLAG_SPLINE;
489 }
490 
492 {
494 
495  if (sima && sima->mode == SI_MODE_PAINT) {
497 
498  if (br && (br->flag & BRUSH_CURVE)) {
499  return true;
500  }
501  }
502 
503  return false;
504 }
505 
507 {
510  return sima->mask_info.mask != NULL;
511  }
512 
513  return false;
514 }
515 
517 {
519  return false;
520  }
521 
522  const SpaceImage *space_image = CTX_wm_space_image(C);
523  return space_image->mask_info.draw_flag & MASK_DRAWFLAG_SPLINE;
524 }
525 
527 {
530 }
typedef float(TangentPoint)[2]
void BKE_scopes_update(struct Scopes *scopes, struct ImBuf *ibuf, const struct ColorManagedViewSettings *view_settings, const struct ColorManagedDisplaySettings *display_settings)
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1090
struct ViewLayer * CTX_data_view_layer(const bContext *C)
Definition: context.c:1100
struct Object * CTX_data_active_object(const bContext *C)
Definition: context.c:1353
struct SpaceImage * CTX_wm_space_image(const bContext *C)
Definition: context.c:824
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1074
struct ToolSettings * CTX_data_tool_settings(const bContext *C)
Definition: context.c:1282
BMEditMesh * BKE_editmesh_from_object(struct Object *ob)
Return the BMEditMesh for a given object.
Definition: editmesh.c:58
void BKE_image_release_ibuf(struct Image *ima, struct ImBuf *ibuf, void *lock)
struct ImBuf * BKE_image_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, void **r_lock)
void BKE_image_partial_update_mark_full_update(struct Image *image)
Mark the whole image to be updated.
void BKE_image_get_aspect(struct Image *image, float *r_aspx, float *r_aspy)
void BKE_image_get_size(struct Image *image, struct ImageUser *iuser, int *r_width, int *r_height)
#define IMA_SIGNAL_USER_NEW_IMAGE
Definition: BKE_image.h:134
void BKE_image_signal(struct Main *bmain, struct Image *ima, struct ImageUser *iuser, int signal)
struct RenderSlot * BKE_image_get_renderslot(struct Image *ima, int index)
void id_us_ensure_real(struct ID *id)
Definition: lib_id.c:260
void BKE_render_resolution(const struct RenderData *r, const bool use_crop, int *r_width, int *r_height)
Definition: scene.cc:2960
#define BLI_assert(a)
Definition: BLI_assert.h:46
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)
Definition: BLI_rect.h:190
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition: BLI_rect.h:186
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
Definition: BLI_rect.h:194
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
Definition: BLI_rect.h:198
#define ELEM(...)
@ BRUSH_CURVE
@ IMA_TYPE_R_RESULT
@ IMA_TYPE_COMPOSITE
#define MASK_DRAWFLAG_SPLINE
@ OB_MODE_EDIT
@ OB_MODE_TEXTURE_PAINT
Object is a sort of wrapper for general info.
@ OB_MESH
#define OBEDIT_FROM_VIEW_LAYER(view_layer)
@ SI_SHOW_ZBUF
@ SI_SHOW_R
@ SI_USE_ALPHA
@ SI_SHOW_G
@ SI_SHOW_B
@ SI_SHOW_ALPHA
@ SI_MODE_PAINT
@ SI_MODE_VIEW
@ SI_MODE_MASK
@ SI_MODE_UV
#define IMG_SIZE_FALLBACK
bool EDBM_uv_check(struct BMEditMesh *em)
bool ED_operator_uvedit_space_image(struct bContext *C)
Definition: screen_ops.c:564
bool ED_object_get_active_image(struct Object *ob, int mat_nr, struct Image **r_ima, struct ImageUser **r_iuser, struct bNode **r_node, struct bNodeTree **r_ntree)
Definition: uvedit_ops.c:109
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
Contains defines and structs used throughout the imbuf module.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
#define C
Definition: RandGen.cpp:25
void UI_view2d_view_to_region(const struct View2D *v2d, float x, float y, int *r_region_x, int *r_region_y) ATTR_NONNULL()
#define ND_SPACE_IMAGE
Definition: WM_types.h:465
#define NC_MASK
Definition: WM_types.h:348
#define NC_SPACE
Definition: WM_types.h:342
#define NA_SELECTED
Definition: WM_types.h:528
volatile int lock
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.
Definition: btQuadWord.h:119
float aspy
short type
float aspx
Scene scene
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img image(1, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "out_weight_img") .image(3
void ED_space_image_release_buffer(SpaceImage *sima, ImBuf *ibuf, void *lock)
Definition: image_edit.c:158
void ED_space_image_auto_set(const bContext *C, SpaceImage *sima)
Definition: image_edit.c:69
void ED_space_image_get_size(SpaceImage *sima, int *r_width, int *r_height)
Definition: image_edit.c:201
bool ED_space_image_maskedit_visible_splines_poll(bContext *C)
Definition: image_edit.c:481
bool ED_space_image_maskedit_mask_visible_splines_poll(bContext *C)
Definition: image_edit.c:516
Image * ED_space_image(const SpaceImage *sima)
Definition: image_edit.c:40
int ED_space_image_get_display_channel_mask(ImBuf *ibuf)
Definition: image_edit.c:165
bool ED_space_image_maskedit_mask_poll(bContext *C)
Definition: image_edit.c:506
bool ED_space_image_show_paint(const SpaceImage *sima)
Definition: image_edit.c:426
void ED_image_mouse_pos(SpaceImage *sima, const ARegion *region, const int mval[2], float co[2])
Definition: image_edit.c:299
ImBuf * ED_space_image_acquire_buffer(SpaceImage *sima, void **r_lock, int tile)
Definition: image_edit.c:118
void ED_space_image_get_uv_aspect(SpaceImage *sima, float *r_aspx, float *r_aspy)
Definition: image_edit.c:262
bool ED_space_image_paint_curve(const bContext *C)
Definition: image_edit.c:491
bool ED_space_image_check_show_maskedit(SpaceImage *sima, Object *obedit)
Definition: image_edit.c:458
bool ED_space_image_show_render(const SpaceImage *sima)
Definition: image_edit.c:421
void ED_image_point_pos(SpaceImage *sima, const ARegion *region, float x, float y, float *r_x, float *r_y)
Definition: image_edit.c:325
void ED_space_image_set(Main *bmain, SpaceImage *sima, Image *ima, bool automatic)
Definition: image_edit.c:45
void ED_image_get_uv_aspect(Image *ima, ImageUser *iuser, float *r_aspx, float *r_aspy)
Definition: image_edit.c:282
void ED_space_image_scopes_update(const struct bContext *C, struct SpaceImage *sima, struct ImBuf *ibuf, bool use_view_settings)
Definition: image_edit.c:391
bool ED_space_image_has_buffer(SpaceImage *sima)
Definition: image_edit.c:188
bool ED_space_image_show_uvedit(const SpaceImage *sima, Object *obedit)
Definition: image_edit.c:435
bool ED_space_image_maskedit_poll(bContext *C)
Definition: image_edit.c:468
void ED_space_image_get_aspect(SpaceImage *sima, float *r_aspx, float *r_aspy)
Definition: image_edit.c:236
bool ED_image_slot_cycle(struct Image *image, int direction)
Definition: image_edit.c:357
void ED_space_image_get_size_fl(SpaceImage *sima, float r_size[2])
Definition: image_edit.c:228
void ED_space_image_get_zoom(SpaceImage *sima, const ARegion *region, float *r_zoomx, float *r_zoomy)
Definition: image_edit.c:247
void ED_space_image_set_mask(bContext *C, SpaceImage *sima, Mask *mask)
Definition: image_edit.c:106
void ED_image_point_pos__reverse(SpaceImage *sima, const ARegion *region, const float co[2], float r_co[2])
Definition: image_edit.c:340
bool ED_space_image_cursor_poll(bContext *C)
Definition: image_edit.c:526
void ED_image_view_center_to_point(SpaceImage *sima, float x, float y)
Definition: image_edit.c:313
Mask * ED_space_image_get_mask(const SpaceImage *sima)
Definition: image_edit.c:101
ccl_gpu_kernel_postfix ccl_global float int int sy
ccl_global const KernelWorkTile * tile
ccl_gpu_kernel_postfix ccl_global float int sx
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
Definition: math_float4.h:513
#define G(x, y, z)
return ret
struct BMesh * bm
Definition: BKE_editmesh.h:40
short mat_nr
Definition: bmesh_class.h:281
Definition: DNA_ID.h:368
float * zbuf_float
int channels
unsigned int * rect
float * rect_float
int * zbuf
struct Scene * scene
Definition: BKE_main.h:121
struct Mask * mask
struct Brush * brush
struct RenderResult * render
ColorManagedViewSettings view_settings
struct RenderData r
ColorManagedDisplaySettings display_settings
struct Scopes scopes
MaskSpaceInfo mask_info
struct ImageUser iuser
struct Image * image
struct ImagePaintSettings imapaint
void WM_main_add_notifier(unsigned int type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)