Blender  V3.3
node_view.cc
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_node_types.h"
9 
10 #include "BLI_listbase.h"
11 #include "BLI_rect.h"
12 #include "BLI_string_ref.hh"
13 #include "BLI_utildefines.h"
14 
15 #include "BKE_context.h"
16 #include "BKE_image.h"
17 #include "BKE_main.h"
18 #include "BKE_node.h"
19 #include "BKE_screen.h"
20 
21 #include "ED_image.h"
22 #include "ED_node.h" /* own include */
23 #include "ED_screen.h"
24 #include "ED_space_api.h"
25 
26 #include "RNA_access.h"
27 #include "RNA_define.h"
28 
29 #include "WM_api.h"
30 #include "WM_types.h"
31 
32 #include "UI_view2d.h"
33 
34 #include "MEM_guardedalloc.h"
35 
36 #include "IMB_colormanagement.h"
37 #include "IMB_imbuf.h"
38 #include "IMB_imbuf_types.h"
39 
40 #include "node_intern.hh" /* own include */
41 
42 namespace blender::ed::space_node {
43 
44 /* -------------------------------------------------------------------- */
49  bContext &C, SpaceNode &snode, ARegion &region, const int node_flag, const int smooth_viewtx)
50 {
51  const float oldwidth = BLI_rctf_size_x(&region.v2d.cur);
52  const float oldheight = BLI_rctf_size_y(&region.v2d.cur);
53 
54  const float old_aspect = oldwidth / oldheight;
55 
56  rctf cur_new;
57  BLI_rctf_init_minmax(&cur_new);
58 
59  int tot = 0;
60  bool has_frame = false;
61  if (snode.edittree) {
62  LISTBASE_FOREACH (const bNode *, node, &snode.edittree->nodes) {
63  if ((node->flag & node_flag) == node_flag) {
64  BLI_rctf_union(&cur_new, &node->totr);
65  tot++;
66 
67  if (node->type == NODE_FRAME) {
68  has_frame = true;
69  }
70  }
71  }
72  }
73 
74  if (tot == 0) {
75  return false;
76  }
77 
78  const float width = BLI_rctf_size_x(&cur_new);
79  const float height = BLI_rctf_size_y(&cur_new);
80  const float new_aspect = width / height;
81 
82  /* for single non-frame nodes, don't zoom in, just pan view,
83  * but do allow zooming out, this allows for big nodes to be zoomed out */
84  if ((tot == 1) && (has_frame == false) && ((oldwidth * oldheight) > (width * height))) {
85  /* center, don't zoom */
86  BLI_rctf_resize(&cur_new, oldwidth, oldheight);
87  }
88  else {
89  if (old_aspect < new_aspect) {
90  const float height_new = width / old_aspect;
91  cur_new.ymin = cur_new.ymin - height_new / 2.0f;
92  cur_new.ymax = cur_new.ymax + height_new / 2.0f;
93  }
94  else {
95  const float width_new = height * old_aspect;
96  cur_new.xmin = cur_new.xmin - width_new / 2.0f;
97  cur_new.xmax = cur_new.xmax + width_new / 2.0f;
98  }
99 
100  /* add some padding */
101  BLI_rctf_scale(&cur_new, 1.1f);
102  }
103 
104  UI_view2d_smooth_view(&C, &region, &cur_new, smooth_viewtx);
105 
106  return true;
107 }
108 
110 {
111  ARegion *region = CTX_wm_region(C);
112  SpaceNode *snode = CTX_wm_space_node(C);
113  const int smooth_viewtx = WM_operator_smooth_viewtx_get(op);
114 
115  /* is this really needed? */
116  snode->xof = 0;
117  snode->yof = 0;
118 
119  if (space_node_view_flag(*C, *snode, *region, 0, smooth_viewtx)) {
120  return OPERATOR_FINISHED;
121  }
122  return OPERATOR_CANCELLED;
123 }
124 
126 {
127  /* identifiers */
128  ot->name = "Frame All";
129  ot->idname = "NODE_OT_view_all";
130  ot->description = "Resize view so you can see all nodes";
131 
132  /* api callbacks */
135 
136  /* flags */
137  ot->flag = 0;
138 }
139 
142 /* -------------------------------------------------------------------- */
147 {
148  ARegion *region = CTX_wm_region(C);
149  SpaceNode *snode = CTX_wm_space_node(C);
150  const int smooth_viewtx = WM_operator_smooth_viewtx_get(op);
151 
152  if (space_node_view_flag(*C, *snode, *region, NODE_SELECT, smooth_viewtx)) {
153  return OPERATOR_FINISHED;
154  }
155  return OPERATOR_CANCELLED;
156 }
157 
159 {
160  /* identifiers */
161  ot->name = "Frame Selected";
162  ot->idname = "NODE_OT_view_selected";
163  ot->description = "Resize view so you can see selected nodes";
164 
165  /* api callbacks */
168 
169  /* flags */
170  ot->flag = 0;
171 }
172 
175 /* -------------------------------------------------------------------- */
179 struct NodeViewMove {
180  int mvalo[2];
181  int xmin, ymin, xmax, ymax;
184 };
185 
186 static int snode_bg_viewmove_modal(bContext *C, wmOperator *op, const wmEvent *event)
187 {
188  SpaceNode *snode = CTX_wm_space_node(C);
189  ARegion *region = CTX_wm_region(C);
190  NodeViewMove *nvm = (NodeViewMove *)op->customdata;
191 
192  switch (event->type) {
193  case MOUSEMOVE:
194 
195  snode->xof -= (nvm->mvalo[0] - event->mval[0]);
196  snode->yof -= (nvm->mvalo[1] - event->mval[1]);
197  nvm->mvalo[0] = event->mval[0];
198  nvm->mvalo[1] = event->mval[1];
199 
200  /* prevent dragging image outside of the window and losing it! */
201  CLAMP(snode->xof, nvm->xmin, nvm->xmax);
202  CLAMP(snode->yof, nvm->ymin, nvm->ymax);
203 
204  ED_region_tag_redraw(region);
207 
208  break;
209 
210  case LEFTMOUSE:
211  case MIDDLEMOUSE:
212  if (event->val == KM_RELEASE) {
213  MEM_freeN(nvm);
214  op->customdata = nullptr;
215  return OPERATOR_FINISHED;
216  }
217  break;
218  case EVT_ESCKEY:
219  case RIGHTMOUSE:
220  snode->xof = nvm->xof_orig;
221  snode->yof = nvm->yof_orig;
222  ED_region_tag_redraw(region);
225 
226  MEM_freeN(nvm);
227  op->customdata = nullptr;
228 
229  return OPERATOR_CANCELLED;
230  }
231 
232  return OPERATOR_RUNNING_MODAL;
233 }
234 
235 static int snode_bg_viewmove_invoke(bContext *C, wmOperator *op, const wmEvent *event)
236 {
237  Main *bmain = CTX_data_main(C);
238  SpaceNode *snode = CTX_wm_space_node(C);
239  ARegion *region = CTX_wm_region(C);
240  NodeViewMove *nvm;
241  Image *ima;
242  ImBuf *ibuf;
243  const float pad = 32.0f; /* better be bigger than scrollbars */
244 
245  void *lock;
246 
247  ima = BKE_image_ensure_viewer(bmain, IMA_TYPE_COMPOSITE, "Viewer Node");
248  ibuf = BKE_image_acquire_ibuf(ima, nullptr, &lock);
249 
250  if (ibuf == nullptr) {
251  BKE_image_release_ibuf(ima, ibuf, lock);
252  return OPERATOR_CANCELLED;
253  }
254 
255  nvm = MEM_cnew<NodeViewMove>("NodeViewMove struct");
256  op->customdata = nvm;
257  nvm->mvalo[0] = event->mval[0];
258  nvm->mvalo[1] = event->mval[1];
259 
260  nvm->xmin = -(region->winx / 2) - (ibuf->x * (0.5f * snode->zoom)) + pad;
261  nvm->xmax = (region->winx / 2) + (ibuf->x * (0.5f * snode->zoom)) - pad;
262  nvm->ymin = -(region->winy / 2) - (ibuf->y * (0.5f * snode->zoom)) + pad;
263  nvm->ymax = (region->winy / 2) + (ibuf->y * (0.5f * snode->zoom)) - pad;
264 
265  nvm->xof_orig = snode->xof;
266  nvm->yof_orig = snode->yof;
267 
268  BKE_image_release_ibuf(ima, ibuf, lock);
269 
270  /* add modal handler */
272 
273  return OPERATOR_RUNNING_MODAL;
274 }
275 
277 {
278  MEM_freeN(op->customdata);
279  op->customdata = nullptr;
280 }
281 
283 {
284  /* identifiers */
285  ot->name = "Background Image Move";
286  ot->description = "Move node backdrop";
287  ot->idname = "NODE_OT_backimage_move";
288 
289  /* api callbacks */
294 
295  /* flags */
297 }
298 
301 /* -------------------------------------------------------------------- */
306 {
307  SpaceNode *snode = CTX_wm_space_node(C);
308  ARegion *region = CTX_wm_region(C);
309  float fac = RNA_float_get(op->ptr, "factor");
310 
311  snode->zoom *= fac;
312  ED_region_tag_redraw(region);
315 
316  return OPERATOR_FINISHED;
317 }
318 
320 {
321 
322  /* identifiers */
323  ot->name = "Background Image Zoom";
324  ot->idname = "NODE_OT_backimage_zoom";
325  ot->description = "Zoom in/out the background image";
326 
327  /* api callbacks */
330 
331  /* flags */
333 
334  /* internal */
335  RNA_def_float(ot->srna, "factor", 1.2f, 0.0f, 10.0f, "Factor", "", 0.0f, 10.0f);
336 }
337 
340 /* -------------------------------------------------------------------- */
345 {
346  Main *bmain = CTX_data_main(C);
347  SpaceNode *snode = CTX_wm_space_node(C);
348  ARegion *region = CTX_wm_region(C);
349 
350  Image *ima;
351  ImBuf *ibuf;
352 
353  const float pad = 32.0f;
354 
355  void *lock;
356 
357  float facx, facy;
358 
359  ima = BKE_image_ensure_viewer(bmain, IMA_TYPE_COMPOSITE, "Viewer Node");
360  ibuf = BKE_image_acquire_ibuf(ima, nullptr, &lock);
361 
362  if ((ibuf == nullptr) || (ibuf->x == 0) || (ibuf->y == 0)) {
363  BKE_image_release_ibuf(ima, ibuf, lock);
364  return OPERATOR_CANCELLED;
365  }
366 
367  facx = 1.0f * (region->sizex - pad) / (ibuf->x * snode->zoom);
368  facy = 1.0f * (region->sizey - pad) / (ibuf->y * snode->zoom);
369 
370  BKE_image_release_ibuf(ima, ibuf, lock);
371 
372  snode->zoom *= min_ff(facx, facy) * U.dpi_fac;
373 
374  snode->xof = 0;
375  snode->yof = 0;
376 
377  ED_region_tag_redraw(region);
380 
381  return OPERATOR_FINISHED;
382 }
383 
385 {
386 
387  /* identifiers */
388  ot->name = "Background Image Fit";
389  ot->idname = "NODE_OT_backimage_fit";
390  ot->description = "Fit the background image to the view";
391 
392  /* api callbacks */
395 
396  /* flags */
398 }
399 
402 /* -------------------------------------------------------------------- */
408  void *draw_handle;
409  int x, y;
410  int channels;
411 
412  uchar col[4];
413  float colf[4];
414  float linearcol[4];
415 
416  int z;
417  float zf;
418 
419  int *zp;
420  float *zfp;
421 
422  int draw;
424 };
425 
426 static void sample_draw(const bContext *C, ARegion *region, void *arg_info)
427 {
429  ImageSampleInfo *info = (ImageSampleInfo *)arg_info;
430 
431  if (info->draw) {
433  region,
434  info->color_manage,
435  false,
436  info->channels,
437  info->x,
438  info->y,
439  info->col,
440  info->colf,
441  info->linearcol,
442  info->zp,
443  info->zfp);
444  }
445 }
446 
447 } // namespace blender::ed::space_node
448 
450  Main *bmain, SpaceNode *snode, struct ARegion *region, const int mval[2], float fpos[2])
451 {
452  if (!ED_node_is_compositor(snode) || (snode->flag & SNODE_BACKDRAW) == 0) {
453  return false;
454  }
455 
456  void *lock;
457  Image *ima = BKE_image_ensure_viewer(bmain, IMA_TYPE_COMPOSITE, "Viewer Node");
458  ImBuf *ibuf = BKE_image_acquire_ibuf(ima, nullptr, &lock);
459  if (!ibuf) {
460  BKE_image_release_ibuf(ima, ibuf, lock);
461  return false;
462  }
463 
464  /* map the mouse coords to the backdrop image space */
465  float bufx = ibuf->x * snode->zoom;
466  float bufy = ibuf->y * snode->zoom;
467  fpos[0] = (bufx > 0.0f ? ((float)mval[0] - 0.5f * region->winx - snode->xof) / bufx + 0.5f :
468  0.0f);
469  fpos[1] = (bufy > 0.0f ? ((float)mval[1] - 0.5f * region->winy - snode->yof) / bufy + 0.5f :
470  0.0f);
471 
472  BKE_image_release_ibuf(ima, ibuf, lock);
473  return true;
474 }
475 
477  Main *bmain, SpaceNode *snode, ARegion *region, const int mval[2], float r_col[3])
478 {
479  void *lock;
480  Image *ima;
481  ImBuf *ibuf;
482  float fx, fy, bufx, bufy;
483  bool ret = false;
484 
485  if (!ED_node_is_compositor(snode) || (snode->flag & SNODE_BACKDRAW) == 0) {
486  /* use viewer image for color sampling only if we're in compositor tree
487  * with backdrop enabled
488  */
489  return false;
490  }
491 
492  ima = BKE_image_ensure_viewer(bmain, IMA_TYPE_COMPOSITE, "Viewer Node");
493  ibuf = BKE_image_acquire_ibuf(ima, nullptr, &lock);
494  if (!ibuf) {
495  return false;
496  }
497 
498  /* map the mouse coords to the backdrop image space */
499  bufx = ibuf->x * snode->zoom;
500  bufy = ibuf->y * snode->zoom;
501  fx = (bufx > 0.0f ? ((float)mval[0] - 0.5f * region->winx - snode->xof) / bufx + 0.5f : 0.0f);
502  fy = (bufy > 0.0f ? ((float)mval[1] - 0.5f * region->winy - snode->yof) / bufy + 0.5f : 0.0f);
503 
504  if (fx >= 0.0f && fy >= 0.0f && fx < 1.0f && fy < 1.0f) {
505  const float *fp;
506  uchar *cp;
507  int x = (int)(fx * ibuf->x), y = (int)(fy * ibuf->y);
508 
509  CLAMP(x, 0, ibuf->x - 1);
510  CLAMP(y, 0, ibuf->y - 1);
511 
512  if (ibuf->rect_float) {
513  fp = (ibuf->rect_float + (ibuf->channels) * (y * ibuf->x + x));
514  /* #IB_PROFILE_NONE is default but in fact its linear. */
515  copy_v3_v3(r_col, fp);
516  ret = true;
517  }
518  else if (ibuf->rect) {
519  cp = (uchar *)(ibuf->rect + y * ibuf->x + x);
520  rgb_uchar_to_float(r_col, cp);
522  ret = true;
523  }
524  }
525 
526  BKE_image_release_ibuf(ima, ibuf, lock);
527 
528  return ret;
529 }
530 
531 namespace blender::ed::space_node {
532 
533 static void sample_apply(bContext *C, wmOperator *op, const wmEvent *event)
534 {
535  Main *bmain = CTX_data_main(C);
536  SpaceNode *snode = CTX_wm_space_node(C);
537  ARegion *region = CTX_wm_region(C);
539  void *lock;
540  Image *ima;
541  ImBuf *ibuf;
542  float fx, fy, bufx, bufy;
543 
544  ima = BKE_image_ensure_viewer(bmain, IMA_TYPE_COMPOSITE, "Viewer Node");
545  ibuf = BKE_image_acquire_ibuf(ima, nullptr, &lock);
546  if (!ibuf) {
547  info->draw = 0;
548  return;
549  }
550 
551  if (!ibuf->rect) {
552  IMB_rect_from_float(ibuf);
553  }
554 
555  /* map the mouse coords to the backdrop image space */
556  bufx = ibuf->x * snode->zoom;
557  bufy = ibuf->y * snode->zoom;
558  fx = (bufx > 0.0f ? ((float)event->mval[0] - 0.5f * region->winx - snode->xof) / bufx + 0.5f :
559  0.0f);
560  fy = (bufy > 0.0f ? ((float)event->mval[1] - 0.5f * region->winy - snode->yof) / bufy + 0.5f :
561  0.0f);
562 
563  if (fx >= 0.0f && fy >= 0.0f && fx < 1.0f && fy < 1.0f) {
564  const float *fp;
565  uchar *cp;
566  int x = (int)(fx * ibuf->x), y = (int)(fy * ibuf->y);
567 
568  CLAMP(x, 0, ibuf->x - 1);
569  CLAMP(y, 0, ibuf->y - 1);
570 
571  info->x = x;
572  info->y = y;
573  info->draw = 1;
574  info->channels = ibuf->channels;
575 
576  info->zp = nullptr;
577  info->zfp = nullptr;
578 
579  if (ibuf->rect) {
580  cp = (uchar *)(ibuf->rect + y * ibuf->x + x);
581 
582  info->col[0] = cp[0];
583  info->col[1] = cp[1];
584  info->col[2] = cp[2];
585  info->col[3] = cp[3];
586 
587  info->colf[0] = (float)cp[0] / 255.0f;
588  info->colf[1] = (float)cp[1] / 255.0f;
589  info->colf[2] = (float)cp[2] / 255.0f;
590  info->colf[3] = (float)cp[3] / 255.0f;
591 
592  copy_v4_v4(info->linearcol, info->colf);
594  info->linearcol, false, ibuf->rect_colorspace);
595 
596  info->color_manage = true;
597  }
598  if (ibuf->rect_float) {
599  fp = (ibuf->rect_float + (ibuf->channels) * (y * ibuf->x + x));
600 
601  info->colf[0] = fp[0];
602  info->colf[1] = fp[1];
603  info->colf[2] = fp[2];
604  info->colf[3] = fp[3];
605 
606  info->color_manage = true;
607  }
608 
609  if (ibuf->zbuf) {
610  info->z = ibuf->zbuf[y * ibuf->x + x];
611  info->zp = &info->z;
612  }
613  if (ibuf->zbuf_float) {
614  info->zf = ibuf->zbuf_float[y * ibuf->x + x];
615  info->zfp = &info->zf;
616  }
617 
618  ED_node_sample_set(info->colf);
619  }
620  else {
621  info->draw = 0;
622  ED_node_sample_set(nullptr);
623  }
624 
625  BKE_image_release_ibuf(ima, ibuf, lock);
626 
628 }
629 
630 static void sample_exit(bContext *C, wmOperator *op)
631 {
633 
634  ED_node_sample_set(nullptr);
635  ED_region_draw_cb_exit(info->art, info->draw_handle);
637  MEM_freeN(info);
638 }
639 
640 static int sample_invoke(bContext *C, wmOperator *op, const wmEvent *event)
641 {
642  SpaceNode *snode = CTX_wm_space_node(C);
643  ARegion *region = CTX_wm_region(C);
644  ImageSampleInfo *info;
645 
646  /* Don't handle events intended for nodes (which rely on click/drag distinction).
647  * which this operator would use since sampling is normally activated on press, see: T98191. */
648  if (node_or_socket_isect_event(C, event)) {
649  return OPERATOR_PASS_THROUGH;
650  }
651 
652  if (!ED_node_is_compositor(snode) || !(snode->flag & SNODE_BACKDRAW)) {
653  return OPERATOR_CANCELLED;
654  }
655 
656  info = MEM_cnew<ImageSampleInfo>("ImageSampleInfo");
657  info->art = region->type;
659  region->type, sample_draw, info, REGION_DRAW_POST_PIXEL);
660  op->customdata = info;
661 
662  sample_apply(C, op, event);
663 
665 
666  return OPERATOR_RUNNING_MODAL;
667 }
668 
669 static int sample_modal(bContext *C, wmOperator *op, const wmEvent *event)
670 {
671  switch (event->type) {
672  case LEFTMOUSE:
673  case RIGHTMOUSE: /* XXX hardcoded */
674  if (event->val == KM_RELEASE) {
675  sample_exit(C, op);
676  return OPERATOR_CANCELLED;
677  }
678  break;
679  case MOUSEMOVE:
680  sample_apply(C, op, event);
681  break;
682  }
683 
684  return OPERATOR_RUNNING_MODAL;
685 }
686 
687 static void sample_cancel(bContext *C, wmOperator *op)
688 {
689  sample_exit(C, op);
690 }
691 
693 {
694  /* identifiers */
695  ot->name = "Backimage Sample";
696  ot->idname = "NODE_OT_backimage_sample";
697  ot->description = "Use mouse to sample background image";
698 
699  /* api callbacks */
701  ot->modal = sample_modal;
704 
705  /* flags */
707 }
708 
711 } // namespace blender::ed::space_node
typedef float(TangentPoint)[2]
struct ScrArea * CTX_wm_area(const bContext *C)
Definition: context.c:738
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1090
struct SpaceNode * CTX_wm_space_node(const bContext *C)
Definition: context.c:878
struct ARegion * CTX_wm_region(const bContext *C)
Definition: context.c:749
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1074
void BKE_image_release_ibuf(struct Image *ima, struct ImBuf *ibuf, void *lock)
struct ImBuf * BKE_image_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, void **r_lock)
struct Image * BKE_image_ensure_viewer(struct Main *bmain, int type, const char *name)
#define NODE_FRAME
Definition: BKE_node.h:985
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:336
MINLINE float min_ff(float a, float b)
void rgb_uchar_to_float(float r_col[3], const unsigned char col_ub[3])
Definition: math_color.c:376
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void copy_v3_v3(float r[3], const float a[3])
void BLI_rctf_union(struct rctf *rct_a, const struct rctf *rct_b)
void BLI_rctf_scale(rctf *rect, float scale)
Definition: rct.c:655
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
Definition: BLI_rect.h:194
void BLI_rctf_resize(struct rctf *rect, float x, float y)
Definition: rct.c:635
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
Definition: BLI_rect.h:198
void BLI_rctf_init_minmax(struct rctf *rect)
Definition: rct.c:483
unsigned char uchar
Definition: BLI_sys_types.h:70
#define UNUSED(x)
@ IMA_TYPE_COMPOSITE
#define NODE_SELECT
@ SNODE_BACKDRAW
@ OPERATOR_CANCELLED
@ OPERATOR_FINISHED
@ OPERATOR_RUNNING_MODAL
@ OPERATOR_PASS_THROUGH
void ED_image_draw_info(struct Scene *scene, struct ARegion *region, bool color_manage, bool use_default_view, int channels, int x, int y, const unsigned char cp[4], const float fp[4], const float linearcol[4], const int *zp, const float *zpf)
Definition: image_draw.c:122
bool ED_node_is_compositor(struct SpaceNode *snode)
Definition: node_edit.cc:466
void ED_node_sample_set(const float col[4])
Definition: drawnode.cc:154
void ED_area_tag_redraw(ScrArea *area)
Definition: area.c:729
bool ED_operator_node_active(struct bContext *C)
Definition: screen_ops.c:307
void ED_region_tag_redraw(struct ARegion *region)
Definition: area.c:655
void * ED_region_draw_cb_activate(struct ARegionType *art, void(*draw)(const struct bContext *, struct ARegion *, void *), void *customdata, int type)
Definition: spacetypes.c:226
#define REGION_DRAW_POST_PIXEL
Definition: ED_space_api.h:63
bool ED_region_draw_cb_exit(struct ARegionType *art, void *handle)
Definition: spacetypes.c:241
_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
void IMB_colormanagement_colorspace_to_scene_linear_v4(float pixel[4], bool predivide, struct ColorSpace *colorspace)
void IMB_colormanagement_colorspace_to_scene_linear_v3(float pixel[3], struct ColorSpace *colorspace)
void IMB_rect_from_float(struct ImBuf *ibuf)
Definition: divers.c:696
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
#define C
Definition: RandGen.cpp:25
void UI_view2d_smooth_view(const struct bContext *C, struct ARegion *region, const struct rctf *cur, int smooth_viewtx)
@ KM_RELEASE
Definition: WM_types.h:268
@ OPTYPE_BLOCKING
Definition: WM_types.h:150
@ OPTYPE_GRAB_CURSOR_XY
Definition: WM_types.h:154
#define NC_NODE
Definition: WM_types.h:344
#define ND_DISPLAY
Definition: WM_types.h:439
#define ND_SPACE_NODE_VIEW
Definition: WM_types.h:479
#define NC_SPACE
Definition: WM_types.h:342
int pad[32 - sizeof(int)]
volatile int lock
unsigned int U
Definition: btGjkEpa3.h:78
OperationNode * node
Scene scene
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
bool node_or_socket_isect_event(bContext *C, const wmEvent *event)
Definition: node_select.cc:103
static int backimage_zoom_exec(bContext *C, wmOperator *op)
Definition: node_view.cc:305
static int node_view_selected_exec(bContext *C, wmOperator *op)
Definition: node_view.cc:146
static void snode_bg_viewmove_cancel(bContext *UNUSED(C), wmOperator *op)
Definition: node_view.cc:276
bool space_node_view_flag(bContext &C, SpaceNode &snode, ARegion &region, int node_flag, int smooth_viewtx)
Definition: node_view.cc:48
void NODE_OT_backimage_sample(wmOperatorType *ot)
Definition: node_view.cc:692
static int sample_modal(bContext *C, wmOperator *op, const wmEvent *event)
Definition: node_view.cc:669
void NODE_OT_backimage_zoom(wmOperatorType *ot)
Definition: node_view.cc:319
void NODE_OT_backimage_move(wmOperatorType *ot)
Definition: node_view.cc:282
static void sample_exit(bContext *C, wmOperator *op)
Definition: node_view.cc:630
static int node_view_all_exec(bContext *C, wmOperator *op)
Definition: node_view.cc:109
static void sample_cancel(bContext *C, wmOperator *op)
Definition: node_view.cc:687
static int snode_bg_viewmove_modal(bContext *C, wmOperator *op, const wmEvent *event)
Definition: node_view.cc:186
void NODE_OT_view_selected(wmOperatorType *ot)
Definition: node_view.cc:158
static int backimage_fit_exec(bContext *C, wmOperator *UNUSED(op))
Definition: node_view.cc:344
static void sample_draw(const bContext *C, ARegion *region, void *arg_info)
Definition: node_view.cc:426
void NODE_OT_view_all(wmOperatorType *ot)
Definition: node_view.cc:125
static int sample_invoke(bContext *C, wmOperator *op, const wmEvent *event)
Definition: node_view.cc:640
bool composite_node_active(bContext *C)
Definition: node_edit.cc:379
static void sample_apply(bContext *C, wmOperator *op, const wmEvent *event)
Definition: node_view.cc:533
static int snode_bg_viewmove_invoke(bContext *C, wmOperator *op, const wmEvent *event)
Definition: node_view.cc:235
void NODE_OT_backimage_fit(wmOperatorType *ot)
Definition: node_view.cc:384
bool ED_space_node_color_sample(Main *bmain, SpaceNode *snode, ARegion *region, const int mval[2], float r_col[3])
Definition: node_view.cc:476
bool ED_space_node_get_position(Main *bmain, SpaceNode *snode, struct ARegion *region, const int mval[2], float fpos[2])
Definition: node_view.cc:449
return ret
float RNA_float_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:4957
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
Definition: rna_define.c:3836
struct ARegionType * type
int channels
struct ColorSpace * rect_colorspace
unsigned int * rect
float * rect_float
Definition: BKE_main.h:121
struct bNodeTree * edittree
ListBase nodes
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
short val
Definition: WM_types.h:680
int mval[2]
Definition: WM_types.h:684
short type
Definition: WM_types.h:678
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:919
const char * name
Definition: WM_types.h:888
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:935
const char * idname
Definition: WM_types.h:890
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:943
void(* cancel)(struct bContext *, struct wmOperator *)
Definition: WM_types.h:927
struct StructRNA * srna
Definition: WM_types.h:969
const char * description
Definition: WM_types.h:893
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:903
struct PointerRNA * ptr
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_main_add_notifier(unsigned int type, void *reference)
@ RIGHTMOUSE
@ MOUSEMOVE
@ LEFTMOUSE
@ MIDDLEMOUSE
@ EVT_ESCKEY
wmOperatorType * ot
Definition: wm_files.c:3479
int WM_operator_smooth_viewtx_get(const wmOperator *op)