Blender  V2.93
space_image.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_gpencil_types.h"
25 #include "DNA_image_types.h"
26 #include "DNA_mask_types.h"
27 #include "DNA_object_types.h"
28 #include "DNA_scene_types.h"
29 
30 #include "MEM_guardedalloc.h"
31 
32 #include "BLI_blenlib.h"
33 #include "BLI_math.h"
34 #include "BLI_threads.h"
35 
36 #include "BKE_colortools.h"
37 #include "BKE_context.h"
38 #include "BKE_image.h"
39 #include "BKE_lib_id.h"
40 #include "BKE_screen.h"
41 
42 #include "RNA_access.h"
43 #include "RNA_define.h"
44 #include "RNA_enum_types.h"
45 
46 #include "DEG_depsgraph.h"
47 
48 #include "IMB_imbuf_types.h"
49 
50 #include "ED_image.h"
51 #include "ED_mask.h"
52 #include "ED_node.h"
53 #include "ED_render.h"
54 #include "ED_screen.h"
55 #include "ED_space_api.h"
56 #include "ED_transform.h"
57 #include "ED_util.h"
58 #include "ED_uvedit.h"
59 
60 #include "WM_api.h"
61 #include "WM_types.h"
62 
63 #include "UI_interface.h"
64 #include "UI_resources.h"
65 #include "UI_view2d.h"
66 
67 #include "DRW_engine.h"
68 
69 #include "image_intern.h"
70 
71 /**************************** common state *****************************/
72 
74 {
75  SpaceImage *sima = (SpaceImage *)area->spacedata.first;
76  ARegion *region;
77 
78  /* only while histogram is visible */
79  for (region = area->regionbase.first; region; region = region->next) {
80  if (region->regiontype == RGN_TYPE_TOOL_PROPS && region->flag & RGN_FLAG_HIDDEN) {
81  return;
82  }
83  }
84 
85  sima->scopes.ok = 0;
86 }
87 
88 static void image_user_refresh_scene(const bContext *C, SpaceImage *sima)
89 {
90  /* Update scene image user for acquiring render results. */
91  sima->iuser.scene = CTX_data_scene(C);
92 
93  if (sima->image && sima->image->type == IMA_TYPE_R_RESULT) {
94  /* While rendering, prefer scene that is being rendered. */
95  Scene *render_scene = ED_render_job_get_current_scene(C);
96  if (render_scene) {
97  sima->iuser.scene = render_scene;
98  }
99  }
100 
101  /* Auto switch image to show in UV editor when selection changes. */
102  ED_space_image_auto_set(C, sima);
103 }
104 
105 /* ******************** default callbacks for image space ***************** */
106 
108 {
109  ARegion *region;
110  SpaceImage *simage;
111 
112  simage = MEM_callocN(sizeof(SpaceImage), "initimage");
113  simage->spacetype = SPACE_IMAGE;
114  simage->zoom = 1.0f;
115  simage->lock = true;
117  simage->uv_opacity = 1.0f;
119 
120  BKE_imageuser_default(&simage->iuser);
122 
123  BKE_scopes_new(&simage->scopes);
124  simage->sample_line_hist.height = 100;
125 
126  simage->tile_grid_shape[0] = 1;
127  simage->tile_grid_shape[1] = 1;
128 
129  /* tool header */
130  region = MEM_callocN(sizeof(ARegion), "tool header for image");
131 
132  BLI_addtail(&simage->regionbase, region);
136 
137  /* header */
138  region = MEM_callocN(sizeof(ARegion), "header for image");
139 
140  BLI_addtail(&simage->regionbase, region);
141  region->regiontype = RGN_TYPE_HEADER;
143 
144  /* buttons/list view */
145  region = MEM_callocN(sizeof(ARegion), "buttons for image");
146 
147  BLI_addtail(&simage->regionbase, region);
148  region->regiontype = RGN_TYPE_UI;
149  region->alignment = RGN_ALIGN_RIGHT;
150  region->flag = RGN_FLAG_HIDDEN;
151 
152  /* scopes/uv sculpt/paint */
153  region = MEM_callocN(sizeof(ARegion), "buttons for image");
154 
155  BLI_addtail(&simage->regionbase, region);
156  region->regiontype = RGN_TYPE_TOOLS;
157  region->alignment = RGN_ALIGN_LEFT;
158  region->flag = RGN_FLAG_HIDDEN;
159 
160  /* main area */
161  region = MEM_callocN(sizeof(ARegion), "main area for image");
162 
163  BLI_addtail(&simage->regionbase, region);
164  region->regiontype = RGN_TYPE_WINDOW;
165 
166  return (SpaceLink *)simage;
167 }
168 
169 /* not spacelink itself */
170 static void image_free(SpaceLink *sl)
171 {
172  SpaceImage *simage = (SpaceImage *)sl;
173 
174  BKE_scopes_free(&simage->scopes);
175 }
176 
177 /* spacetype; init callback, add handlers */
178 static void image_init(struct wmWindowManager *UNUSED(wm), ScrArea *area)
179 {
180  ListBase *lb = WM_dropboxmap_find("Image", SPACE_IMAGE, 0);
181 
182  /* add drop boxes */
183  WM_event_add_dropbox_handler(&area->handlers, lb);
184 }
185 
187 {
188  SpaceImage *simagen = MEM_dupallocN(sl);
189 
190  /* clear or remove stuff from old */
191 
192  BKE_scopes_new(&simagen->scopes);
193 
194  return (SpaceLink *)simagen;
195 }
196 
197 static void image_operatortypes(void)
198 {
209 #ifdef WITH_INPUT_NDOF
210  WM_operatortype_append(IMAGE_OT_view_ndof);
211 #endif
212 
224 
228 
233 
237 
239 
243 
247 }
248 
249 static void image_keymap(struct wmKeyConfig *keyconf)
250 {
251  WM_keymap_ensure(keyconf, "Image Generic", SPACE_IMAGE, 0);
252  WM_keymap_ensure(keyconf, "Image", SPACE_IMAGE, 0);
253 }
254 
255 /* dropboxes */
257  wmDrag *drag,
258  const wmEvent *event,
259  const char **UNUSED(r_tooltip))
260 {
262  if (ED_region_overlap_isect_any_xy(area, &event->x)) {
263  return false;
264  }
265  if (drag->type == WM_DRAG_PATH) {
266  /* rule might not work? */
267  if (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE, ICON_FILE_BLANK)) {
268  return true;
269  }
270  }
271  return false;
272 }
273 
274 static void image_drop_copy(wmDrag *drag, wmDropBox *drop)
275 {
276  /* copy drag path to properties */
277  RNA_string_set(drop->ptr, "filepath", drag->path);
278 }
279 
280 /* area+region dropbox definition */
281 static void image_dropboxes(void)
282 {
283  ListBase *lb = WM_dropboxmap_find("Image", SPACE_IMAGE, 0);
284 
285  WM_dropbox_add(lb, "IMAGE_OT_open", image_drop_poll, image_drop_copy, NULL);
286 }
287 
292 static void image_refresh(const bContext *C, ScrArea *area)
293 {
295  SpaceImage *sima = area->spacedata.first;
296  Image *ima;
297 
298  ima = ED_space_image(sima);
299  BKE_image_user_frame_calc(ima, &sima->iuser, scene->r.cfra);
300 
301  /* check if we have to set the image from the editmesh */
302  if (ima && (ima->source == IMA_SRC_VIEWER && sima->mode == SI_MODE_MASK)) {
303  if (scene->nodetree) {
305  if (mask) {
307  }
308  }
309  }
310 }
311 
313 {
314  wmWindow *win = params->window;
315  ScrArea *area = params->area;
316  wmNotifier *wmn = params->notifier;
317  SpaceImage *sima = (SpaceImage *)area->spacedata.first;
318 
319  /* context changes */
320  switch (wmn->category) {
321  case NC_WINDOW:
322  /* notifier comes from editing color space */
325  break;
326  case NC_SCENE:
327  switch (wmn->data) {
328  case ND_FRAME:
332  break;
333  case ND_MODE:
334  if (wmn->subtype == NS_EDITMODE_MESH) {
336  }
338  break;
339  case ND_RENDER_RESULT:
340  case ND_RENDER_OPTIONS:
341  case ND_COMPO_RESULT:
342  if (ED_space_image_show_render(sima)) {
344  }
346  break;
347  }
348  break;
349  case NC_IMAGE:
350  if (wmn->reference == sima->image || !wmn->reference) {
351  if (wmn->action != NA_PAINTING) {
355  }
356  }
357  break;
358  case NC_SPACE:
359  if (wmn->data == ND_SPACE_IMAGE) {
362  }
363  break;
364  case NC_MASK: {
365  ViewLayer *view_layer = WM_window_get_active_view_layer(win);
366  Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer);
367  if (ED_space_image_check_show_maskedit(sima, obedit)) {
368  switch (wmn->data) {
369  case ND_SELECT:
371  break;
372  case ND_DATA:
373  case ND_DRAW:
374  /* causes node-recalc */
377  break;
378  }
379  switch (wmn->action) {
380  case NA_SELECTED:
382  break;
383  case NA_EDITED:
384  /* causes node-recalc */
387  break;
388  }
389  }
390  break;
391  }
392  case NC_GEOM: {
393  switch (wmn->data) {
394  case ND_DATA:
395  case ND_SELECT:
399  break;
400  }
401  break;
402  }
403  case NC_OBJECT: {
404  switch (wmn->data) {
405  case ND_TRANSFORM:
406  case ND_MODIFIER: {
407  ViewLayer *view_layer = WM_window_get_active_view_layer(win);
408  Object *ob = OBACT(view_layer);
409  if (ob && (ob == wmn->reference) && (ob->mode & OB_MODE_EDIT)) {
410  if (sima->lock && (sima->flag & SI_DRAWSHADOW)) {
413  }
414  }
415  break;
416  }
417  }
418 
419  break;
420  }
421  case NC_ID: {
422  if (wmn->action == NA_RENAME) {
424  }
425  break;
426  }
427  case NC_WM:
428  if (wmn->data == ND_UNDO) {
431  }
432  break;
433  }
434 }
435 
436 const char *image_context_dir[] = {"edit_image", "edit_mask", NULL};
437 
438 static int /*eContextResult*/ image_context(const bContext *C,
439  const char *member,
441 {
443 
444  if (CTX_data_dir(member)) {
446  /* TODO(sybren): return CTX_RESULT_OK; */
447  }
448  else if (CTX_data_equals(member, "edit_image")) {
450  return CTX_RESULT_OK;
451  }
452  else if (CTX_data_equals(member, "edit_mask")) {
454  if (mask) {
456  }
457  return CTX_RESULT_OK;
458  }
460 }
461 
463 {
464  gzgt->name = "UV Transform Gizmo";
465  gzgt->idname = "IMAGE_GGT_gizmo2d";
466 
469 
472 
474 }
475 
477 {
478  gzgt->name = "UV Translate Gizmo";
479  gzgt->idname = "IMAGE_GGT_gizmo2d_translate";
480 
483 
486 
488 }
489 
491 {
492  gzgt->name = "UV Transform Gizmo Resize";
493  gzgt->idname = "IMAGE_GGT_gizmo2d_resize";
494 
497 
500 
502 }
503 
505 {
506  gzgt->name = "UV Transform Gizmo Resize";
507  gzgt->idname = "IMAGE_GGT_gizmo2d_rotate";
508 
511 
514 
516 }
517 
519 {
520  VIEW2D_GGT_navigate_impl(gzgt, "IMAGE_GGT_navigate");
521 }
522 
523 static void image_widgets(void)
524 {
527 
532 
534 }
535 
536 /************************** main region ***************************/
537 
538 /* sets up the fields of the View2D from zoom and offset */
540 {
541  Image *ima = ED_space_image(sima);
542 
543  int width, height;
545 
546  float w = width;
547  float h = height;
548 
549  if (ima) {
550  h *= ima->aspy / ima->aspx;
551  }
552 
553  int winx = BLI_rcti_size_x(&region->winrct) + 1;
554  int winy = BLI_rcti_size_y(&region->winrct) + 1;
555 
556  /* For region overlap, move center so image doesn't overlap header. */
557  const rcti *visible_rect = ED_region_visible_rect(region);
558  const int visible_winy = BLI_rcti_size_y(visible_rect) + 1;
559  int visible_centerx = 0;
560  int visible_centery = visible_rect->ymin + (visible_winy - winy) / 2;
561 
562  region->v2d.tot.xmin = 0;
563  region->v2d.tot.ymin = 0;
564  region->v2d.tot.xmax = w;
565  region->v2d.tot.ymax = h;
566 
567  region->v2d.mask.xmin = region->v2d.mask.ymin = 0;
568  region->v2d.mask.xmax = winx;
569  region->v2d.mask.ymax = winy;
570 
571  /* which part of the image space do we see? */
572  float x1 = region->winrct.xmin + visible_centerx + (winx - sima->zoom * w) / 2.0f;
573  float y1 = region->winrct.ymin + visible_centery + (winy - sima->zoom * h) / 2.0f;
574 
575  x1 -= sima->zoom * sima->xof;
576  y1 -= sima->zoom * sima->yof;
577 
578  /* relative display right */
579  region->v2d.cur.xmin = ((region->winrct.xmin - (float)x1) / sima->zoom);
580  region->v2d.cur.xmax = region->v2d.cur.xmin + ((float)winx / sima->zoom);
581 
582  /* relative display left */
583  region->v2d.cur.ymin = ((region->winrct.ymin - (float)y1) / sima->zoom);
584  region->v2d.cur.ymax = region->v2d.cur.ymin + ((float)winy / sima->zoom);
585 
586  /* normalize 0.0..1.0 */
587  region->v2d.cur.xmin /= w;
588  region->v2d.cur.xmax /= w;
589  region->v2d.cur.ymin /= h;
590  region->v2d.cur.ymax /= h;
591 }
592 
593 /* add handlers, stuff you only do once or on area/region changes */
595 {
596  wmKeyMap *keymap;
597 
598  /* NOTE: don't use `UI_view2d_region_reinit(&region->v2d, ...)`
599  * since the space clip manages own v2d in #image_main_region_set_view2d */
600 
601  /* mask polls mode */
602  keymap = WM_keymap_ensure(wm->defaultconf, "Mask Editing", 0, 0);
604 
605  /* image paint polls for mode */
606  keymap = WM_keymap_ensure(wm->defaultconf, "Curve", 0, 0);
608 
609  keymap = WM_keymap_ensure(wm->defaultconf, "Paint Curve", 0, 0);
610  WM_event_add_keymap_handler(&region->handlers, keymap);
611 
612  keymap = WM_keymap_ensure(wm->defaultconf, "Image Paint", 0, 0);
614 
615  keymap = WM_keymap_ensure(wm->defaultconf, "UV Editor", 0, 0);
616  WM_event_add_keymap_handler(&region->handlers, keymap);
617 
618  /* own keymaps */
619  keymap = WM_keymap_ensure(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0);
620  WM_event_add_keymap_handler(&region->handlers, keymap);
621  keymap = WM_keymap_ensure(wm->defaultconf, "Image", SPACE_IMAGE, 0);
623 }
624 
625 static void image_main_region_draw(const bContext *C, ARegion *region)
626 {
627  /* draw entirely, view changes should be handled here */
629  Object *obedit = CTX_data_edit_object(C);
631  Mask *mask = NULL;
633  View2D *v2d = &region->v2d;
634  Image *image = ED_space_image(sima);
635  const bool show_viewer = (image && image->source == IMA_SRC_VIEWER);
636 
637  /* XXX not supported yet, disabling for now */
638  scene->r.scemode &= ~R_COMP_CROP;
639 
641 
642  /* we set view2d from own zoom and offset each time */
643  image_main_region_set_view2d(sima, region);
644 
645  /* check for mask (delay draw) */
646  if (!ED_space_image_show_uvedit(sima, obedit) && sima->mode == SI_MODE_MASK) {
648  }
649 
650  if (show_viewer) {
652  }
653  DRW_draw_view(C);
654  if (show_viewer) {
656  }
657 
658  draw_image_main_helpers(C, region);
659 
660  /* Draw Meta data of the image isn't added to the DrawManager as it is
661  * used in other areas as well. */
662  if (sima->overlay.flag & SI_OVERLAY_SHOW_OVERLAYS && sima->flag & SI_DRAW_METADATA) {
663  void *lock;
664  /* `ED_space_image_get_zoom` temporarily locks the image, so this needs to be done before
665  * the image is locked when calling `ED_space_image_acquire_buffer`. */
666  float zoomx, zoomy;
667  ED_space_image_get_zoom(sima, region, &zoomx, &zoomy);
668  ImBuf *ibuf = ED_space_image_acquire_buffer(sima, &lock, 0);
669  if (ibuf) {
670  int x, y;
671  rctf frame;
672  BLI_rctf_init(&frame, 0.0f, ibuf->x, 0.0f, ibuf->y);
673  UI_view2d_view_to_region(&region->v2d, 0.0f, 0.0f, &x, &y);
674  ED_region_image_metadata_draw(x, y, ibuf, &frame, zoomx, zoomy);
675  ED_space_image_release_buffer(sima, ibuf, lock);
676  }
677  }
678 
679  /* sample line */
683 
684  if (mask) {
685  int width, height;
686  float aspx, aspy;
687 
688  if (show_viewer) {
689  /* ED_space_image_get* will acquire image buffer which requires
690  * lock here by the same reason why lock is needed in draw_image_main
691  */
693  }
694 
696  ED_space_image_get_aspect(sima, &aspx, &aspy);
697 
698  if (show_viewer) {
700  }
701 
703  mask,
704  region,
705  /* Mask overlay is drawn by image/overlay engine. */
707  sima->mask_info.draw_type,
708  sima->mask_info.overlay_mode,
709  width,
710  height,
711  aspx,
712  aspy,
713  true,
714  false,
715  NULL,
716  C);
717  }
718 
720  draw_image_cache(C, region);
721 }
722 
724 {
725  ScrArea *area = params->area;
726  ARegion *region = params->region;
727  wmNotifier *wmn = params->notifier;
728 
729  /* context changes */
730  switch (wmn->category) {
731  case NC_GEOM:
732  if (ELEM(wmn->data, ND_DATA, ND_SELECT)) {
734  }
735  break;
736  case NC_GPENCIL:
737  if (ELEM(wmn->action, NA_EDITED, NA_SELECTED)) {
738  ED_region_tag_redraw(region);
739  }
740  else if (wmn->data & ND_GPENCIL_EDITMODE) {
741  ED_region_tag_redraw(region);
742  }
743  break;
744  case NC_IMAGE:
745  if (wmn->action == NA_PAINTING) {
746  ED_region_tag_redraw(region);
747  }
749  break;
750  case NC_MATERIAL:
751  if (wmn->data == ND_SHADING_LINKS) {
752  SpaceImage *sima = area->spacedata.first;
753 
754  if (sima->iuser.scene && (sima->iuser.scene->toolsettings->uv_flag & UV_SHOW_SAME_IMAGE)) {
755  ED_region_tag_redraw(region);
756  }
757  }
758  break;
759  case NC_SCREEN:
760  if (ELEM(wmn->data, ND_LAYER)) {
761  ED_region_tag_redraw(region);
762  }
763  break;
764  }
765 }
766 
767 /* *********************** buttons region ************************ */
768 
769 /* add handlers, stuff you only do once or on area/region changes */
771 {
772  wmKeyMap *keymap;
773 
775  ED_region_panels_init(wm, region);
776 
777  keymap = WM_keymap_ensure(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0);
778  WM_event_add_keymap_handler(&region->handlers, keymap);
779 }
780 
781 static void image_buttons_region_layout(const bContext *C, ARegion *region)
782 {
783  const enum eContextObjectMode mode = CTX_data_mode_enum(C);
784  const char *contexts_base[3] = {NULL};
785 
786  const char **contexts = contexts_base;
787 
789  switch (sima->mode) {
790  case SI_MODE_VIEW:
791  break;
792  case SI_MODE_PAINT:
793  ARRAY_SET_ITEMS(contexts, ".paint_common_2d", ".imagepaint_2d");
794  break;
795  case SI_MODE_MASK:
796  break;
797  case SI_MODE_UV:
798  if (mode == CTX_MODE_EDIT_MESH) {
799  ARRAY_SET_ITEMS(contexts, ".uv_sculpt");
800  }
801  break;
802  }
803 
804  ED_region_panels_layout_ex(C, region, &region->type->paneltypes, contexts_base, NULL);
805 }
806 
807 static void image_buttons_region_draw(const bContext *C, ARegion *region)
808 {
811  void *lock;
812  /* TODO(lukas): Support tiles in scopes? */
813  ImBuf *ibuf = ED_space_image_acquire_buffer(sima, &lock, 0);
814  /* XXX performance regression if name of scopes category changes! */
815  PanelCategoryStack *category = UI_panel_category_active_find(region, "Scopes");
816 
817  /* only update scopes if scope category is active */
818  if (category) {
819  if (ibuf) {
820  if (!sima->scopes.ok) {
823  }
824  if (sima->image->flag & IMA_VIEW_AS_RENDER) {
825  ED_space_image_scopes_update(C, sima, ibuf, true);
826  }
827  else {
828  ED_space_image_scopes_update(C, sima, ibuf, false);
829  }
830  }
831  }
832  ED_space_image_release_buffer(sima, ibuf, lock);
833 
834  /* Layout handles details. */
835  ED_region_panels_draw(C, region);
836 }
837 
839 {
840  ARegion *region = params->region;
841  wmNotifier *wmn = params->notifier;
842 
843  /* context changes */
844  switch (wmn->category) {
845  case NC_TEXTURE:
846  case NC_MATERIAL:
847  /* sending by texture render job and needed to properly update displaying
848  * brush texture icon */
849  ED_region_tag_redraw(region);
850  break;
851  case NC_SCENE:
852  switch (wmn->data) {
853  case ND_MODE:
854  case ND_RENDER_RESULT:
855  case ND_COMPO_RESULT:
856  ED_region_tag_redraw(region);
857  break;
858  }
859  break;
860  case NC_IMAGE:
861  if (wmn->action != NA_PAINTING) {
862  ED_region_tag_redraw(region);
863  }
864  break;
865  case NC_NODE:
866  ED_region_tag_redraw(region);
867  break;
868  case NC_GPENCIL:
869  if (ELEM(wmn->action, NA_EDITED, NA_SELECTED)) {
870  ED_region_tag_redraw(region);
871  }
872  break;
873  case NC_BRUSH:
874  if (wmn->action == NA_EDITED) {
875  ED_region_tag_redraw(region);
876  }
877  break;
878  }
879 }
880 
881 /* *********************** scopes region ************************ */
882 
883 /* add handlers, stuff you only do once or on area/region changes */
885 {
886  wmKeyMap *keymap;
887 
889  ED_region_panels_init(wm, region);
890 
891  keymap = WM_keymap_ensure(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0);
892  WM_event_add_keymap_handler(&region->handlers, keymap);
893 }
894 
895 static void image_tools_region_draw(const bContext *C, ARegion *region)
896 {
897  ED_region_panels(C, region);
898 }
899 
901 {
902  ARegion *region = params->region;
903  wmNotifier *wmn = params->notifier;
904 
905  /* context changes */
906  switch (wmn->category) {
907  case NC_GPENCIL:
908  if (wmn->data == ND_DATA || ELEM(wmn->action, NA_EDITED, NA_SELECTED)) {
909  ED_region_tag_redraw(region);
910  }
911  break;
912  case NC_BRUSH:
913  /* NA_SELECTED is used on brush changes */
914  if (ELEM(wmn->action, NA_EDITED, NA_SELECTED)) {
915  ED_region_tag_redraw(region);
916  }
917  break;
918  case NC_SCENE:
919  switch (wmn->data) {
920  case ND_MODE:
921  case ND_RENDER_RESULT:
922  case ND_COMPO_RESULT:
923  ED_region_tag_redraw(region);
924  break;
925  }
926  break;
927  case NC_IMAGE:
928  if (wmn->action != NA_PAINTING) {
929  ED_region_tag_redraw(region);
930  }
931  break;
932  case NC_NODE:
933  ED_region_tag_redraw(region);
934  break;
935  }
936 }
937 
938 /************************* header region **************************/
939 
940 /* add handlers, stuff you only do once or on area/region changes */
942 {
943  ED_region_header_init(region);
944 }
945 
946 static void image_header_region_draw(const bContext *C, ARegion *region)
947 {
949  SpaceImage *sima = area->spacedata.first;
950 
952 
953  ED_region_header(C, region);
954 }
955 
957 {
958  ARegion *region = params->region;
959  wmNotifier *wmn = params->notifier;
960 
961  /* context changes */
962  switch (wmn->category) {
963  case NC_SCENE:
964  switch (wmn->data) {
965  case ND_MODE:
966  case ND_TOOLSETTINGS:
967  ED_region_tag_redraw(region);
968  break;
969  }
970  break;
971  case NC_GEOM:
972  switch (wmn->data) {
973  case ND_DATA:
974  case ND_SELECT:
975  ED_region_tag_redraw(region);
976  break;
977  }
978  break;
979  case NC_BRUSH:
980  if (wmn->action == NA_EDITED) {
981  ED_region_tag_redraw(region);
982  }
983  break;
984  }
985 }
986 
987 static void image_id_remap(ScrArea *UNUSED(area), SpaceLink *slink, ID *old_id, ID *new_id)
988 {
989  SpaceImage *simg = (SpaceImage *)slink;
990 
991  if (!ELEM(GS(old_id->name), ID_IM, ID_GD, ID_MSK)) {
992  return;
993  }
994 
995  if ((ID *)simg->image == old_id) {
996  simg->image = (Image *)new_id;
997  id_us_ensure_real(new_id);
998  }
999 
1000  if ((ID *)simg->gpd == old_id) {
1001  simg->gpd = (bGPdata *)new_id;
1002  id_us_min(old_id);
1003  id_us_plus(new_id);
1004  }
1005 
1006  if ((ID *)simg->mask_info.mask == old_id) {
1007  simg->mask_info.mask = (Mask *)new_id;
1008  id_us_ensure_real(new_id);
1009  }
1010 }
1011 
1018 {
1019  SpaceImage *sima = area->spacedata.first;
1020  return sima->mode == SI_MODE_UV ? SI_MODE_UV : SI_MODE_VIEW;
1021 }
1022 
1023 static void image_space_subtype_set(ScrArea *area, int value)
1024 {
1025  SpaceImage *sima = area->spacedata.first;
1026  if (value == SI_MODE_UV) {
1027  if (sima->mode != SI_MODE_UV) {
1028  sima->mode_prev = sima->mode;
1029  }
1030  sima->mode = value;
1031  }
1032  else {
1033  sima->mode = sima->mode_prev;
1034  }
1035 }
1036 
1038  EnumPropertyItem **item,
1039  int *totitem)
1040 {
1042 }
1043 
1044 /**************************** spacetype *****************************/
1045 
1046 /* only called once, from space/spacetypes.c */
1048 {
1049  SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype image");
1050  ARegionType *art;
1051 
1052  st->spaceid = SPACE_IMAGE;
1053  strncpy(st->name, "Image", BKE_ST_MAXNAME);
1054 
1055  st->create = image_create;
1056  st->free = image_free;
1057  st->init = image_init;
1058  st->duplicate = image_duplicate;
1060  st->keymap = image_keymap;
1061  st->dropboxes = image_dropboxes;
1062  st->refresh = image_refresh;
1063  st->listener = image_listener;
1064  st->context = image_context;
1065  st->gizmos = image_widgets;
1066  st->id_remap = image_id_remap;
1070 
1071  /* regions: main window */
1072  art = MEM_callocN(sizeof(ARegionType), "spacetype image region");
1073  art->regionid = RGN_TYPE_WINDOW;
1078  BLI_addhead(&st->regiontypes, art);
1079 
1080  /* regions: listview/buttons/scopes */
1081  art = MEM_callocN(sizeof(ARegionType), "spacetype image region");
1082  art->regionid = RGN_TYPE_UI;
1090  BLI_addhead(&st->regiontypes, art);
1091 
1094 
1095  /* regions: tool(bar) */
1096  art = MEM_callocN(sizeof(ARegionType), "spacetype image region");
1097  art->regionid = RGN_TYPE_TOOLS;
1098  art->prefsizex = 58; /* XXX */
1099  art->prefsizey = 50; /* XXX */
1106  BLI_addhead(&st->regiontypes, art);
1107 
1108  /* regions: tool header */
1109  art = MEM_callocN(sizeof(ARegionType), "spacetype image tool header region");
1111  art->prefsizey = HEADERY;
1117  BLI_addhead(&st->regiontypes, art);
1118 
1119  /* regions: header */
1120  art = MEM_callocN(sizeof(ARegionType), "spacetype image region");
1121  art->regionid = RGN_TYPE_HEADER;
1122  art->prefsizey = HEADERY;
1127 
1128  BLI_addhead(&st->regiontypes, art);
1129 
1130  /* regions: hud */
1131  art = ED_area_type_hud(st->spaceid);
1132  BLI_addhead(&st->regiontypes, art);
1133 
1135 }
typedef float(TangentPoint)[2]
void BKE_scopes_new(struct Scopes *scopes)
Definition: colortools.c:1737
void BKE_histogram_update_sample_line(struct Histogram *hist, struct ImBuf *ibuf, const struct ColorManagedViewSettings *view_settings, const struct ColorManagedDisplaySettings *display_settings)
void BKE_scopes_free(struct Scopes *scopes)
Definition: colortools.c:1717
struct ScrArea * CTX_wm_area(const bContext *C)
Definition: context.c:714
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1034
void CTX_data_dir_set(bContextDataResult *result, const char **dir)
Definition: context.c:672
struct Object * CTX_data_edit_object(const bContext *C)
Definition: context.c:1296
bool CTX_data_equals(const char *member, const char *str)
Definition: context.c:623
void CTX_data_id_pointer_set(bContextDataResult *result, struct ID *id)
Definition: context.c:633
bool CTX_data_dir(const char *member)
Definition: context.c:628
eContextObjectMode
Definition: BKE_context.h:114
@ CTX_MODE_EDIT_MESH
Definition: BKE_context.h:115
struct Depsgraph * CTX_data_expect_evaluated_depsgraph(const bContext *C)
Definition: context.c:1415
@ CTX_RESULT_MEMBER_NOT_FOUND
Definition: BKE_context.h:86
@ CTX_RESULT_OK
Definition: BKE_context.h:83
struct SpaceImage * CTX_wm_space_image(const bContext *C)
Definition: context.c:800
enum eContextObjectMode CTX_data_mode_enum(const bContext *C)
Definition: context.c:1174
void BKE_image_user_frame_calc(struct Image *ima, struct ImageUser *iuser, int cfra)
Definition: image.c:5335
void BKE_imageuser_default(struct ImageUser *iuser)
Definition: image.c:3451
void id_us_min(struct ID *id)
Definition: lib_id.c:297
void id_us_ensure_real(struct ID *id)
Definition: lib_id.c:238
void id_us_plus(struct ID *id)
Definition: lib_id.c:288
#define BKE_ST_MAXNAME
Definition: BKE_screen.h:68
void BKE_spacetype_register(struct SpaceType *st)
Definition: screen.c:420
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:87
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:110
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
Definition: BLI_rect.h:157
void BLI_rctf_init(struct rctf *rect, float xmin, float xmax, float ymin, float ymax)
Definition: rct.c:436
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition: BLI_rect.h:153
void BLI_thread_unlock(int type)
Definition: threads.cc:389
void BLI_thread_lock(int type)
Definition: threads.cc:384
@ LOCK_DRAW_IMAGE
Definition: BLI_threads.h:68
#define ARRAY_SET_ITEMS(...)
#define UNUSED(x)
#define ELEM(...)
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
@ ID_IM
Definition: DNA_ID_enums.h:65
@ ID_MSK
Definition: DNA_ID_enums.h:86
@ ID_GD
Definition: DNA_ID_enums.h:83
@ IMA_VIEW_AS_RENDER
#define IMA_ANIM_ALWAYS
#define IMA_SHOW_MAX_RESOLUTION
@ IMA_TYPE_R_RESULT
@ IMA_SRC_VIEWER
#define IMA_SHOW_STEREO
#define MASK_DRAWFLAG_OVERLAY
@ OB_MODE_EDIT
Object is a sort of wrapper for general info.
#define OBEDIT_FROM_VIEW_LAYER(view_layer)
#define UV_SHOW_SAME_IMAGE
#define OBACT(_view_layer)
#define R_COMP_CROP
#define HEADERY
@ RGN_ALIGN_BOTTOM
@ RGN_ALIGN_LEFT
@ RGN_ALIGN_TOP
@ RGN_ALIGN_RIGHT
@ RGN_FLAG_HIDDEN
@ RGN_FLAG_HIDDEN_BY_USER
@ RGN_TYPE_TOOL_HEADER
@ RGN_TYPE_UI
@ RGN_TYPE_WINDOW
@ RGN_TYPE_HEADER
@ RGN_TYPE_TOOLS
@ RGN_TYPE_TOOL_PROPS
@ SI_SHOW_GPENCIL
@ SI_DRAW_METADATA
@ SI_USE_ALPHA
@ SI_COORDFLOATS
@ SI_DRAWSHADOW
@ SI_OVERLAY_SHOW_OVERLAYS
@ SPACE_IMAGE
@ SI_MODE_PAINT
@ SI_MODE_VIEW
@ SI_MODE_MASK
@ SI_MODE_UV
@ USER_HEADER_BOTTOM
@ V2D_SCROLL_VERTICAL_HIDE
@ V2D_SCROLL_RIGHT
void DRW_draw_view(const struct bContext *C)
void ED_space_image_release_buffer(struct SpaceImage *sima, struct ImBuf *ibuf, void *lock)
Definition: image_edit.c:171
struct Mask * ED_space_image_get_mask(struct SpaceImage *sima)
Definition: image_edit.c:122
bool ED_space_image_check_show_maskedit(struct SpaceImage *sima, struct Object *obedit)
Definition: image_edit.c:484
void ED_space_image_auto_set(const struct bContext *C, struct SpaceImage *sima)
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
struct Image * ED_space_image(struct SpaceImage *sima)
Definition: image_edit.c:55
void ED_space_image_get_zoom(struct SpaceImage *sima, const struct ARegion *region, float *r_zoomx, float *r_zoomy)
bool ED_space_image_show_uvedit(struct SpaceImage *sima, struct Object *obedit)
Definition: image_edit.c:460
bool ED_space_image_show_render(struct SpaceImage *sima)
Definition: image_edit.c:446
void ED_space_image_get_size(struct SpaceImage *sima, int *r_width, int *r_height)
Definition: image_edit.c:215
void ED_space_image_get_aspect(struct SpaceImage *sima, float *r_aspx, float *r_aspy)
Definition: image_edit.c:256
struct ImBuf * ED_space_image_acquire_buffer(struct SpaceImage *sima, void **r_lock, int tile)
Definition: image_edit.c:139
void ED_mask_draw_region(struct Depsgraph *depsgraph, struct Mask *mask, struct ARegion *region, const char draw_flag, const char draw_type, const eMaskOverlayMode overlay_mode, const int width_i, const int height_i, const float aspx, const float aspy, const bool do_scale_applied, const bool do_draw_cb, float stabmat[4][4], const struct bContext *C)
void ED_node_composite_job(const struct bContext *C, struct bNodeTree *nodetree, struct Scene *scene_owner)
struct Scene * ED_render_job_get_current_scene(const struct bContext *C)
void ED_area_tag_redraw(ScrArea *area)
Definition: area.c:745
void ED_region_header(const struct bContext *C, struct ARegion *region)
void ED_area_do_mgs_subscribe_for_tool_ui(const struct wmRegionMessageSubscribeParams *params)
bool ED_region_overlap_isect_any_xy(const ScrArea *area, const int event_xy[2])
Definition: area_query.c:64
int ED_region_generic_tools_region_snap_size(const struct ARegion *region, int size, int axis)
void ED_region_generic_tools_region_message_subscribe(const struct wmRegionMessageSubscribeParams *params)
void ED_region_panels(const struct bContext *C, struct ARegion *region)
void ED_region_panels_draw(const struct bContext *C, struct ARegion *region)
void ED_area_do_mgs_subscribe_for_tool_header(const struct wmRegionMessageSubscribeParams *params)
struct ARegionType * ED_area_type_hud(int space_type)
void ED_region_panels_init(struct wmWindowManager *wm, struct ARegion *region)
Definition: area.c:3090
void ED_region_tag_redraw(struct ARegion *region)
Definition: area.c:667
void ED_region_header_init(struct ARegion *region)
Definition: area.c:3358
void ED_area_tag_refresh(ScrArea *area)
Definition: area.c:774
void ED_region_panels_layout_ex(const struct bContext *C, struct ARegion *region, struct ListBase *paneltypes, const char *contexts[], const char *category_override)
@ ED_KEYMAP_UI
Definition: ED_screen.h:440
@ ED_KEYMAP_HEADER
Definition: ED_screen.h:446
@ ED_KEYMAP_TOOL
Definition: ED_screen.h:442
@ ED_KEYMAP_GPENCIL
Definition: ED_screen.h:448
@ ED_KEYMAP_GIZMO
Definition: ED_screen.h:441
@ ED_KEYMAP_VIEW2D
Definition: ED_screen.h:443
@ ED_KEYMAP_FRAMES
Definition: ED_screen.h:445
const rcti * ED_region_visible_rect(ARegion *region)
Definition: area.c:3682
void ED_widgetgroup_gizmo2d_xform_no_cage_callbacks_set(struct wmGizmoGroupType *gzgt)
void ED_widgetgroup_gizmo2d_xform_callbacks_set(struct wmGizmoGroupType *gzgt)
void ED_widgetgroup_gizmo2d_rotate_callbacks_set(struct wmGizmoGroupType *gzgt)
void ED_widgetgroup_gizmo2d_resize_callbacks_set(struct wmGizmoGroupType *gzgt)
void ED_region_image_metadata_draw(int x, int y, struct ImBuf *ibuf, const rctf *frame, float zoomx, float zoomy)
Definition: ed_draw.c:313
void ED_uvedit_buttons_register(struct ARegionType *art)
_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 GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble y1
_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.
Read Guarded memory(de)allocation.
#define C
Definition: RandGen.cpp:39
#define UI_SIDEBAR_PANEL_WIDTH
Definition: UI_interface.h:245
struct PanelCategoryStack * UI_panel_category_active_find(struct ARegion *region, const char *idname)
void VIEW2D_GGT_navigate_impl(struct wmGizmoGroupType *gzgt, const char *idname)
void UI_view2d_view_restore(const struct bContext *C)
void UI_view2d_view_ortho(const struct View2D *v2d)
void UI_view2d_view_to_region(const struct View2D *v2d, float x, float y, int *r_region_x, int *r_region_y) ATTR_NONNULL()
@ WM_GIZMOMAP_DRAWSTEP_2D
@ WM_GIZMOGROUPTYPE_TOOL_FALLBACK_KEYMAP
@ WM_GIZMOGROUPTYPE_DELAY_REFRESH_FOR_TWEAK
#define NS_EDITMODE_MESH
Definition: WM_types.h:443
#define NC_WINDOW
Definition: WM_types.h:277
#define NC_ID
Definition: WM_types.h:296
#define NC_NODE
Definition: WM_types.h:295
#define NC_GEOM
Definition: WM_types.h:294
#define ND_DRAW
Definition: WM_types.h:362
#define NC_BRUSH
Definition: WM_types.h:286
#define ND_RENDER_RESULT
Definition: WM_types.h:346
#define NC_WM
Definition: WM_types.h:276
#define ND_DATA
Definition: WM_types.h:408
#define WM_DRAG_PATH
Definition: WM_types.h:876
#define ND_GPENCIL_EDITMODE
Definition: WM_types.h:403
#define ND_RENDER_OPTIONS
Definition: WM_types.h:335
#define ND_COMPO_RESULT
Definition: WM_types.h:347
#define NC_SCREEN
Definition: WM_types.h:278
#define ND_MODE
Definition: WM_types.h:345
#define NC_SCENE
Definition: WM_types.h:279
#define ND_TOOLSETTINGS
Definition: WM_types.h:349
#define ND_MODIFIER
Definition: WM_types.h:363
#define ND_SPACE_IMAGE
Definition: WM_types.h:417
#define NA_EDITED
Definition: WM_types.h:462
#define NC_MATERIAL
Definition: WM_types.h:281
#define NC_IMAGE
Definition: WM_types.h:285
#define ND_UNDO
Definition: WM_types.h:316
#define ND_FRAME
Definition: WM_types.h:334
#define ND_SELECT
Definition: WM_types.h:407
#define NC_GPENCIL
Definition: WM_types.h:300
#define NC_TEXTURE
Definition: WM_types.h:282
#define ND_TRANSFORM
Definition: WM_types.h:357
#define ND_LAYER
Definition: WM_types.h:350
#define NC_MASK
Definition: WM_types.h:299
#define NA_RENAME
Definition: WM_types.h:466
#define NA_PAINTING
Definition: WM_types.h:469
#define NC_OBJECT
Definition: WM_types.h:280
#define ND_SHADING_LINKS
Definition: WM_types.h:379
#define NC_SPACE
Definition: WM_types.h:293
#define NA_SELECTED
Definition: WM_types.h:467
unsigned int U
Definition: btGjkEpa3.h:78
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btQuadWord.h:119
float aspy
short type
short source
float aspx
Scene scene
const Depsgraph * depsgraph
void image_buttons_register(ARegionType *art)
void draw_image_main_helpers(const bContext *C, ARegion *region)
Definition: image_draw.c:968
void draw_image_cache(const bContext *C, ARegion *region)
Definition: image_draw.c:998
void draw_image_sample_line(SpaceImage *sima)
Definition: image_draw.c:715
void IMAGE_OT_tile_add(struct wmOperatorType *ot)
Definition: image_ops.c:4017
void IMAGE_OT_tile_remove(struct wmOperatorType *ot)
Definition: image_ops.c:4078
void IMAGE_OT_view_zoom_ratio(struct wmOperatorType *ot)
Definition: image_ops.c:1127
void IMAGE_OT_curves_point_set(struct wmOperatorType *ot)
Definition: image_ops.c:3391
void IMAGE_OT_render_border(struct wmOperatorType *ot)
Definition: image_ops.c:3788
void IMAGE_OT_new(struct wmOperatorType *ot)
Definition: image_ops.c:2658
void IMAGE_OT_save_sequence(struct wmOperatorType *ot)
Definition: image_ops.c:2277
void IMAGE_OT_view_zoom_border(struct wmOperatorType *ot)
Definition: image_ops.c:1194
void IMAGE_OT_reload(struct wmOperatorType *ot)
Definition: image_ops.c:2470
void IMAGE_OT_save_all_modified(struct wmOperatorType *ot)
Definition: image_ops.c:2428
void IMAGE_OT_tile_fill(struct wmOperatorType *ot)
Definition: image_ops.c:4140
void IMAGE_OT_view_pan(struct wmOperatorType *ot)
Definition: image_ops.c:452
void IMAGE_OT_sample(struct wmOperatorType *ot)
Definition: image_ops.c:3271
void IMAGE_OT_unpack(struct wmOperatorType *ot)
Definition: image_ops.c:3174
void IMAGE_OT_save_as(struct wmOperatorType *ot)
Definition: image_ops.c:2046
void IMAGE_OT_view_selected(struct wmOperatorType *ot)
Definition: image_ops.c:969
void IMAGE_OT_view_cursor_center(struct wmOperatorType *ot)
Definition: image_ops.c:861
void IMAGE_OT_resize(struct wmOperatorType *ot)
Definition: image_ops.c:3013
void IMAGE_OT_pack(struct wmOperatorType *ot)
Definition: image_ops.c:3076
void IMAGE_OT_flip(struct wmOperatorType *ot)
Definition: image_ops.c:2802
void IMAGE_OT_remove_render_slot(struct wmOperatorType *ot)
Definition: image_ops.c:3561
void IMAGE_OT_cycle_render_slot(struct wmOperatorType *ot)
Definition: image_ops.c:3456
void IMAGE_OT_view_all(struct wmOperatorType *ot)
Definition: image_ops.c:815
void IMAGE_OT_match_movie_length(struct wmOperatorType *ot)
Definition: image_ops.c:1580
void IMAGE_OT_clear_render_slot(struct wmOperatorType *ot)
Definition: image_ops.c:3493
void IMAGE_OT_view_zoom(struct wmOperatorType *ot)
Definition: image_ops.c:697
void IMAGE_OT_sample_line(struct wmOperatorType *ot)
Definition: image_ops.c:3365
void IMAGE_OT_add_render_slot(struct wmOperatorType *ot)
Definition: image_ops.c:3526
void IMAGE_OT_open(struct wmOperatorType *ot)
Definition: image_ops.c:1505
void IMAGE_OT_clear_render_border(struct wmOperatorType *ot)
Definition: image_ops.c:3824
void IMAGE_OT_invert(struct wmOperatorType *ot)
Definition: image_ops.c:2923
void IMAGE_OT_save(struct wmOperatorType *ot)
Definition: image_ops.c:2180
void IMAGE_OT_change_frame(struct wmOperatorType *ot)
Definition: image_ops.c:3683
void IMAGE_OT_view_zoom_in(struct wmOperatorType *ot)
Definition: image_ops.c:1015
void IMAGE_OT_replace(struct wmOperatorType *ot)
Definition: image_ops.c:1659
void IMAGE_OT_view_center_cursor(struct wmOperatorType *ot)
Definition: image_ops.c:897
void IMAGE_OT_read_viewlayers(struct wmOperatorType *ot)
Definition: image_ops.c:3723
void IMAGE_OT_view_zoom_out(struct wmOperatorType *ot)
Definition: image_ops.c:1074
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
#define GS(x)
Definition: iris.c:241
void *(* MEM_dupallocN)(const void *vmemh)
Definition: mallocn.c:42
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
static void area(int d1, int d2, int e1, int e2, float weights[2])
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
Definition: rna_access.c:6550
void RNA_enum_items_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
Definition: rna_define.c:4448
const EnumPropertyItem rna_enum_space_image_mode_items[]
Definition: rna_space.c:294
static void image_buttons_region_init(wmWindowManager *wm, ARegion *region)
Definition: space_image.c:770
static int image_context(const bContext *C, const char *member, bContextDataResult *result)
Definition: space_image.c:438
static void image_header_region_listener(const wmRegionListenerParams *params)
Definition: space_image.c:956
static void IMAGE_GGT_gizmo2d(wmGizmoGroupType *gzgt)
Definition: space_image.c:462
static void image_dropboxes(void)
Definition: space_image.c:281
static void IMAGE_GGT_gizmo2d_translate(wmGizmoGroupType *gzgt)
Definition: space_image.c:476
static void IMAGE_GGT_navigate(wmGizmoGroupType *gzgt)
Definition: space_image.c:518
static void image_main_region_listener(const wmRegionListenerParams *params)
Definition: space_image.c:723
static void image_main_region_set_view2d(SpaceImage *sima, ARegion *region)
Definition: space_image.c:539
static void image_listener(const wmSpaceTypeListenerParams *params)
Definition: space_image.c:312
static void image_tools_region_draw(const bContext *C, ARegion *region)
Definition: space_image.c:895
static SpaceLink * image_create(const ScrArea *UNUSED(area), const Scene *UNUSED(scene))
Definition: space_image.c:107
static void image_operatortypes(void)
Definition: space_image.c:197
static void image_space_subtype_set(ScrArea *area, int value)
Definition: space_image.c:1023
static void image_drop_copy(wmDrag *drag, wmDropBox *drop)
Definition: space_image.c:274
static void IMAGE_GGT_gizmo2d_rotate(wmGizmoGroupType *gzgt)
Definition: space_image.c:504
static bool image_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event, const char **UNUSED(r_tooltip))
Definition: space_image.c:256
static void image_widgets(void)
Definition: space_image.c:523
static void image_tools_region_listener(const wmRegionListenerParams *params)
Definition: space_image.c:900
static void image_user_refresh_scene(const bContext *C, SpaceImage *sima)
Definition: space_image.c:88
static void image_keymap(struct wmKeyConfig *keyconf)
Definition: space_image.c:249
const char * image_context_dir[]
Definition: space_image.c:436
void ED_spacetype_image(void)
Definition: space_image.c:1047
static void image_init(struct wmWindowManager *UNUSED(wm), ScrArea *area)
Definition: space_image.c:178
static void image_tools_region_init(wmWindowManager *wm, ARegion *region)
Definition: space_image.c:884
static void image_free(SpaceLink *sl)
Definition: space_image.c:170
static int image_space_subtype_get(ScrArea *area)
Definition: space_image.c:1017
static void image_header_region_draw(const bContext *C, ARegion *region)
Definition: space_image.c:946
static void image_main_region_init(wmWindowManager *wm, ARegion *region)
Definition: space_image.c:594
static void image_refresh(const bContext *C, ScrArea *area)
Definition: space_image.c:292
static void image_buttons_region_listener(const wmRegionListenerParams *params)
Definition: space_image.c:838
static void image_buttons_region_layout(const bContext *C, ARegion *region)
Definition: space_image.c:781
static void IMAGE_GGT_gizmo2d_resize(wmGizmoGroupType *gzgt)
Definition: space_image.c:490
static void image_id_remap(ScrArea *UNUSED(area), SpaceLink *slink, ID *old_id, ID *new_id)
Definition: space_image.c:987
static SpaceLink * image_duplicate(SpaceLink *sl)
Definition: space_image.c:186
static void image_header_region_init(wmWindowManager *UNUSED(wm), ARegion *region)
Definition: space_image.c:941
static void image_scopes_tag_refresh(ScrArea *area)
Definition: space_image.c:73
static void image_main_region_draw(const bContext *C, ARegion *region)
Definition: space_image.c:625
static void image_buttons_region_draw(const bContext *C, ARegion *region)
Definition: space_image.c:807
static void image_space_subtype_item_extend(bContext *UNUSED(C), EnumPropertyItem **item, int *totitem)
Definition: space_image.c:1037
void(* draw)(const struct bContext *C, struct ARegion *region)
Definition: BKE_screen.h:169
void(* message_subscribe)(const wmRegionMessageSubscribeParams *params)
Definition: BKE_screen.h:185
int(* snap_size)(const struct ARegion *region, int size, int axis)
Definition: BKE_screen.h:181
void(* listener)(const wmRegionListenerParams *params)
Definition: BKE_screen.h:183
int keymapflag
Definition: BKE_screen.h:226
void(* layout)(const struct bContext *C, struct ARegion *region)
Definition: BKE_screen.h:179
void(* init)(struct wmWindowManager *wm, struct ARegion *region)
Definition: BKE_screen.h:165
ListBase paneltypes
Definition: BKE_screen.h:216
ListBase handlers
short alignment
short regiontype
struct wmGizmoMap * gizmo_map
struct ARegionType * type
Definition: DNA_ID.h:273
char name[66]
Definition: DNA_ID.h:283
struct Scene * scene
struct Mask * mask
struct bNodeTree * nodetree
struct ToolSettings * toolsettings
ColorManagedViewSettings view_settings
struct RenderData r
ColorManagedDisplaySettings display_settings
struct Scopes scopes
int tile_grid_shape[2]
SpaceImageOverlay overlay
MaskSpaceInfo mask_info
struct Histogram sample_line_hist
struct ImageUser iuser
struct bGPdata * gpd
struct Image * image
ListBase regionbase
struct SpaceLink *(* duplicate)(struct SpaceLink *sl)
Definition: BKE_screen.h:104
ListBase regiontypes
Definition: BKE_screen.h:130
void(* keymap)(struct wmKeyConfig *keyconf)
Definition: BKE_screen.h:109
void(* operatortypes)(void)
Definition: BKE_screen.h:107
void(* gizmos)(void)
Definition: BKE_screen.h:114
void(* free)(struct SpaceLink *sl)
Definition: BKE_screen.h:88
void(* space_subtype_item_extend)(struct bContext *C, EnumPropertyItem **item, int *totitem)
Definition: BKE_screen.h:127
struct SpaceLink *(* create)(const struct ScrArea *area, const struct Scene *scene)
Definition: BKE_screen.h:86
void(* refresh)(const struct bContext *C, struct ScrArea *area)
Definition: BKE_screen.h:101
void(* listener)(const wmSpaceTypeListenerParams *params)
Definition: BKE_screen.h:95
void(* init)(struct wmWindowManager *wm, struct ScrArea *area)
Definition: BKE_screen.h:91
int spaceid
Definition: BKE_screen.h:81
bContextDataCallback context
Definition: BKE_screen.h:117
void(* space_subtype_set)(struct ScrArea *area, int value)
Definition: BKE_screen.h:126
void(* id_remap)(struct ScrArea *area, struct SpaceLink *sl, struct ID *old_id, struct ID *new_id)
Definition: BKE_screen.h:120
char name[BKE_ST_MAXNAME]
Definition: BKE_screen.h:80
void(* dropboxes)(void)
Definition: BKE_screen.h:111
int(* space_subtype_get)(struct ScrArea *area)
Definition: BKE_screen.h:125
short scroll
float xmax
Definition: DNA_vec_types.h:85
float xmin
Definition: DNA_vec_types.h:85
float ymax
Definition: DNA_vec_types.h:86
float ymin
Definition: DNA_vec_types.h:86
int ymin
Definition: DNA_vec_types.h:80
int ymax
Definition: DNA_vec_types.h:80
int xmin
Definition: DNA_vec_types.h:79
int xmax
Definition: DNA_vec_types.h:79
char path[1024]
Definition: WM_types.h:909
int icon
Definition: WM_types.h:905
int type
Definition: WM_types.h:907
struct PointerRNA * ptr
Definition: WM_types.h:953
int x
Definition: WM_types.h:581
const char * idname
eWM_GizmoFlagGroupTypeFlag flag
struct wmGizmoMapType_Params gzmap_params
const char * name
unsigned int data
Definition: WM_types.h:260
unsigned int action
Definition: WM_types.h:260
unsigned int category
Definition: WM_types.h:260
unsigned int subtype
Definition: WM_types.h:260
void * reference
Definition: WM_types.h:262
struct wmKeyConfig * defaultconf
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
wmDropBox * WM_dropbox_add(ListBase *lb, const char *idname, bool(*poll)(bContext *, wmDrag *, const wmEvent *, const char **), void(*copy)(wmDrag *, wmDropBox *), void(*cancel)(struct Main *, wmDrag *, wmDropBox *))
Definition: wm_dragdrop.c:96
ListBase * WM_dropboxmap_find(const char *idname, int spaceid, int regionid)
Definition: wm_dragdrop.c:77
wmEventHandler_Dropbox * WM_event_add_dropbox_handler(ListBase *handlers, ListBase *dropboxes)
wmEventHandler_Keymap * WM_event_add_keymap_handler_v2d_mask(ListBase *handlers, wmKeyMap *keymap)
wmEventHandler_Keymap * WM_event_add_keymap_handler(ListBase *handlers, wmKeyMap *keymap)
wmGizmoGroupTypeRef * WM_gizmogrouptype_append_and_link(wmGizmoMapType *gzmap_type, void(*wtfunc)(struct wmGizmoGroupType *))
wmGizmoGroupType * WM_gizmogrouptype_append(void(*wtfunc)(struct wmGizmoGroupType *))
wmGizmoMapType * WM_gizmomaptype_ensure(const struct wmGizmoMapType_Params *gzmap_params)
void WM_gizmomap_tag_refresh(wmGizmoMap *gzmap)
Definition: wm_gizmo_map.c:323
void WM_gizmomap_draw(wmGizmoMap *gzmap, const bContext *C, const eWM_GizmoFlagMapDrawStep drawstep)
Definition: wm_gizmo_map.c:498
wmKeyMap * WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
Definition: wm_keymap.c:852
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))
ViewLayer * WM_window_get_active_view_layer(const wmWindow *win)
Definition: wm_window.c:2286