Blender  V3.3
space_image.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_defaults.h"
9 #include "DNA_gpencil_types.h"
10 #include "DNA_image_types.h"
11 #include "DNA_mask_types.h"
12 #include "DNA_object_types.h"
13 #include "DNA_scene_types.h"
14 
15 #include "MEM_guardedalloc.h"
16 
17 #include "BLI_blenlib.h"
18 #include "BLI_math.h"
19 #include "BLI_threads.h"
20 
21 #include "BKE_colortools.h"
22 #include "BKE_context.h"
23 #include "BKE_image.h"
24 #include "BKE_lib_id.h"
25 #include "BKE_lib_remap.h"
26 #include "BKE_screen.h"
27 
28 #include "RNA_access.h"
29 #include "RNA_define.h"
30 #include "RNA_enum_types.h"
31 
32 #include "DEG_depsgraph.h"
33 
34 #include "IMB_imbuf_types.h"
35 
36 #include "ED_image.h"
37 #include "ED_mask.h"
38 #include "ED_node.h"
39 #include "ED_render.h"
40 #include "ED_screen.h"
41 #include "ED_space_api.h"
42 #include "ED_transform.h"
43 #include "ED_util.h"
44 #include "ED_uvedit.h"
45 
46 #include "WM_api.h"
47 #include "WM_types.h"
48 
49 #include "UI_interface.h"
50 #include "UI_resources.h"
51 #include "UI_view2d.h"
52 
53 #include "DRW_engine.h"
54 
55 #include "image_intern.h"
56 
57 /**************************** common state *****************************/
58 
60 {
61  SpaceImage *sima = (SpaceImage *)area->spacedata.first;
62  ARegion *region;
63 
64  /* only while histogram is visible */
65  for (region = area->regionbase.first; region; region = region->next) {
66  if (region->regiontype == RGN_TYPE_TOOL_PROPS && region->flag & RGN_FLAG_HIDDEN) {
67  return;
68  }
69  }
70 
71  sima->scopes.ok = 0;
72 }
73 
74 static void image_user_refresh_scene(const bContext *C, SpaceImage *sima)
75 {
76  /* Update scene image user for acquiring render results. */
77  sima->iuser.scene = CTX_data_scene(C);
78 
79  if (sima->image && sima->image->type == IMA_TYPE_R_RESULT) {
80  /* While rendering, prefer scene that is being rendered. */
81  Scene *render_scene = ED_render_job_get_current_scene(C);
82  if (render_scene) {
83  sima->iuser.scene = render_scene;
84  }
85  }
86 
87  /* Auto switch image to show in UV editor when selection changes. */
89 }
90 
91 /* ******************** default callbacks for image space ***************** */
92 
94 {
95  ARegion *region;
96  SpaceImage *simage;
97 
98  simage = MEM_callocN(sizeof(SpaceImage), "initimage");
99  simage->spacetype = SPACE_IMAGE;
100  simage->zoom = 1.0f;
101  simage->lock = true;
103  simage->uv_opacity = 1.0f;
105 
106  BKE_imageuser_default(&simage->iuser);
108 
109  BKE_scopes_new(&simage->scopes);
110  simage->sample_line_hist.height = 100;
111 
112  simage->tile_grid_shape[0] = 1;
113  simage->tile_grid_shape[1] = 1;
114 
115  simage->custom_grid_subdiv = 10;
116 
118 
119  /* header */
120  region = MEM_callocN(sizeof(ARegion), "header for image");
121 
122  BLI_addtail(&simage->regionbase, region);
123  region->regiontype = RGN_TYPE_HEADER;
125 
126  /* tool header */
127  region = MEM_callocN(sizeof(ARegion), "tool header for image");
128 
129  BLI_addtail(&simage->regionbase, region);
133 
134  /* buttons/list view */
135  region = MEM_callocN(sizeof(ARegion), "buttons for image");
136 
137  BLI_addtail(&simage->regionbase, region);
138  region->regiontype = RGN_TYPE_UI;
139  region->alignment = RGN_ALIGN_RIGHT;
140  region->flag = RGN_FLAG_HIDDEN;
141 
142  /* scopes/uv sculpt/paint */
143  region = MEM_callocN(sizeof(ARegion), "buttons for image");
144 
145  BLI_addtail(&simage->regionbase, region);
146  region->regiontype = RGN_TYPE_TOOLS;
147  region->alignment = RGN_ALIGN_LEFT;
148  region->flag = RGN_FLAG_HIDDEN;
149 
150  /* main area */
151  region = MEM_callocN(sizeof(ARegion), "main area for image");
152 
153  BLI_addtail(&simage->regionbase, region);
154  region->regiontype = RGN_TYPE_WINDOW;
155 
156  return (SpaceLink *)simage;
157 }
158 
159 /* not spacelink itself */
160 static void image_free(SpaceLink *sl)
161 {
162  SpaceImage *simage = (SpaceImage *)sl;
163 
164  BKE_scopes_free(&simage->scopes);
165 }
166 
167 /* spacetype; init callback, add handlers */
168 static void image_init(struct wmWindowManager *UNUSED(wm), ScrArea *area)
169 {
170  ListBase *lb = WM_dropboxmap_find("Image", SPACE_IMAGE, 0);
171 
172  /* add drop boxes */
173  WM_event_add_dropbox_handler(&area->handlers, lb);
174 }
175 
177 {
178  SpaceImage *simagen = MEM_dupallocN(sl);
179 
180  /* clear or remove stuff from old */
181 
182  BKE_scopes_new(&simagen->scopes);
183 
184  return (SpaceLink *)simagen;
185 }
186 
187 static void image_operatortypes(void)
188 {
199 #ifdef WITH_INPUT_NDOF
200  WM_operatortype_append(IMAGE_OT_view_ndof);
201 #endif
202 
215 
219 
224 
228 
230 
234 
238 }
239 
240 static void image_keymap(struct wmKeyConfig *keyconf)
241 {
242  WM_keymap_ensure(keyconf, "Image Generic", SPACE_IMAGE, 0);
243  WM_keymap_ensure(keyconf, "Image", SPACE_IMAGE, 0);
244 }
245 
246 /* dropboxes */
247 static bool image_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
248 {
250  if (ED_region_overlap_isect_any_xy(area, event->xy)) {
251  return false;
252  }
253  if (drag->type == WM_DRAG_PATH) {
254  /* rule might not work? */
255  if (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE, ICON_FILE_BLANK)) {
256  return true;
257  }
258  }
259  return false;
260 }
261 
262 static void image_drop_copy(bContext *UNUSED(C), wmDrag *drag, wmDropBox *drop)
263 {
264  /* copy drag path to properties */
265  RNA_string_set(drop->ptr, "filepath", drag->path);
266 }
267 
268 /* area+region dropbox definition */
269 static void image_dropboxes(void)
270 {
271  ListBase *lb = WM_dropboxmap_find("Image", SPACE_IMAGE, 0);
272 
273  WM_dropbox_add(lb, "IMAGE_OT_open", image_drop_poll, image_drop_copy, NULL, NULL);
274 }
275 
280 static void image_refresh(const bContext *C, ScrArea *area)
281 {
283  SpaceImage *sima = area->spacedata.first;
284  Image *ima;
285 
286  ima = ED_space_image(sima);
287  BKE_image_user_frame_calc(ima, &sima->iuser, scene->r.cfra);
288 
289  /* Check if we have to set the image from the edit-mesh. */
290  if (ima && (ima->source == IMA_SRC_VIEWER && sima->mode == SI_MODE_MASK)) {
291  if (scene->nodetree) {
293  if (mask) {
295  }
296  }
297  }
298 }
299 
301 {
302  wmWindow *win = params->window;
303  ScrArea *area = params->area;
304  wmNotifier *wmn = params->notifier;
305  SpaceImage *sima = (SpaceImage *)area->spacedata.first;
306 
307  /* context changes */
308  switch (wmn->category) {
309  case NC_WINDOW:
310  /* notifier comes from editing color space */
313  break;
314  case NC_SCENE:
315  switch (wmn->data) {
316  case ND_FRAME:
320  break;
321  case ND_MODE:
322  ED_paint_cursor_start(&params->scene->toolsettings->imapaint.paint,
324 
325  if (wmn->subtype == NS_EDITMODE_MESH) {
327  }
329  break;
330  case ND_RENDER_RESULT:
331  case ND_RENDER_OPTIONS:
332  case ND_COMPO_RESULT:
333  if (ED_space_image_show_render(sima)) {
336  }
338  break;
339  }
340  break;
341  case NC_IMAGE:
342  if (wmn->reference == sima->image || !wmn->reference) {
343  if (wmn->action != NA_PAINTING) {
347  }
348  }
349  break;
350  case NC_SPACE:
351  if (wmn->data == ND_SPACE_IMAGE) {
354  }
355  break;
356  case NC_MASK: {
357  ViewLayer *view_layer = WM_window_get_active_view_layer(win);
358  Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer);
359  if (ED_space_image_check_show_maskedit(sima, obedit)) {
360  switch (wmn->data) {
361  case ND_SELECT:
363  break;
364  case ND_DATA:
365  case ND_DRAW:
366  /* causes node-recalc */
369  break;
370  }
371  switch (wmn->action) {
372  case NA_SELECTED:
374  break;
375  case NA_EDITED:
376  /* causes node-recalc */
379  break;
380  }
381  }
382  break;
383  }
384  case NC_GEOM: {
385  switch (wmn->data) {
386  case ND_DATA:
387  case ND_SELECT:
391  break;
392  }
393  break;
394  }
395  case NC_OBJECT: {
396  switch (wmn->data) {
397  case ND_TRANSFORM:
398  case ND_MODIFIER: {
399  ViewLayer *view_layer = WM_window_get_active_view_layer(win);
400  Object *ob = OBACT(view_layer);
401  if (ob && (ob == wmn->reference) && (ob->mode & OB_MODE_EDIT)) {
402  if (sima->lock && (sima->flag & SI_DRAWSHADOW)) {
405  }
406  }
407  break;
408  }
409  }
410 
411  break;
412  }
413  case NC_ID: {
414  if (wmn->action == NA_RENAME) {
416  }
417  break;
418  }
419  case NC_WM:
420  if (wmn->data == ND_UNDO) {
423  }
424  break;
425  }
426 }
427 
428 const char *image_context_dir[] = {"edit_image", "edit_mask", NULL};
429 
430 static int /*eContextResult*/ image_context(const bContext *C,
431  const char *member,
433 {
435 
436  if (CTX_data_dir(member)) {
438  /* TODO(sybren): return CTX_RESULT_OK; */
439  }
440  else if (CTX_data_equals(member, "edit_image")) {
442  return CTX_RESULT_OK;
443  }
444  else if (CTX_data_equals(member, "edit_mask")) {
446  if (mask) {
448  }
449  return CTX_RESULT_OK;
450  }
452 }
453 
455 {
456  gzgt->name = "UV Transform Gizmo";
457  gzgt->idname = "IMAGE_GGT_gizmo2d";
458 
461 
464 
466 }
467 
469 {
470  gzgt->name = "UV Translate Gizmo";
471  gzgt->idname = "IMAGE_GGT_gizmo2d_translate";
472 
475 
478 
480 }
481 
483 {
484  gzgt->name = "UV Transform Gizmo Resize";
485  gzgt->idname = "IMAGE_GGT_gizmo2d_resize";
486 
489 
492 
494 }
495 
497 {
498  gzgt->name = "UV Transform Gizmo Resize";
499  gzgt->idname = "IMAGE_GGT_gizmo2d_rotate";
500 
503 
506 
508 }
509 
511 {
512  VIEW2D_GGT_navigate_impl(gzgt, "IMAGE_GGT_navigate");
513 }
514 
515 static void image_widgets(void)
516 {
519 
524 
526 }
527 
528 /************************** main region ***************************/
529 
530 /* sets up the fields of the View2D from zoom and offset */
532 {
533  Image *ima = ED_space_image(sima);
534 
535  int width, height;
537 
538  float w = width;
539  float h = height;
540 
541  if (ima) {
542  h *= ima->aspy / ima->aspx;
543  }
544 
545  int winx = BLI_rcti_size_x(&region->winrct) + 1;
546  int winy = BLI_rcti_size_y(&region->winrct) + 1;
547 
548  /* For region overlap, move center so image doesn't overlap header. */
549  const rcti *visible_rect = ED_region_visible_rect(region);
550  const int visible_winy = BLI_rcti_size_y(visible_rect) + 1;
551  int visible_centerx = 0;
552  int visible_centery = visible_rect->ymin + (visible_winy - winy) / 2;
553 
554  region->v2d.tot.xmin = 0;
555  region->v2d.tot.ymin = 0;
556  region->v2d.tot.xmax = w;
557  region->v2d.tot.ymax = h;
558 
559  region->v2d.mask.xmin = region->v2d.mask.ymin = 0;
560  region->v2d.mask.xmax = winx;
561  region->v2d.mask.ymax = winy;
562 
563  /* which part of the image space do we see? */
564  float x1 = region->winrct.xmin + visible_centerx + (winx - sima->zoom * w) / 2.0f;
565  float y1 = region->winrct.ymin + visible_centery + (winy - sima->zoom * h) / 2.0f;
566 
567  x1 -= sima->zoom * sima->xof;
568  y1 -= sima->zoom * sima->yof;
569 
570  /* relative display right */
571  region->v2d.cur.xmin = ((region->winrct.xmin - (float)x1) / sima->zoom);
572  region->v2d.cur.xmax = region->v2d.cur.xmin + ((float)winx / sima->zoom);
573 
574  /* relative display left */
575  region->v2d.cur.ymin = ((region->winrct.ymin - (float)y1) / sima->zoom);
576  region->v2d.cur.ymax = region->v2d.cur.ymin + ((float)winy / sima->zoom);
577 
578  /* normalize 0.0..1.0 */
579  region->v2d.cur.xmin /= w;
580  region->v2d.cur.xmax /= w;
581  region->v2d.cur.ymin /= h;
582  region->v2d.cur.ymax /= h;
583 }
584 
585 /* add handlers, stuff you only do once or on area/region changes */
587 {
588  wmKeyMap *keymap;
589 
590  /* NOTE: don't use `UI_view2d_region_reinit(&region->v2d, ...)`
591  * since the space clip manages own v2d in #image_main_region_set_view2d */
592 
593  /* mask polls mode */
594  keymap = WM_keymap_ensure(wm->defaultconf, "Mask Editing", 0, 0);
596 
597  /* image paint polls for mode */
598  keymap = WM_keymap_ensure(wm->defaultconf, "Curve", 0, 0);
600 
601  keymap = WM_keymap_ensure(wm->defaultconf, "Paint Curve", 0, 0);
602  WM_event_add_keymap_handler(&region->handlers, keymap);
603 
604  keymap = WM_keymap_ensure(wm->defaultconf, "Image Paint", 0, 0);
606 
607  keymap = WM_keymap_ensure(wm->defaultconf, "UV Editor", 0, 0);
608  WM_event_add_keymap_handler(&region->handlers, keymap);
609 
610  /* own keymaps */
611  keymap = WM_keymap_ensure(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0);
612  WM_event_add_keymap_handler(&region->handlers, keymap);
613  keymap = WM_keymap_ensure(wm->defaultconf, "Image", SPACE_IMAGE, 0);
615 }
616 
617 static void image_main_region_draw(const bContext *C, ARegion *region)
618 {
619  /* draw entirely, view changes should be handled here */
621  Object *obedit = CTX_data_edit_object(C);
623  Mask *mask = NULL;
625  View2D *v2d = &region->v2d;
626  Image *image = ED_space_image(sima);
627  const bool show_viewer = (image && image->source == IMA_SRC_VIEWER);
628 
629  /* XXX not supported yet, disabling for now */
630  scene->r.scemode &= ~R_COMP_CROP;
631 
633 
634  /* we set view2d from own zoom and offset each time */
635  image_main_region_set_view2d(sima, region);
636 
637  /* check for mask (delay draw) */
638  if (!ED_space_image_show_uvedit(sima, obedit) && sima->mode == SI_MODE_MASK) {
640  }
641 
642  if (show_viewer) {
644  }
645  DRW_draw_view(C);
646  if (show_viewer) {
648  }
649 
650  draw_image_main_helpers(C, region);
651 
652  /* Draw Meta data of the image isn't added to the DrawManager as it is
653  * used in other areas as well. */
654  if (sima->overlay.flag & SI_OVERLAY_SHOW_OVERLAYS && sima->flag & SI_DRAW_METADATA) {
655  void *lock;
656  /* `ED_space_image_get_zoom` temporarily locks the image, so this needs to be done before
657  * the image is locked when calling `ED_space_image_acquire_buffer`. */
658  float zoomx, zoomy;
659  ED_space_image_get_zoom(sima, region, &zoomx, &zoomy);
660  ImBuf *ibuf = ED_space_image_acquire_buffer(sima, &lock, 0);
661  if (ibuf) {
662  int x, y;
663  rctf frame;
664  BLI_rctf_init(&frame, 0.0f, ibuf->x, 0.0f, ibuf->y);
665  UI_view2d_view_to_region(&region->v2d, 0.0f, 0.0f, &x, &y);
666  ED_region_image_metadata_draw(x, y, ibuf, &frame, zoomx, zoomy);
667  }
668  ED_space_image_release_buffer(sima, ibuf, lock);
669  }
670 
671  /* sample line */
675 
676  if (mask) {
677  int width, height;
678  float aspx, aspy;
679 
680  if (show_viewer) {
681  /* ED_space_image_get* will acquire image buffer which requires
682  * lock here by the same reason why lock is needed in draw_image_main
683  */
685  }
686 
688  ED_space_image_get_aspect(sima, &aspx, &aspy);
689 
690  if (show_viewer) {
692  }
693 
695  mask,
696  region,
697  /* Mask overlay is drawn by image/overlay engine. */
699  sima->mask_info.draw_type,
700  sima->mask_info.overlay_mode,
701  sima->mask_info.blend_factor,
702  width,
703  height,
704  aspx,
705  aspy,
706  true,
707  false,
708  NULL,
709  C);
710  }
711 
713  draw_image_cache(C, region);
714 }
715 
717 {
718  ScrArea *area = params->area;
719  ARegion *region = params->region;
720  wmNotifier *wmn = params->notifier;
721 
722  /* context changes */
723  switch (wmn->category) {
724  case NC_GEOM:
725  if (ELEM(wmn->data, ND_DATA, ND_SELECT)) {
727  }
728  break;
729  case NC_GPENCIL:
730  if (ELEM(wmn->action, NA_EDITED, NA_SELECTED)) {
731  ED_region_tag_redraw(region);
732  }
733  else if (wmn->data & ND_GPENCIL_EDITMODE) {
734  ED_region_tag_redraw(region);
735  }
736  break;
737  case NC_IMAGE:
738  if (wmn->action == NA_PAINTING) {
739  ED_region_tag_redraw(region);
740  }
742  break;
743  case NC_MATERIAL:
744  if (wmn->data == ND_SHADING_LINKS) {
745  SpaceImage *sima = area->spacedata.first;
746 
747  if (sima->iuser.scene && (sima->iuser.scene->toolsettings->uv_flag & UV_SHOW_SAME_IMAGE)) {
748  ED_region_tag_redraw(region);
749  }
750  }
751  break;
752  case NC_SCREEN:
753  if (ELEM(wmn->data, ND_LAYER)) {
754  ED_region_tag_redraw(region);
755  }
756  break;
757  }
758 }
759 
760 /* *********************** buttons region ************************ */
761 
762 /* add handlers, stuff you only do once or on area/region changes */
764 {
765  wmKeyMap *keymap;
766 
768  ED_region_panels_init(wm, region);
769 
770  keymap = WM_keymap_ensure(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0);
771  WM_event_add_keymap_handler(&region->handlers, keymap);
772 }
773 
774 static void image_buttons_region_layout(const bContext *C, ARegion *region)
775 {
776  const enum eContextObjectMode mode = CTX_data_mode_enum(C);
777  const char *contexts_base[3] = {NULL};
778 
779  const char **contexts = contexts_base;
780 
782  switch (sima->mode) {
783  case SI_MODE_VIEW:
784  break;
785  case SI_MODE_PAINT:
786  ARRAY_SET_ITEMS(contexts, ".paint_common_2d", ".imagepaint_2d");
787  break;
788  case SI_MODE_MASK:
789  break;
790  case SI_MODE_UV:
791  if (mode == CTX_MODE_EDIT_MESH) {
792  ARRAY_SET_ITEMS(contexts, ".uv_sculpt");
793  }
794  break;
795  }
796 
797  ED_region_panels_layout_ex(C, region, &region->type->paneltypes, contexts_base, NULL);
798 }
799 
800 static void image_buttons_region_draw(const bContext *C, ARegion *region)
801 {
804  void *lock;
805  /* TODO(lukas): Support tiles in scopes? */
806  ImBuf *ibuf = ED_space_image_acquire_buffer(sima, &lock, 0);
807  /* XXX performance regression if name of scopes category changes! */
808  PanelCategoryStack *category = UI_panel_category_active_find(region, "Scopes");
809 
810  /* only update scopes if scope category is active */
811  if (category) {
812  if (ibuf) {
813  if (!sima->scopes.ok) {
816  }
817  if (sima->image->flag & IMA_VIEW_AS_RENDER) {
818  ED_space_image_scopes_update(C, sima, ibuf, true);
819  }
820  else {
821  ED_space_image_scopes_update(C, sima, ibuf, false);
822  }
823  }
824  }
825  ED_space_image_release_buffer(sima, ibuf, lock);
826 
827  /* Layout handles details. */
828  ED_region_panels_draw(C, region);
829 }
830 
832 {
833  ARegion *region = params->region;
834  wmNotifier *wmn = params->notifier;
835 
836  /* context changes */
837  switch (wmn->category) {
838  case NC_TEXTURE:
839  case NC_MATERIAL:
840  /* sending by texture render job and needed to properly update displaying
841  * brush texture icon */
842  ED_region_tag_redraw(region);
843  break;
844  case NC_SCENE:
845  switch (wmn->data) {
846  case ND_MODE:
847  case ND_RENDER_RESULT:
848  case ND_COMPO_RESULT:
849  ED_region_tag_redraw(region);
850  break;
851  }
852  break;
853  case NC_IMAGE:
854  if (wmn->action != NA_PAINTING) {
855  ED_region_tag_redraw(region);
856  }
857  break;
858  case NC_NODE:
859  ED_region_tag_redraw(region);
860  break;
861  case NC_GPENCIL:
862  if (ELEM(wmn->action, NA_EDITED, NA_SELECTED)) {
863  ED_region_tag_redraw(region);
864  }
865  break;
866  case NC_BRUSH:
867  if (wmn->action == NA_EDITED) {
868  ED_region_tag_redraw(region);
869  }
870  break;
871  }
872 }
873 
874 /* *********************** scopes region ************************ */
875 
876 /* add handlers, stuff you only do once or on area/region changes */
878 {
879  wmKeyMap *keymap;
880 
882  ED_region_panels_init(wm, region);
883 
884  keymap = WM_keymap_ensure(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0);
885  WM_event_add_keymap_handler(&region->handlers, keymap);
886 }
887 
888 static void image_tools_region_draw(const bContext *C, ARegion *region)
889 {
890  ED_region_panels(C, region);
891 }
892 
894 {
895  ARegion *region = params->region;
896  wmNotifier *wmn = params->notifier;
897 
898  /* context changes */
899  switch (wmn->category) {
900  case NC_GPENCIL:
901  if (wmn->data == ND_DATA || ELEM(wmn->action, NA_EDITED, NA_SELECTED)) {
902  ED_region_tag_redraw(region);
903  }
904  break;
905  case NC_BRUSH:
906  /* NA_SELECTED is used on brush changes */
907  if (ELEM(wmn->action, NA_EDITED, NA_SELECTED)) {
908  ED_region_tag_redraw(region);
909  }
910  break;
911  case NC_SCENE:
912  switch (wmn->data) {
913  case ND_MODE:
914  case ND_RENDER_RESULT:
915  case ND_COMPO_RESULT:
916  ED_region_tag_redraw(region);
917  break;
918  }
919  break;
920  case NC_IMAGE:
921  if (wmn->action != NA_PAINTING) {
922  ED_region_tag_redraw(region);
923  }
924  break;
925  case NC_NODE:
926  ED_region_tag_redraw(region);
927  break;
928  }
929 }
930 
931 /************************* header region **************************/
932 
933 /* add handlers, stuff you only do once or on area/region changes */
935 {
936  ED_region_header_init(region);
937 }
938 
939 static void image_header_region_draw(const bContext *C, ARegion *region)
940 {
942  SpaceImage *sima = area->spacedata.first;
943 
945 
946  ED_region_header(C, region);
947 }
948 
950 {
951  ARegion *region = params->region;
952  wmNotifier *wmn = params->notifier;
953 
954  /* context changes */
955  switch (wmn->category) {
956  case NC_SCENE:
957  switch (wmn->data) {
958  case ND_MODE:
959  case ND_TOOLSETTINGS:
960  ED_region_tag_redraw(region);
961  break;
962  }
963  break;
964  case NC_GEOM:
965  switch (wmn->data) {
966  case ND_DATA:
967  case ND_SELECT:
968  ED_region_tag_redraw(region);
969  break;
970  }
971  break;
972  case NC_BRUSH:
973  if (wmn->action == NA_EDITED) {
974  ED_region_tag_redraw(region);
975  }
976  break;
977  }
978 }
979 
981  SpaceLink *slink,
982  const struct IDRemapper *mappings)
983 {
984  SpaceImage *simg = (SpaceImage *)slink;
985 
987  return;
988  }
989 
993 }
994 
1001 {
1002  SpaceImage *sima = area->spacedata.first;
1003  return sima->mode == SI_MODE_UV ? SI_MODE_UV : SI_MODE_VIEW;
1004 }
1005 
1006 static void image_space_subtype_set(ScrArea *area, int value)
1007 {
1008  SpaceImage *sima = area->spacedata.first;
1009  if (value == SI_MODE_UV) {
1010  if (sima->mode != SI_MODE_UV) {
1011  sima->mode_prev = sima->mode;
1012  }
1013  sima->mode = value;
1014  }
1015  else {
1016  sima->mode = sima->mode_prev;
1017  }
1018 }
1019 
1021  EnumPropertyItem **item,
1022  int *totitem)
1023 {
1025 }
1026 
1027 /**************************** spacetype *****************************/
1028 
1030 {
1031  SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype image");
1032  ARegionType *art;
1033 
1034  st->spaceid = SPACE_IMAGE;
1035  strncpy(st->name, "Image", BKE_ST_MAXNAME);
1036 
1037  st->create = image_create;
1038  st->free = image_free;
1039  st->init = image_init;
1040  st->duplicate = image_duplicate;
1041  st->operatortypes = image_operatortypes;
1042  st->keymap = image_keymap;
1043  st->dropboxes = image_dropboxes;
1044  st->refresh = image_refresh;
1045  st->listener = image_listener;
1046  st->context = image_context;
1047  st->gizmos = image_widgets;
1048  st->id_remap = image_id_remap;
1049  st->space_subtype_item_extend = image_space_subtype_item_extend;
1050  st->space_subtype_get = image_space_subtype_get;
1051  st->space_subtype_set = image_space_subtype_set;
1052 
1053  /* regions: main window */
1054  art = MEM_callocN(sizeof(ARegionType), "spacetype image region");
1055  art->regionid = RGN_TYPE_WINDOW;
1060  BLI_addhead(&st->regiontypes, art);
1061 
1062  /* regions: listview/buttons/scopes */
1063  art = MEM_callocN(sizeof(ARegionType), "spacetype image region");
1064  art->regionid = RGN_TYPE_UI;
1072  BLI_addhead(&st->regiontypes, art);
1073 
1076 
1077  /* regions: tool(bar) */
1078  art = MEM_callocN(sizeof(ARegionType), "spacetype image region");
1079  art->regionid = RGN_TYPE_TOOLS;
1080  art->prefsizex = 58; /* XXX */
1081  art->prefsizey = 50; /* XXX */
1088  BLI_addhead(&st->regiontypes, art);
1089 
1090  /* regions: tool header */
1091  art = MEM_callocN(sizeof(ARegionType), "spacetype image tool header region");
1093  art->prefsizey = HEADERY;
1099  BLI_addhead(&st->regiontypes, art);
1100 
1101  /* regions: header */
1102  art = MEM_callocN(sizeof(ARegionType), "spacetype image region");
1103  art->regionid = RGN_TYPE_HEADER;
1104  art->prefsizey = HEADERY;
1109 
1110  BLI_addhead(&st->regiontypes, art);
1111 
1112  /* regions: hud */
1113  art = ED_area_type_hud(st->spaceid);
1114  BLI_addhead(&st->regiontypes, art);
1115 
1117 }
typedef float(TangentPoint)[2]
void BKE_scopes_new(struct Scopes *scopes)
Definition: colortools.c:1773
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:1765
struct ScrArea * CTX_wm_area(const bContext *C)
Definition: context.c:738
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1090
void CTX_data_dir_set(bContextDataResult *result, const char **dir)
Definition: context.c:696
struct Object * CTX_data_edit_object(const bContext *C)
Definition: context.c:1370
bool CTX_data_equals(const char *member, const char *str)
Definition: context.c:634
void CTX_data_id_pointer_set(bContextDataResult *result, struct ID *id)
Definition: context.c:644
bool CTX_data_dir(const char *member)
Definition: context.c:639
eContextObjectMode
Definition: BKE_context.h:103
@ CTX_MODE_EDIT_MESH
Definition: BKE_context.h:104
struct Depsgraph * CTX_data_expect_evaluated_depsgraph(const bContext *C)
Definition: context.c:1519
@ CTX_RESULT_MEMBER_NOT_FOUND
Definition: BKE_context.h:75
@ CTX_RESULT_OK
Definition: BKE_context.h:72
struct SpaceImage * CTX_wm_space_image(const bContext *C)
Definition: context.c:824
enum eContextObjectMode CTX_data_mode_enum(const bContext *C)
Definition: context.c:1228
void BKE_image_partial_update_mark_full_update(struct Image *image)
Mark the whole image to be updated.
void BKE_image_user_frame_calc(struct Image *ima, struct ImageUser *iuser, int cfra)
void BKE_imageuser_default(struct ImageUser *iuser)
bool BKE_id_remapper_has_mapping_for(const struct IDRemapper *id_remapper, uint64_t type_filter)
@ ID_REMAP_APPLY_UPDATE_REFCOUNT
@ ID_REMAP_APPLY_ENSURE_REAL
IDRemapperApplyResult BKE_id_remapper_apply(const struct IDRemapper *id_remapper, struct ID **r_id_ptr, IDRemapperApplyOptions options)
#define BKE_ST_MAXNAME
Definition: BKE_screen.h:53
void BKE_spacetype_register(struct SpaceType *st)
Definition: screen.c:391
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:60
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:80
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
Definition: BLI_rect.h:190
void BLI_rctf_init(struct rctf *rect, float xmin, float xmax, float ymin, float ymax)
Definition: rct.c:407
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition: BLI_rect.h:186
void BLI_thread_unlock(int type)
Definition: threads.cc:361
@ LOCK_DRAW_IMAGE
Definition: BLI_threads.h:67
void BLI_thread_lock(int type)
Definition: threads.cc:356
#define ARRAY_SET_ITEMS(...)
#define UNUSED(x)
#define ELEM(...)
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
#define FILTER_ID_MSK
Definition: DNA_ID.h:914
#define FILTER_ID_GD
Definition: DNA_ID.h:904
#define FILTER_ID_IM
Definition: DNA_ID.h:906
#define DNA_struct_default_get(struct_name)
Definition: DNA_defaults.h:29
@ IMA_VIEW_AS_RENDER
#define IMA_ANIM_ALWAYS
@ IMA_SRC_VIEWER
@ IMA_TYPE_R_RESULT
#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_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
@ RGN_ALIGN_BOTTOM
@ RGN_ALIGN_LEFT
@ RGN_ALIGN_TOP
@ RGN_ALIGN_RIGHT
@ SI_SHOW_GPENCIL
@ SI_DRAW_METADATA
@ SI_USE_ALPHA
@ SI_COORDFLOATS
@ SI_DRAWSHADOW
@ SI_OVERLAY_SHOW_OVERLAYS
@ SI_OVERLAY_SHOW_GRID_BACKGROUND
@ 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)
struct Mask * ED_space_image_get_mask(const struct SpaceImage *sima)
void ED_space_image_release_buffer(struct SpaceImage *sima, struct ImBuf *ibuf, void *lock)
Definition: image_edit.c:158
bool ED_space_image_check_show_maskedit(struct SpaceImage *sima, struct Object *obedit)
Definition: image_edit.c:458
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:391
bool ED_space_image_show_uvedit(const struct SpaceImage *sima, struct Object *obedit)
struct Image * ED_space_image(const struct SpaceImage *sima)
void ED_space_image_get_zoom(struct SpaceImage *sima, const struct ARegion *region, float *r_zoomx, float *r_zoomy)
void ED_paint_cursor_start(struct Paint *p, bool(*poll)(struct bContext *C))
void ED_space_image_get_size(struct SpaceImage *sima, int *r_width, int *r_height)
Definition: image_edit.c:201
bool ED_image_tools_paint_poll(struct bContext *C)
Definition: paint_image.cc:291
void ED_space_image_get_aspect(struct SpaceImage *sima, float *r_aspx, float *r_aspy)
Definition: image_edit.c:236
struct ImBuf * ED_space_image_acquire_buffer(struct SpaceImage *sima, void **r_lock, int tile)
Definition: image_edit.c:118
bool ED_space_image_show_render(const struct SpaceImage *sima)
void ED_mask_draw_region(struct Depsgraph *depsgraph, struct Mask *mask, struct ARegion *region, char draw_flag, char draw_type, eMaskOverlayMode overlay_mode, float blend_factor, int width_i, int height_i, float aspx, float aspy, bool do_scale_applied, 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:729
@ ED_KEYMAP_UI
Definition: ED_screen.h:691
@ ED_KEYMAP_HEADER
Definition: ED_screen.h:697
@ ED_KEYMAP_TOOL
Definition: ED_screen.h:693
@ ED_KEYMAP_GPENCIL
Definition: ED_screen.h:699
@ ED_KEYMAP_GIZMO
Definition: ED_screen.h:692
@ ED_KEYMAP_VIEW2D
Definition: ED_screen.h:694
@ ED_KEYMAP_FRAMES
Definition: ED_screen.h:696
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:50
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:3153
void ED_region_tag_redraw(struct ARegion *region)
Definition: area.c:655
void ED_region_header_init(struct ARegion *region)
Definition: area.c:3417
void ED_area_tag_refresh(ScrArea *area)
Definition: area.c:758
void ED_region_panels_layout_ex(const struct bContext *C, struct ARegion *region, struct ListBase *paneltypes, const char *contexts[], const char *category_override)
const rcti * ED_region_visible_rect(ARegion *region)
Definition: area.c:3763
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:755
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 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.
Read Guarded memory(de)allocation.
#define C
Definition: RandGen.cpp:25
#define UI_SIDEBAR_PANEL_WIDTH
Definition: UI_interface.h:242
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_DRAW_MODAL_EXCLUDE
@ WM_GIZMOGROUPTYPE_TOOL_FALLBACK_KEYMAP
@ WM_GIZMOGROUPTYPE_DELAY_REFRESH_FOR_TWEAK
#define NS_EDITMODE_MESH
Definition: WM_types.h:503
#define NC_WINDOW
Definition: WM_types.h:325
#define NC_ID
Definition: WM_types.h:345
#define NC_NODE
Definition: WM_types.h:344
#define NC_GEOM
Definition: WM_types.h:343
#define ND_DRAW
Definition: WM_types.h:410
#define NC_BRUSH
Definition: WM_types.h:335
#define ND_RENDER_RESULT
Definition: WM_types.h:394
#define NC_WM
Definition: WM_types.h:324
#define ND_DATA
Definition: WM_types.h:456
#define WM_DRAG_PATH
Definition: WM_types.h:1050
#define ND_GPENCIL_EDITMODE
Definition: WM_types.h:451
#define ND_RENDER_OPTIONS
Definition: WM_types.h:383
#define ND_COMPO_RESULT
Definition: WM_types.h:395
#define NC_SCREEN
Definition: WM_types.h:327
#define ND_MODE
Definition: WM_types.h:393
#define NC_SCENE
Definition: WM_types.h:328
#define ND_TOOLSETTINGS
Definition: WM_types.h:397
#define ND_MODIFIER
Definition: WM_types.h:411
#define ND_SPACE_IMAGE
Definition: WM_types.h:465
#define NA_EDITED
Definition: WM_types.h:523
#define NC_MATERIAL
Definition: WM_types.h:330
#define NC_IMAGE
Definition: WM_types.h:334
#define ND_UNDO
Definition: WM_types.h:365
#define ND_FRAME
Definition: WM_types.h:382
#define ND_SELECT
Definition: WM_types.h:455
#define NC_GPENCIL
Definition: WM_types.h:349
#define NC_TEXTURE
Definition: WM_types.h:331
#define ND_TRANSFORM
Definition: WM_types.h:405
#define ND_LAYER
Definition: WM_types.h:398
#define NC_MASK
Definition: WM_types.h:348
#define NA_RENAME
Definition: WM_types.h:527
#define NA_PAINTING
Definition: WM_types.h:530
#define NC_OBJECT
Definition: WM_types.h:329
#define ND_SHADING_LINKS
Definition: WM_types.h:427
#define NC_SPACE
Definition: WM_types.h:342
#define NA_SELECTED
Definition: WM_types.h:528
volatile int lock
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
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 image_buttons_register(ARegionType *art)
void draw_image_main_helpers(const bContext *C, ARegion *region)
Definition: image_draw.c:472
void draw_image_cache(const bContext *C, ARegion *region)
Definition: image_draw.c:513
void draw_image_sample_line(SpaceImage *sima)
Definition: image_draw.c:442
void IMAGE_OT_tile_add(struct wmOperatorType *ot)
Definition: image_ops.c:4021
void IMAGE_OT_tile_remove(struct wmOperatorType *ot)
Definition: image_ops.c:4082
void IMAGE_OT_view_zoom_ratio(struct wmOperatorType *ot)
Definition: image_ops.c:1136
void IMAGE_OT_curves_point_set(struct wmOperatorType *ot)
Definition: image_ops.c:3386
void IMAGE_OT_render_border(struct wmOperatorType *ot)
Definition: image_ops.c:3792
void IMAGE_OT_new(struct wmOperatorType *ot)
Definition: image_ops.c:2652
void IMAGE_OT_save_sequence(struct wmOperatorType *ot)
Definition: image_ops.c:2267
void IMAGE_OT_view_zoom_border(struct wmOperatorType *ot)
Definition: image_ops.c:1203
void IMAGE_OT_reload(struct wmOperatorType *ot)
Definition: image_ops.c:2468
void IMAGE_OT_file_browse(struct wmOperatorType *ot)
Definition: image_ops.c:1640
void IMAGE_OT_save_all_modified(struct wmOperatorType *ot)
Definition: image_ops.c:2426
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:461
void IMAGE_OT_sample(struct wmOperatorType *ot)
Definition: image_ops.c:3266
void IMAGE_OT_unpack(struct wmOperatorType *ot)
Definition: image_ops.c:3168
void IMAGE_OT_save_as(struct wmOperatorType *ot)
Definition: image_ops.c:2032
void IMAGE_OT_view_selected(struct wmOperatorType *ot)
Definition: image_ops.c:978
void IMAGE_OT_view_cursor_center(struct wmOperatorType *ot)
Definition: image_ops.c:870
void IMAGE_OT_resize(struct wmOperatorType *ot)
Definition: image_ops.c:3010
void IMAGE_OT_pack(struct wmOperatorType *ot)
Definition: image_ops.c:3072
void IMAGE_OT_flip(struct wmOperatorType *ot)
Definition: image_ops.c:2798
void IMAGE_OT_remove_render_slot(struct wmOperatorType *ot)
Definition: image_ops.c:3556
void IMAGE_OT_cycle_render_slot(struct wmOperatorType *ot)
Definition: image_ops.c:3451
void IMAGE_OT_view_all(struct wmOperatorType *ot)
Definition: image_ops.c:824
void IMAGE_OT_match_movie_length(struct wmOperatorType *ot)
Definition: image_ops.c:1702
void IMAGE_OT_clear_render_slot(struct wmOperatorType *ot)
Definition: image_ops.c:3488
void IMAGE_OT_view_zoom(struct wmOperatorType *ot)
Definition: image_ops.c:706
void IMAGE_OT_sample_line(struct wmOperatorType *ot)
Definition: image_ops.c:3360
void IMAGE_OT_add_render_slot(struct wmOperatorType *ot)
Definition: image_ops.c:3521
void IMAGE_OT_open(struct wmOperatorType *ot)
Definition: image_ops.c:1518
void IMAGE_OT_clear_render_border(struct wmOperatorType *ot)
Definition: image_ops.c:3828
void IMAGE_OT_invert(struct wmOperatorType *ot)
Definition: image_ops.c:2918
void IMAGE_OT_save(struct wmOperatorType *ot)
Definition: image_ops.c:2170
void IMAGE_OT_change_frame(struct wmOperatorType *ot)
Definition: image_ops.c:3673
void IMAGE_OT_view_zoom_in(struct wmOperatorType *ot)
Definition: image_ops.c:1024
void IMAGE_OT_replace(struct wmOperatorType *ot)
Definition: image_ops.c:1781
void IMAGE_OT_view_center_cursor(struct wmOperatorType *ot)
Definition: image_ops.c:906
void IMAGE_OT_read_viewlayers(struct wmOperatorType *ot)
Definition: image_ops.c:3713
void IMAGE_OT_view_zoom_out(struct wmOperatorType *ot)
Definition: image_ops.c:1083
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void *(* MEM_dupallocN)(const void *vmemh)
Definition: mallocn.c:28
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
Definition: math_float4.h:513
static void area(int d1, int d2, int e1, int e2, float weights[2])
static const pxr::TfToken st("st", pxr::TfToken::Immortal)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
Definition: rna_access.c:5155
void RNA_enum_items_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
Definition: rna_define.c:4465
const EnumPropertyItem rna_enum_space_image_mode_items[]
Definition: rna_space.c:312
static void image_buttons_region_init(wmWindowManager *wm, ARegion *region)
Definition: space_image.c:763
static int image_context(const bContext *C, const char *member, bContextDataResult *result)
Definition: space_image.c:430
static void image_header_region_listener(const wmRegionListenerParams *params)
Definition: space_image.c:949
static void IMAGE_GGT_gizmo2d(wmGizmoGroupType *gzgt)
Definition: space_image.c:454
static void image_dropboxes(void)
Definition: space_image.c:269
static void IMAGE_GGT_gizmo2d_translate(wmGizmoGroupType *gzgt)
Definition: space_image.c:468
static void IMAGE_GGT_navigate(wmGizmoGroupType *gzgt)
Definition: space_image.c:510
static void image_main_region_listener(const wmRegionListenerParams *params)
Definition: space_image.c:716
static void image_main_region_set_view2d(SpaceImage *sima, ARegion *region)
Definition: space_image.c:531
static void image_listener(const wmSpaceTypeListenerParams *params)
Definition: space_image.c:300
static void image_tools_region_draw(const bContext *C, ARegion *region)
Definition: space_image.c:888
static void image_drop_copy(bContext *UNUSED(C), wmDrag *drag, wmDropBox *drop)
Definition: space_image.c:262
static SpaceLink * image_create(const ScrArea *UNUSED(area), const Scene *UNUSED(scene))
Definition: space_image.c:93
static void image_operatortypes(void)
Definition: space_image.c:187
static void image_space_subtype_set(ScrArea *area, int value)
Definition: space_image.c:1006
static void IMAGE_GGT_gizmo2d_rotate(wmGizmoGroupType *gzgt)
Definition: space_image.c:496
static void image_widgets(void)
Definition: space_image.c:515
static void image_tools_region_listener(const wmRegionListenerParams *params)
Definition: space_image.c:893
static void image_user_refresh_scene(const bContext *C, SpaceImage *sima)
Definition: space_image.c:74
static void image_keymap(struct wmKeyConfig *keyconf)
Definition: space_image.c:240
static void image_id_remap(ScrArea *UNUSED(area), SpaceLink *slink, const struct IDRemapper *mappings)
Definition: space_image.c:980
const char * image_context_dir[]
Definition: space_image.c:428
void ED_spacetype_image(void)
Definition: space_image.c:1029
static void image_init(struct wmWindowManager *UNUSED(wm), ScrArea *area)
Definition: space_image.c:168
static void image_tools_region_init(wmWindowManager *wm, ARegion *region)
Definition: space_image.c:877
static void image_free(SpaceLink *sl)
Definition: space_image.c:160
static int image_space_subtype_get(ScrArea *area)
Definition: space_image.c:1000
static void image_header_region_draw(const bContext *C, ARegion *region)
Definition: space_image.c:939
static void image_main_region_init(wmWindowManager *wm, ARegion *region)
Definition: space_image.c:586
static void image_refresh(const bContext *C, ScrArea *area)
Definition: space_image.c:280
static void image_buttons_region_listener(const wmRegionListenerParams *params)
Definition: space_image.c:831
static void image_buttons_region_layout(const bContext *C, ARegion *region)
Definition: space_image.c:774
static void IMAGE_GGT_gizmo2d_resize(wmGizmoGroupType *gzgt)
Definition: space_image.c:482
static SpaceLink * image_duplicate(SpaceLink *sl)
Definition: space_image.c:176
static void image_header_region_init(wmWindowManager *UNUSED(wm), ARegion *region)
Definition: space_image.c:934
static bool image_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
Definition: space_image.c:247
static void image_scopes_tag_refresh(ScrArea *area)
Definition: space_image.c:59
static void image_main_region_draw(const bContext *C, ARegion *region)
Definition: space_image.c:617
static void image_buttons_region_draw(const bContext *C, ARegion *region)
Definition: space_image.c:800
static void image_space_subtype_item_extend(bContext *UNUSED(C), EnumPropertyItem **item, int *totitem)
Definition: space_image.c:1020
void(* draw)(const struct bContext *C, struct ARegion *region)
Definition: BKE_screen.h:151
void(* message_subscribe)(const wmRegionMessageSubscribeParams *params)
Definition: BKE_screen.h:167
int(* snap_size)(const struct ARegion *region, int size, int axis)
Definition: BKE_screen.h:163
void(* listener)(const wmRegionListenerParams *params)
Definition: BKE_screen.h:165
int keymapflag
Definition: BKE_screen.h:208
void(* layout)(const struct bContext *C, struct ARegion *region)
Definition: BKE_screen.h:161
void(* init)(struct wmWindowManager *wm, struct ARegion *region)
Definition: BKE_screen.h:147
ListBase paneltypes
Definition: BKE_screen.h:198
ListBase handlers
short alignment
short regiontype
struct wmGizmoMap * gizmo_map
struct ARegionType * type
Definition: DNA_ID.h:368
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
short scroll
float xmax
Definition: DNA_vec_types.h:69
float xmin
Definition: DNA_vec_types.h:69
float ymax
Definition: DNA_vec_types.h:70
float ymin
Definition: DNA_vec_types.h:70
int ymin
Definition: DNA_vec_types.h:64
int ymax
Definition: DNA_vec_types.h:64
int xmin
Definition: DNA_vec_types.h:63
int xmax
Definition: DNA_vec_types.h:63
char path[1024]
Definition: WM_types.h:1150
int icon
Definition: WM_types.h:1146
int type
Definition: WM_types.h:1148
struct PointerRNA * ptr
Definition: WM_types.h:1237
int xy[2]
Definition: WM_types.h:682
const char * idname
eWM_GizmoFlagGroupTypeFlag flag
struct wmGizmoMapType_Params gzmap_params
const char * name
unsigned int data
Definition: WM_types.h:308
unsigned int action
Definition: WM_types.h:308
unsigned int category
Definition: WM_types.h:308
unsigned int subtype
Definition: WM_types.h:308
void * reference
Definition: WM_types.h:310
struct wmKeyConfig * defaultconf
ListBase * WM_dropboxmap_find(const char *idname, int spaceid, int regionid)
Definition: wm_dragdrop.cc:76
wmDropBox * WM_dropbox_add(ListBase *lb, const char *idname, bool(*poll)(bContext *, wmDrag *, const wmEvent *), void(*copy)(bContext *, wmDrag *, wmDropBox *), void(*cancel)(Main *, wmDrag *, wmDropBox *), WMDropboxTooltipFunc tooltip)
Definition: wm_dragdrop.cc:95
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:308
void WM_gizmomap_draw(wmGizmoMap *gzmap, const bContext *C, const eWM_GizmoFlagMapDrawStep drawstep)
Definition: wm_gizmo_map.c:483
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:2217