Blender  V2.93
image_edit.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2008 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #include "DNA_brush_types.h"
25 #include "DNA_mask_types.h"
26 #include "DNA_object_types.h"
27 #include "DNA_scene_types.h"
28 
29 #include "BLI_listbase.h"
30 #include "BLI_rect.h"
31 
32 #include "BKE_colortools.h"
33 #include "BKE_context.h"
34 #include "BKE_editmesh.h"
35 #include "BKE_global.h"
36 #include "BKE_image.h"
37 #include "BKE_lib_id.h"
38 #include "BKE_main.h"
39 
40 #include "IMB_imbuf_types.h"
41 
42 #include "DEG_depsgraph.h"
43 
44 #include "ED_image.h" /* own include */
45 #include "ED_mesh.h"
46 #include "ED_screen.h"
47 #include "ED_uvedit.h"
48 
49 #include "UI_view2d.h"
50 
51 #include "WM_api.h"
52 #include "WM_types.h"
53 
54 /* note; image_panel_properties() uses pointer to sima->image directly */
56 {
57  return sima->image;
58 }
59 
60 void ED_space_image_set(Main *bmain, SpaceImage *sima, Object *obedit, Image *ima, bool automatic)
61 {
62  /* Automatically pin image when manually assigned, otherwise it follows object. */
63  if (!automatic && sima->image != ima && sima->mode == SI_MODE_UV) {
64  sima->pin = true;
65  }
66 
67  /* change the space ima after because uvedit_face_visible_test uses the space ima
68  * to check if the face is displayed in UV-localview */
69  sima->image = ima;
70 
71  if (ima == NULL || ima->type == IMA_TYPE_R_RESULT || ima->type == IMA_TYPE_COMPOSITE) {
72  if (sima->mode == SI_MODE_PAINT) {
73  sima->mode = SI_MODE_VIEW;
74  }
75  }
76 
77  if (sima->image) {
79  }
80 
81  id_us_ensure_real((ID *)sima->image);
82 
83  if (obedit) {
85  }
86 
88 }
89 
91 {
92  if (sima->mode != SI_MODE_UV || sima->pin) {
93  return;
94  }
95 
96  /* Track image assigned to active face in edit mode. */
98  if (!(ob && (ob->mode & OB_MODE_EDIT) && ED_space_image_show_uvedit(sima, ob))) {
99  return;
100  }
101 
103  BMesh *bm = em->bm;
104  BMFace *efa = BM_mesh_active_face_get(bm, true, false);
105  if (efa == NULL) {
106  return;
107  }
108 
109  Image *ima = NULL;
110  ED_object_get_active_image(ob, efa->mat_nr + 1, &ima, NULL, NULL, NULL);
111 
112  if (ima != sima->image) {
113  sima->image = ima;
114 
115  if (sima->image) {
116  Main *bmain = CTX_data_main(C);
117  BKE_image_signal(bmain, sima->image, &sima->iuser, IMA_SIGNAL_USER_NEW_IMAGE);
118  }
119  }
120 }
121 
123 {
124  return sima->mask_info.mask;
125 }
126 
128 {
129  sima->mask_info.mask = mask;
130 
131  /* weak, but same as image/space */
133 
134  if (C) {
136  }
137 }
138 
139 ImBuf *ED_space_image_acquire_buffer(SpaceImage *sima, void **r_lock, int tile)
140 {
141  ImBuf *ibuf;
142 
143  if (sima && sima->image) {
144 #if 0
145  if (sima->image->type == IMA_TYPE_R_RESULT && BIF_show_render_spare()) {
146  return BIF_render_spare_imbuf();
147  }
148  else
149 #endif
150  {
151  sima->iuser.tile = tile;
152  ibuf = BKE_image_acquire_ibuf(sima->image, &sima->iuser, r_lock);
153  sima->iuser.tile = 0;
154  }
155 
156  if (ibuf) {
157  if (ibuf->rect || ibuf->rect_float) {
158  return ibuf;
159  }
160  BKE_image_release_ibuf(sima->image, ibuf, *r_lock);
161  *r_lock = NULL;
162  }
163  }
164  else {
165  *r_lock = NULL;
166  }
167 
168  return NULL;
169 }
170 
171 void ED_space_image_release_buffer(SpaceImage *sima, ImBuf *ibuf, void *lock)
172 {
173  if (sima && sima->image) {
174  BKE_image_release_ibuf(sima->image, ibuf, lock);
175  }
176 }
177 
178 /* Get the SpaceImage flag that is valid for the given ibuf. */
180 {
182  if (!ibuf) {
183  return result;
184  }
185 
186  const bool color = ibuf->channels >= 3;
187  const bool alpha = ibuf->channels == 4;
188  const bool zbuf = ibuf->zbuf || ibuf->zbuf_float || (ibuf->channels == 1);
189 
190  if (!alpha) {
192  }
193  if (!zbuf) {
194  result &= ~SI_SHOW_ZBUF;
195  }
196  if (!color) {
198  }
199  return result;
200 }
201 
203 {
204  ImBuf *ibuf;
205  void *lock;
206  bool has_buffer;
207 
208  ibuf = ED_space_image_acquire_buffer(sima, &lock, 0);
209  has_buffer = (ibuf != NULL);
210  ED_space_image_release_buffer(sima, ibuf, lock);
211 
212  return has_buffer;
213 }
214 
215 void ED_space_image_get_size(SpaceImage *sima, int *r_width, int *r_height)
216 {
217  Scene *scene = sima->iuser.scene;
218  ImBuf *ibuf;
219  void *lock;
220 
221  /* TODO(lukas): Support tiled images with different sizes */
222  ibuf = ED_space_image_acquire_buffer(sima, &lock, 0);
223 
224  if (ibuf && ibuf->x > 0 && ibuf->y > 0) {
225  *r_width = ibuf->x;
226  *r_height = ibuf->y;
227  }
228  else if (sima->image && sima->image->type == IMA_TYPE_R_RESULT && scene) {
229  /* not very important, just nice */
230  *r_width = (scene->r.xsch * scene->r.size) / 100;
231  *r_height = (scene->r.ysch * scene->r.size) / 100;
232 
233  if ((scene->r.mode & R_BORDER) && (scene->r.mode & R_CROP)) {
234  *r_width *= BLI_rctf_size_x(&scene->r.border);
235  *r_height *= BLI_rctf_size_y(&scene->r.border);
236  }
237  }
238  /* I know a bit weak... but preview uses not actual image size */
239  // XXX else if (image_preview_active(sima, r_width, r_height));
240  else {
241  *r_width = IMG_SIZE_FALLBACK;
242  *r_height = IMG_SIZE_FALLBACK;
243  }
244 
245  ED_space_image_release_buffer(sima, ibuf, lock);
246 }
247 
248 void ED_space_image_get_size_fl(SpaceImage *sima, float r_size[2])
249 {
250  int size_i[2];
251  ED_space_image_get_size(sima, &size_i[0], &size_i[1]);
252  r_size[0] = size_i[0];
253  r_size[1] = size_i[1];
254 }
255 
256 void ED_space_image_get_aspect(SpaceImage *sima, float *r_aspx, float *r_aspy)
257 {
258  Image *ima = sima->image;
259  if ((ima == NULL) || (ima->aspx == 0.0f || ima->aspy == 0.0f)) {
260  *r_aspx = *r_aspy = 1.0;
261  }
262  else {
263  BKE_image_get_aspect(ima, r_aspx, r_aspy);
264  }
265 }
266 
268  const ARegion *region,
269  float *r_zoomx,
270  float *r_zoomy)
271 {
272  int width, height;
273 
275 
276  *r_zoomx = (float)(BLI_rcti_size_x(&region->winrct) + 1) /
277  (float)(BLI_rctf_size_x(&region->v2d.cur) * width);
278  *r_zoomy = (float)(BLI_rcti_size_y(&region->winrct) + 1) /
279  (float)(BLI_rctf_size_y(&region->v2d.cur) * height);
280 }
281 
282 void ED_space_image_get_uv_aspect(SpaceImage *sima, float *r_aspx, float *r_aspy)
283 {
284  int w, h;
285 
286  ED_space_image_get_aspect(sima, r_aspx, r_aspy);
287  ED_space_image_get_size(sima, &w, &h);
288 
289  *r_aspx *= (float)w;
290  *r_aspy *= (float)h;
291 
292  if (*r_aspx < *r_aspy) {
293  *r_aspy = *r_aspy / *r_aspx;
294  *r_aspx = 1.0f;
295  }
296  else {
297  *r_aspx = *r_aspx / *r_aspy;
298  *r_aspy = 1.0f;
299  }
300 }
301 
302 void ED_image_get_uv_aspect(Image *ima, ImageUser *iuser, float *r_aspx, float *r_aspy)
303 {
304  if (ima) {
305  int w, h;
306 
307  BKE_image_get_aspect(ima, r_aspx, r_aspy);
308  BKE_image_get_size(ima, iuser, &w, &h);
309 
310  *r_aspx *= (float)w;
311  *r_aspy *= (float)h;
312  }
313  else {
314  *r_aspx = 1.0f;
315  *r_aspy = 1.0f;
316  }
317 }
318 
319 /* takes event->mval */
320 void ED_image_mouse_pos(SpaceImage *sima, const ARegion *region, const int mval[2], float co[2])
321 {
322  int sx, sy, width, height;
323  float zoomx, zoomy;
324 
325  ED_space_image_get_zoom(sima, region, &zoomx, &zoomy);
327 
328  UI_view2d_view_to_region(&region->v2d, 0.0f, 0.0f, &sx, &sy);
329 
330  co[0] = ((mval[0] - sx) / zoomx) / width;
331  co[1] = ((mval[1] - sy) / zoomy) / height;
332 }
333 
334 void ED_image_view_center_to_point(SpaceImage *sima, float x, float y)
335 {
336  int width, height;
337  float aspx, aspy;
338 
340  ED_space_image_get_aspect(sima, &aspx, &aspy);
341 
342  sima->xof = (x - 0.5f) * width * aspx;
343  sima->yof = (y - 0.5f) * height * aspy;
344 }
345 
347  SpaceImage *sima, const ARegion *region, float x, float y, float *r_x, float *r_y)
348 {
349  int sx, sy, width, height;
350  float zoomx, zoomy;
351 
352  ED_space_image_get_zoom(sima, region, &zoomx, &zoomy);
354 
355  UI_view2d_view_to_region(&region->v2d, 0.0f, 0.0f, &sx, &sy);
356 
357  *r_x = ((x - sx) / zoomx) / width;
358  *r_y = ((y - sy) / zoomy) / height;
359 }
360 
362  const ARegion *region,
363  const float co[2],
364  float r_co[2])
365 {
366  float zoomx, zoomy;
367  int width, height;
368  int sx, sy;
369 
370  UI_view2d_view_to_region(&region->v2d, 0.0f, 0.0f, &sx, &sy);
372  ED_space_image_get_zoom(sima, region, &zoomx, &zoomy);
373 
374  r_co[0] = (co[0] * width * zoomx) + (float)sx;
375  r_co[1] = (co[1] * height * zoomy) + (float)sy;
376 }
377 
382 bool ED_image_slot_cycle(struct Image *image, int direction)
383 {
384  const int cur = image->render_slot;
385  int i, slot;
386 
387  BLI_assert(ELEM(direction, -1, 1));
388 
389  int num_slots = BLI_listbase_count(&image->renderslots);
390  for (i = 1; i < num_slots; i++) {
391  slot = (cur + ((direction == -1) ? -i : i)) % num_slots;
392  if (slot < 0) {
393  slot += num_slots;
394  }
395 
396  RenderSlot *render_slot = BKE_image_get_renderslot(image, slot);
397  if ((render_slot && render_slot->render) || slot == image->last_render_slot) {
398  image->render_slot = slot;
399  break;
400  }
401  }
402 
403  if (num_slots == 1) {
404  image->render_slot = 0;
405  }
406  else if (i == num_slots) {
407  image->render_slot = ((cur == 1) ? 0 : 1);
408  }
409 
410  if ((cur != image->render_slot)) {
411  image->gpuflag |= IMA_GPU_REFRESH;
412  }
413  return (cur != image->render_slot);
414 }
415 
417  struct SpaceImage *sima,
418  struct ImBuf *ibuf,
419  bool use_view_settings)
420 {
423 
424  /* scope update can be expensive, don't update during paint modes */
425  if (sima->mode == SI_MODE_PAINT) {
426  return;
427  }
428  if (ob && ((ob->mode & (OB_MODE_TEXTURE_PAINT | OB_MODE_EDIT)) != 0)) {
429  return;
430  }
431 
432  /* We also don't update scopes of render result during render. */
433  if (G.is_rendering) {
434  const Image *image = sima->image;
435  if (image != NULL && (image->type == IMA_TYPE_R_RESULT || image->type == IMA_TYPE_COMPOSITE)) {
436  return;
437  }
438  }
439 
440  BKE_scopes_update(&sima->scopes,
441  ibuf,
442  use_view_settings ? &scene->view_settings : NULL,
444 }
445 
447 {
448  return (sima->image && ELEM(sima->image->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE));
449 }
450 
452 {
453  if (ED_space_image_show_render(sima)) {
454  return false;
455  }
456 
457  return (sima->mode == SI_MODE_PAINT);
458 }
459 
461 {
462  if (sima) {
463  if (ED_space_image_show_render(sima)) {
464  return false;
465  }
466  if (sima->mode != SI_MODE_UV) {
467  return false;
468  }
469  }
470 
471  if (obedit && obedit->type == OB_MESH) {
472  struct BMEditMesh *em = BKE_editmesh_from_object(obedit);
473  bool ret;
474 
475  ret = EDBM_uv_check(em);
476 
477  return ret;
478  }
479 
480  return false;
481 }
482 
483 /* matches clip function */
485 {
486  /* check editmode - this is reserved for UV editing */
487  if (obedit && ED_space_image_show_uvedit(sima, obedit)) {
488  return false;
489  }
490 
491  return (sima->mode == SI_MODE_MASK);
492 }
493 
495 {
497 
498  if (sima) {
499  ViewLayer *view_layer = CTX_data_view_layer(C);
500  Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer);
501  return ED_space_image_check_show_maskedit(sima, obedit);
502  }
503 
504  return false;
505 }
506 
508 {
510 
511  if (sima && sima->mode == SI_MODE_PAINT) {
513 
514  if (br && (br->flag & BRUSH_CURVE)) {
515  return true;
516  }
517  }
518 
519  return false;
520 }
521 
523 {
526  return sima->mask_info.mask != NULL;
527  }
528 
529  return false;
530 }
531 
533 {
536 }
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:1034
struct ViewLayer * CTX_data_view_layer(const bContext *C)
Definition: context.c:1044
struct Object * CTX_data_active_object(const bContext *C)
Definition: context.c:1279
struct SpaceImage * CTX_wm_space_image(const bContext *C)
Definition: context.c:800
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1018
struct ToolSettings * CTX_data_tool_settings(const bContext *C)
Definition: context.c:1208
BMEditMesh * BKE_editmesh_from_object(struct Object *ob)
Return the BMEditMesh for a given object.
Definition: editmesh.c:85
void BKE_image_release_ibuf(struct Image *ima, struct ImBuf *ibuf, void *lock)
Definition: image.c:5113
struct ImBuf * BKE_image_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, void **r_lock)
Definition: image.c:5100
void BKE_image_get_aspect(struct Image *image, float *r_aspx, float *r_aspy)
Definition: image.c:5544
void BKE_image_get_size(struct Image *image, struct ImageUser *iuser, int *r_width, int *r_height)
Definition: image.c:5502
#define IMA_SIGNAL_USER_NEW_IMAGE
Definition: BKE_image.h:167
void BKE_image_signal(struct Main *bmain, struct Image *ima, struct ImageUser *iuser, int signal)
Definition: image.c:3499
struct RenderSlot * BKE_image_get_renderslot(struct Image *ima, int index)
Definition: image.c:5976
void id_us_ensure_real(struct ID *id)
Definition: lib_id.c:238
#define BLI_assert(a)
Definition: BLI_assert.h:58
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:157
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition: BLI_rect.h:153
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
Definition: BLI_rect.h:161
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
Definition: BLI_rect.h:165
#define ELEM(...)
@ BRUSH_CURVE
@ IMA_GPU_REFRESH
@ IMA_TYPE_R_RESULT
@ IMA_TYPE_COMPOSITE
@ 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)
#define R_BORDER
#define R_CROP
@ 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:518
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:125
_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
_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
Contains defines and structs used throughout the imbuf module.
#define C
Definition: RandGen.cpp:39
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 NC_GEOM
Definition: WM_types.h:294
#define ND_DATA
Definition: WM_types.h:408
#define ND_SPACE_IMAGE
Definition: WM_types.h:417
#define NC_MASK
Definition: WM_types.h:299
#define NC_SPACE
Definition: WM_types.h:293
#define NA_SELECTED
Definition: WM_types.h:467
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
short gpuflag
short last_render_slot
float aspy
ListBase renderslots
short type
short render_slot
float aspx
Scene scene
static CCL_NAMESPACE_BEGIN const double alpha
void ED_space_image_release_buffer(SpaceImage *sima, ImBuf *ibuf, void *lock)
Definition: image_edit.c:171
void ED_space_image_auto_set(const bContext *C, SpaceImage *sima)
Definition: image_edit.c:90
void ED_space_image_get_size(SpaceImage *sima, int *r_width, int *r_height)
Definition: image_edit.c:215
int ED_space_image_get_display_channel_mask(ImBuf *ibuf)
Definition: image_edit.c:179
bool ED_space_image_maskedit_mask_poll(bContext *C)
Definition: image_edit.c:522
Image * ED_space_image(SpaceImage *sima)
Definition: image_edit.c:55
void ED_image_mouse_pos(SpaceImage *sima, const ARegion *region, const int mval[2], float co[2])
Definition: image_edit.c:320
ImBuf * ED_space_image_acquire_buffer(SpaceImage *sima, void **r_lock, int tile)
Definition: image_edit.c:139
void ED_space_image_get_uv_aspect(SpaceImage *sima, float *r_aspx, float *r_aspy)
Definition: image_edit.c:282
bool ED_space_image_paint_curve(const bContext *C)
Definition: image_edit.c:507
bool ED_space_image_check_show_maskedit(SpaceImage *sima, Object *obedit)
Definition: image_edit.c:484
void ED_image_point_pos(SpaceImage *sima, const ARegion *region, float x, float y, float *r_x, float *r_y)
Definition: image_edit.c:346
Mask * ED_space_image_get_mask(SpaceImage *sima)
Definition: image_edit.c:122
void ED_image_get_uv_aspect(Image *ima, ImageUser *iuser, float *r_aspx, float *r_aspy)
Definition: image_edit.c:302
void ED_space_image_scopes_update(const struct bContext *C, struct SpaceImage *sima, struct ImBuf *ibuf, bool use_view_settings)
Definition: image_edit.c:416
bool ED_space_image_show_uvedit(SpaceImage *sima, Object *obedit)
Definition: image_edit.c:460
bool ED_space_image_has_buffer(SpaceImage *sima)
Definition: image_edit.c:202
bool ED_space_image_show_paint(SpaceImage *sima)
Definition: image_edit.c:451
void ED_space_image_set(Main *bmain, SpaceImage *sima, Object *obedit, Image *ima, bool automatic)
Definition: image_edit.c:60
bool ED_space_image_maskedit_poll(bContext *C)
Definition: image_edit.c:494
void ED_space_image_get_aspect(SpaceImage *sima, float *r_aspx, float *r_aspy)
Definition: image_edit.c:256
bool ED_image_slot_cycle(struct Image *image, int direction)
Definition: image_edit.c:382
bool ED_space_image_show_render(SpaceImage *sima)
Definition: image_edit.c:446
void ED_space_image_get_size_fl(SpaceImage *sima, float r_size[2])
Definition: image_edit.c:248
void ED_space_image_get_zoom(SpaceImage *sima, const ARegion *region, float *r_zoomx, float *r_zoomy)
Definition: image_edit.c:267
void ED_space_image_set_mask(bContext *C, SpaceImage *sima, Mask *mask)
Definition: image_edit.c:127
void ED_image_point_pos__reverse(SpaceImage *sima, const ARegion *region, const float co[2], float r_co[2])
Definition: image_edit.c:361
bool ED_space_image_cursor_poll(bContext *C)
Definition: image_edit.c:532
void ED_image_view_center_to_point(SpaceImage *sima, float x, float y)
Definition: image_edit.c:334
return ret
struct BMesh * bm
Definition: BKE_editmesh.h:52
short mat_nr
Definition: bmesh_class.h:281
Definition: DNA_ID.h:273
float * zbuf_float
int channels
unsigned int * rect
float * rect_float
int * zbuf
struct Scene * scene
Definition: BKE_main.h:116
struct Mask * mask
void * data
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
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
#define G(x, y, z)
void WM_main_add_notifier(unsigned int type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)