Blender  V3.3
COM_Converter.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2011 Blender Foundation. */
3 
4 #include <cstring>
5 
6 #include "DNA_node_types.h"
7 
8 #include "BKE_node.h"
9 
11 
12 #include "COM_AlphaOverNode.h"
13 #include "COM_AntiAliasingNode.h"
14 #include "COM_BilateralBlurNode.h"
15 #include "COM_BlurNode.h"
16 #include "COM_BokehBlurNode.h"
17 #include "COM_BokehImageNode.h"
18 #include "COM_BoxMaskNode.h"
19 #include "COM_BrightnessNode.h"
20 #include "COM_ChannelMatteNode.h"
21 #include "COM_ChromaMatteNode.h"
22 #include "COM_ColorBalanceNode.h"
24 #include "COM_ColorCurveNode.h"
25 #include "COM_ColorExposureNode.h"
26 #include "COM_ColorMatteNode.h"
27 #include "COM_ColorNode.h"
28 #include "COM_ColorRampNode.h"
29 #include "COM_ColorSpillNode.h"
30 #include "COM_ColorToBWNode.h"
31 #include "COM_CombineColorNode.h"
33 #include "COM_CombineXYZNode.h"
34 #include "COM_CompositorNode.h"
35 #include "COM_ConvertAlphaNode.h"
37 #include "COM_ConvertOperation.h"
38 #include "COM_Converter.h"
39 #include "COM_CornerPinNode.h"
40 #include "COM_CropNode.h"
41 #include "COM_CryptomatteNode.h"
42 #include "COM_DefocusNode.h"
43 #include "COM_DenoiseNode.h"
44 #include "COM_DespeckleNode.h"
46 #include "COM_DilateErodeNode.h"
48 #include "COM_DisplaceNode.h"
49 #include "COM_DistanceMatteNode.h"
50 #include "COM_DoubleEdgeMaskNode.h"
51 #include "COM_EllipseMaskNode.h"
52 #include "COM_FilterNode.h"
53 #include "COM_FlipNode.h"
54 #include "COM_GammaNode.h"
55 #include "COM_GlareNode.h"
58 #include "COM_IDMaskNode.h"
59 #include "COM_ImageNode.h"
60 #include "COM_InpaintNode.h"
61 #include "COM_InvertNode.h"
62 #include "COM_KeyingNode.h"
63 #include "COM_KeyingScreenNode.h"
64 #include "COM_LensDistortionNode.h"
65 #include "COM_LuminanceMatteNode.h"
66 #include "COM_MapRangeNode.h"
67 #include "COM_MapUVNode.h"
68 #include "COM_MapValueNode.h"
69 #include "COM_MaskNode.h"
70 #include "COM_MathNode.h"
71 #include "COM_MixNode.h"
72 #include "COM_MovieClipNode.h"
74 #include "COM_NormalNode.h"
75 #include "COM_NormalizeNode.h"
76 #include "COM_OutputFileNode.h"
77 #include "COM_PixelateNode.h"
79 #include "COM_PosterizeNode.h"
80 #include "COM_RenderLayersNode.h"
81 #include "COM_RotateNode.h"
82 #include "COM_ScaleNode.h"
83 #include "COM_ScaleOperation.h"
84 #include "COM_SceneTimeNode.h"
85 #include "COM_SeparateColorNode.h"
87 #include "COM_SeparateXYZNode.h"
88 #include "COM_SetAlphaNode.h"
89 #include "COM_SetValueOperation.h"
90 #include "COM_SplitViewerNode.h"
91 #include "COM_Stabilize2dNode.h"
92 #include "COM_SunBeamsNode.h"
93 #include "COM_SwitchNode.h"
94 #include "COM_SwitchViewNode.h"
95 #include "COM_TextureNode.h"
96 #include "COM_TimeNode.h"
97 #include "COM_TonemapNode.h"
98 #include "COM_TrackPositionNode.h"
99 #include "COM_TransformNode.h"
100 #include "COM_TranslateNode.h"
101 #include "COM_TranslateOperation.h"
102 #include "COM_ValueNode.h"
103 #include "COM_VectorBlurNode.h"
104 #include "COM_VectorCurveNode.h"
105 #include "COM_ViewLevelsNode.h"
106 #include "COM_ViewerNode.h"
107 #include "COM_ZCombineNode.h"
108 
109 namespace blender::compositor {
110 
111 bool COM_bnode_is_fast_node(const bNode &b_node)
112 {
113  return !ELEM(b_node.type,
126 }
127 
129 {
130  Node *node = nullptr;
131 
132  /* ignore undefined nodes with missing or invalid node data */
133  if (nodeTypeUndefined(b_node)) {
134  return nullptr;
135  }
136 
137  switch (b_node->type) {
138  case CMP_NODE_COMPOSITE:
139  node = new CompositorNode(b_node);
140  break;
141  case CMP_NODE_R_LAYERS:
142  node = new RenderLayersNode(b_node);
143  break;
144  case CMP_NODE_TEXTURE:
145  node = new TextureNode(b_node);
146  break;
147  case CMP_NODE_RGBTOBW:
148  node = new ColorToBWNode(b_node);
149  break;
150  case CMP_NODE_MIX_RGB:
151  node = new MixNode(b_node);
152  break;
153  case CMP_NODE_TRANSLATE:
154  node = new TranslateNode(b_node);
155  break;
156  case CMP_NODE_SCALE:
157  node = new ScaleNode(b_node);
158  break;
159  case CMP_NODE_ROTATE:
160  node = new RotateNode(b_node);
161  break;
162  case CMP_NODE_FLIP:
163  node = new FlipNode(b_node);
164  break;
165  case CMP_NODE_FILTER:
166  node = new FilterNode(b_node);
167  break;
168  case CMP_NODE_ID_MASK:
169  node = new IDMaskNode(b_node);
170  break;
172  node = new BrightnessNode(b_node);
173  break;
175  node = new SeparateColorNode(b_node);
176  break;
178  node = new CombineColorNode(b_node);
179  break;
181  node = new SeparateRGBANode(b_node);
182  break;
184  node = new CombineRGBANode(b_node);
185  break;
187  node = new SeparateHSVANode(b_node);
188  break;
190  node = new CombineHSVANode(b_node);
191  break;
193  node = new SeparateYUVANode(b_node);
194  break;
196  node = new CombineYUVANode(b_node);
197  break;
199  node = new SeparateYCCANode(b_node);
200  break;
202  node = new CombineYCCANode(b_node);
203  break;
204  case CMP_NODE_ALPHAOVER:
205  node = new AlphaOverNode(b_node);
206  break;
208  node = new ColorBalanceNode(b_node);
209  break;
210  case CMP_NODE_VIEWER:
211  node = new ViewerNode(b_node);
212  break;
214  node = new SplitViewerNode(b_node);
215  break;
216  case CMP_NODE_INVERT:
217  node = new InvertNode(b_node);
218  break;
219  case NODE_GROUP:
220  case NODE_GROUP_INPUT:
221  case NODE_GROUP_OUTPUT:
222  /* handled in NodeCompiler */
223  break;
224  case CMP_NODE_NORMAL:
225  node = new NormalNode(b_node);
226  break;
227  case CMP_NODE_NORMALIZE:
228  node = new NormalizeNode(b_node);
229  break;
230  case CMP_NODE_IMAGE:
231  node = new ImageNode(b_node);
232  break;
233  case CMP_NODE_SETALPHA:
234  node = new SetAlphaNode(b_node);
235  break;
236  case CMP_NODE_PREMULKEY:
237  node = new ConvertAlphaNode(b_node);
238  break;
239  case CMP_NODE_MATH:
240  node = new MathNode(b_node);
241  break;
242  case CMP_NODE_HUE_SAT:
243  node = new HueSaturationValueNode(b_node);
244  break;
246  node = new ColorCorrectionNode(b_node);
247  break;
248  case CMP_NODE_MASK_BOX:
249  node = new BoxMaskNode(b_node);
250  break;
252  node = new EllipseMaskNode(b_node);
253  break;
254  case CMP_NODE_GAMMA:
255  node = new GammaNode(b_node);
256  break;
257  case CMP_NODE_CURVE_RGB:
258  node = new ColorCurveNode(b_node);
259  break;
260  case CMP_NODE_CURVE_VEC:
261  node = new VectorCurveNode(b_node);
262  break;
263  case CMP_NODE_HUECORRECT:
264  node = new HueSaturationValueCorrectNode(b_node);
265  break;
266  case CMP_NODE_MAP_UV:
267  node = new MapUVNode(b_node);
268  break;
269  case CMP_NODE_DISPLACE:
270  node = new DisplaceNode(b_node);
271  break;
272  case CMP_NODE_VALTORGB:
273  node = new ColorRampNode(b_node);
274  break;
275  case CMP_NODE_DIFF_MATTE:
276  node = new DifferenceMatteNode(b_node);
277  break;
278  case CMP_NODE_LUMA_MATTE:
279  node = new LuminanceMatteNode(b_node);
280  break;
281  case CMP_NODE_DIST_MATTE:
282  node = new DistanceMatteNode(b_node);
283  break;
285  node = new ChromaMatteNode(b_node);
286  break;
288  node = new ColorMatteNode(b_node);
289  break;
291  node = new ChannelMatteNode(b_node);
292  break;
293  case CMP_NODE_BLUR:
294  node = new BlurNode(b_node);
295  break;
296  case CMP_NODE_BOKEHIMAGE:
297  node = new BokehImageNode(b_node);
298  break;
299  case CMP_NODE_BOKEHBLUR:
300  node = new BokehBlurNode(b_node);
301  break;
303  node = new DilateErodeNode(b_node);
304  break;
305  case CMP_NODE_INPAINT:
306  node = new InpaintNode(b_node);
307  break;
308  case CMP_NODE_DESPECKLE:
309  node = new DespeckleNode(b_node);
310  break;
311  case CMP_NODE_LENSDIST:
312  node = new LensDistortionNode(b_node);
313  break;
314  case CMP_NODE_RGB:
315  node = new ColorNode(b_node);
316  break;
317  case CMP_NODE_VALUE:
318  node = new ValueNode(b_node);
319  break;
320  case CMP_NODE_TIME:
321  node = new TimeNode(b_node);
322  break;
323  case CMP_NODE_DBLUR:
324  node = new DirectionalBlurNode(b_node);
325  break;
326  case CMP_NODE_ZCOMBINE:
327  node = new ZCombineNode(b_node);
328  break;
329  case CMP_NODE_TONEMAP:
330  node = new TonemapNode(b_node);
331  break;
332  case CMP_NODE_SWITCH:
333  node = new SwitchNode(b_node);
334  break;
336  node = new SwitchViewNode(b_node);
337  break;
338  case CMP_NODE_GLARE:
339  node = new GlareNode(b_node);
340  break;
341  case CMP_NODE_MOVIECLIP:
342  node = new MovieClipNode(b_node);
343  break;
345  node = new ColorSpillNode(b_node);
346  break;
348  node = new OutputFileNode(b_node);
349  break;
350  case CMP_NODE_MAP_VALUE:
351  node = new MapValueNode(b_node);
352  break;
353  case CMP_NODE_MAP_RANGE:
354  node = new MapRangeNode(b_node);
355  break;
356  case CMP_NODE_TRANSFORM:
357  node = new TransformNode(b_node);
358  break;
359  case CMP_NODE_SCENE_TIME:
360  node = new SceneTimeNode(b_node);
361  break;
363  node = new Stabilize2dNode(b_node);
364  break;
366  node = new BilateralBlurNode(b_node);
367  break;
368  case CMP_NODE_VECBLUR:
369  node = new VectorBlurNode(b_node);
370  break;
372  node = new MovieDistortionNode(b_node);
373  break;
375  node = new ViewLevelsNode(b_node);
376  break;
377  case CMP_NODE_DEFOCUS:
378  node = new DefocusNode(b_node);
379  break;
381  node = new DoubleEdgeMaskNode(b_node);
382  break;
383  case CMP_NODE_CROP:
384  node = new CropNode(b_node);
385  break;
386  case CMP_NODE_MASK:
387  node = new MaskNode(b_node);
388  break;
390  node = new KeyingScreenNode(b_node);
391  break;
392  case CMP_NODE_KEYING:
393  node = new KeyingNode(b_node);
394  break;
395  case CMP_NODE_TRACKPOS:
396  node = new TrackPositionNode(b_node);
397  break;
398  /* not implemented yet */
399  case CMP_NODE_PIXELATE:
400  node = new PixelateNode(b_node);
401  break;
403  node = new PlaneTrackDeformNode(b_node);
404  break;
405  case CMP_NODE_CORNERPIN:
406  node = new CornerPinNode(b_node);
407  break;
408  case CMP_NODE_SUNBEAMS:
409  node = new SunBeamsNode(b_node);
410  break;
412  node = new CryptomatteLegacyNode(b_node);
413  break;
415  node = new CryptomatteNode(b_node);
416  break;
417  case CMP_NODE_DENOISE:
418  node = new DenoiseNode(b_node);
419  break;
420  case CMP_NODE_EXPOSURE:
421  node = new ExposureNode(b_node);
422  break;
424  node = new AntiAliasingNode(b_node);
425  break;
426  case CMP_NODE_POSTERIZE:
427  node = new PosterizeNode(b_node);
428  break;
430  node = new ConvertColorSpaceNode(b_node);
431  break;
433  node = new SeparateXYZNode(b_node);
434  break;
436  node = new CombineXYZNode(b_node);
437  break;
438  }
439  return node;
440 }
441 
442 /* TODO(jbakker): make this an std::optional<NodeOperation>. */
444 {
445  const DataType src_data_type = from.get_data_type();
446  const DataType dst_data_type = to.get_data_type();
447 
448  if (src_data_type == DataType::Value && dst_data_type == DataType::Color) {
449  return new ConvertValueToColorOperation();
450  }
451  if (src_data_type == DataType::Value && dst_data_type == DataType::Vector) {
452  return new ConvertValueToVectorOperation();
453  }
454  if (src_data_type == DataType::Color && dst_data_type == DataType::Value) {
455  return new ConvertColorToValueOperation();
456  }
457  if (src_data_type == DataType::Color && dst_data_type == DataType::Vector) {
458  return new ConvertColorToVectorOperation();
459  }
460  if (src_data_type == DataType::Vector && dst_data_type == DataType::Value) {
461  return new ConvertVectorToValueOperation();
462  }
463  if (src_data_type == DataType::Vector && dst_data_type == DataType::Color) {
464  return new ConvertVectorToColorOperation();
465  }
466 
467  return nullptr;
468 }
469 
471  NodeOperationOutput *from_socket,
472  NodeOperationInput *to_socket)
473 {
474  /* Data type conversions are executed before resolutions to ensure convert operations have
475  * resolution. This method have to ensure same datatypes are linked for new operations. */
476  BLI_assert(from_socket->get_data_type() == to_socket->get_data_type());
477 
478  ResizeMode mode = to_socket->get_resize_mode();
479  BLI_assert(mode != ResizeMode::None);
480 
481  NodeOperation *to_operation = &to_socket->get_operation();
482  const float to_width = to_operation->get_width();
483  const float to_height = to_operation->get_height();
484  NodeOperation *from_operation = &from_socket->get_operation();
485  const float from_width = from_operation->get_width();
486  const float from_height = from_operation->get_height();
487  bool do_center = false;
488  bool do_scale = false;
489  float scaleX = 0;
490  float scaleY = 0;
491 
492  switch (mode) {
493  case ResizeMode::None:
494  case ResizeMode::Align:
495  break;
496  case ResizeMode::Center:
497  do_center = true;
498  break;
500  do_center = true;
501  do_scale = true;
502  scaleX = scaleY = to_width / from_width;
503  break;
505  do_center = true;
506  do_scale = true;
507  scaleX = scaleY = to_height / from_height;
508  break;
509  case ResizeMode::FitAny:
510  do_center = true;
511  do_scale = true;
512  scaleX = to_width / from_width;
513  scaleY = to_height / from_height;
514  if (scaleX < scaleY) {
515  scaleX = scaleY;
516  }
517  else {
518  scaleY = scaleX;
519  }
520  break;
521  case ResizeMode::Stretch:
522  do_center = true;
523  do_scale = true;
524  scaleX = to_width / from_width;
525  scaleY = to_height / from_height;
526  break;
527  }
528 
529  float addX = do_center ? (to_width - from_width) / 2.0f : 0.0f;
530  float addY = do_center ? (to_height - from_height) / 2.0f : 0.0f;
531  NodeOperation *first = nullptr;
532  ScaleOperation *scale_operation = nullptr;
533  if (do_scale) {
534  scale_operation = new ScaleRelativeOperation(from_socket->get_data_type());
535  scale_operation->get_input_socket(1)->set_resize_mode(ResizeMode::None);
536  scale_operation->get_input_socket(2)->set_resize_mode(ResizeMode::None);
537  first = scale_operation;
538  SetValueOperation *sxop = new SetValueOperation();
539  sxop->set_value(scaleX);
540  builder.add_link(sxop->get_output_socket(), scale_operation->get_input_socket(1));
541  SetValueOperation *syop = new SetValueOperation();
542  syop->set_value(scaleY);
543  builder.add_link(syop->get_output_socket(), scale_operation->get_input_socket(2));
544  builder.add_operation(sxop);
545  builder.add_operation(syop);
546 
547  rcti scale_canvas = from_operation->get_canvas();
549  ScaleOperation::scale_area(scale_canvas, scaleX, scaleY);
550  scale_canvas.xmax = scale_canvas.xmin + to_operation->get_width();
551  scale_canvas.ymax = scale_canvas.ymin + to_operation->get_height();
552  addX = 0;
553  addY = 0;
554  }
555  scale_operation->set_canvas(scale_canvas);
556  sxop->set_canvas(scale_canvas);
557  syop->set_canvas(scale_canvas);
558  builder.add_operation(scale_operation);
559  }
560 
561  TranslateOperation *translate_operation = new TranslateOperation(to_socket->get_data_type());
562  translate_operation->get_input_socket(1)->set_resize_mode(ResizeMode::None);
563  translate_operation->get_input_socket(2)->set_resize_mode(ResizeMode::None);
564  if (!first) {
565  first = translate_operation;
566  }
568  xop->set_value(addX);
569  builder.add_link(xop->get_output_socket(), translate_operation->get_input_socket(1));
571  yop->set_value(addY);
572  builder.add_link(yop->get_output_socket(), translate_operation->get_input_socket(2));
573  builder.add_operation(xop);
574  builder.add_operation(yop);
575 
576  rcti translate_canvas = to_operation->get_canvas();
577  if (mode == ResizeMode::Align) {
578  translate_canvas.xmax = translate_canvas.xmin + from_width;
579  translate_canvas.ymax = translate_canvas.ymin + from_height;
580  }
581  translate_operation->set_canvas(translate_canvas);
582  xop->set_canvas(translate_canvas);
583  yop->set_canvas(translate_canvas);
584  builder.add_operation(translate_operation);
585 
586  if (do_scale) {
587  translate_operation->get_input_socket(0)->set_resize_mode(ResizeMode::None);
588  builder.add_link(scale_operation->get_output_socket(),
589  translate_operation->get_input_socket(0));
590  }
591 
592  /* remove previous link and replace */
593  builder.remove_input_link(to_socket);
594  first->get_input_socket(0)->set_resize_mode(ResizeMode::None);
595  to_socket->set_resize_mode(ResizeMode::None);
596  builder.add_link(from_socket, first->get_input_socket(0));
597  builder.add_link(translate_operation->get_output_socket(), to_socket);
598 }
599 
600 } // namespace blender::compositor
#define CMP_NODE_PREMULKEY
Definition: BKE_node.h:1251
#define CMP_NODE_DENOISE
Definition: BKE_node.h:1290
#define CMP_NODE_VALTORGB
Definition: BKE_node.h:1200
#define CMP_NODE_MASK
Definition: BKE_node.h:1264
#define CMP_NODE_SCALE
Definition: BKE_node.h:1225
#define CMP_NODE_EXPOSURE
Definition: BKE_node.h:1291
#define CMP_NODE_COMBINE_XYZ
Definition: BKE_node.h:1297
#define CMP_NODE_COMPOSITE
Definition: BKE_node.h:1217
#define CMP_NODE_MIX_RGB
Definition: BKE_node.h:1199
#define CMP_NODE_VECBLUR
Definition: BKE_node.h:1210
#define CMP_NODE_MAP_RANGE
Definition: BKE_node.h:1285
#define CMP_NODE_SEPHSVA_LEGACY
Definition: BKE_node.h:1212
#define CMP_NODE_TIME
Definition: BKE_node.h:1209
#define CMP_NODE_COLOR_SPILL
Definition: BKE_node.h:1231
#define CMP_NODE_SPLITVIEWER
Definition: BKE_node.h:1235
#define CMP_NODE_DESPECKLE
Definition: BKE_node.h:1269
#define CMP_NODE_VIEWER
Definition: BKE_node.h:1196
#define CMP_NODE_LUMA_MATTE
Definition: BKE_node.h:1243
#define CMP_NODE_CORNERPIN
Definition: BKE_node.h:1287
#define CMP_NODE_KEYINGSCREEN
Definition: BKE_node.h:1265
#define CMP_NODE_MASK_ELLIPSE
Definition: BKE_node.h:1279
#define CMP_NODE_DISPLACE
Definition: BKE_node.h:1240
#define CMP_NODE_COMBYCCA_LEGACY
Definition: BKE_node.h:1227
#define CMP_NODE_RGBTOBW
Definition: BKE_node.h:1201
#define CMP_NODE_SEPRGBA_LEGACY
Definition: BKE_node.h:1211
#define CMP_NODE_SEPARATE_COLOR
Definition: BKE_node.h:1299
#define CMP_NODE_CRYPTOMATTE
Definition: BKE_node.h:1292
#define CMP_NODE_BILATERALBLUR
Definition: BKE_node.h:1250
#define CMP_NODE_MAP_VALUE
Definition: BKE_node.h:1208
#define CMP_NODE_TRANSLATE
Definition: BKE_node.h:1220
#define CMP_NODE_MOVIEDISTORTION
Definition: BKE_node.h:1260
#define CMP_NODE_TONEMAP
Definition: BKE_node.h:1273
#define CMP_NODE_INPAINT
Definition: BKE_node.h:1268
#define CMP_NODE_COLORBALANCE
Definition: BKE_node.h:1255
#define CMP_NODE_HUE_SAT
Definition: BKE_node.h:1214
#define CMP_NODE_BOKEHIMAGE
Definition: BKE_node.h:1280
#define CMP_NODE_COMBYUVA_LEGACY
Definition: BKE_node.h:1229
#define CMP_NODE_ROTATE
Definition: BKE_node.h:1224
bool nodeTypeUndefined(const struct bNode *node)
#define CMP_NODE_FILTER
Definition: BKE_node.h:1207
#define CMP_NODE_DIFF_MATTE
Definition: BKE_node.h:1230
#define CMP_NODE_GAMMA
Definition: BKE_node.h:1245
#define CMP_NODE_ALPHAOVER
Definition: BKE_node.h:1205
#define CMP_NODE_TEXTURE
Definition: BKE_node.h:1219
#define CMP_NODE_HUECORRECT
Definition: BKE_node.h:1256
#define CMP_NODE_SEPYUVA_LEGACY
Definition: BKE_node.h:1228
#define CMP_NODE_COMBHSVA_LEGACY
Definition: BKE_node.h:1241
#define CMP_NODE_CROP
Definition: BKE_node.h:1248
#define CMP_NODE_CHROMA_MATTE
Definition: BKE_node.h:1232
#define CMP_NODE_GLARE
Definition: BKE_node.h:1272
#define CMP_NODE_PLANETRACKDEFORM
Definition: BKE_node.h:1286
#define CMP_NODE_MOVIECLIP
Definition: BKE_node.h:1257
#define CMP_NODE_TRANSFORM
Definition: BKE_node.h:1259
#define CMP_NODE_DILATEERODE
Definition: BKE_node.h:1223
#define CMP_NODE_SCENE_TIME
Definition: BKE_node.h:1295
#define CMP_NODE_ID_MASK
Definition: BKE_node.h:1238
#define CMP_NODE_BOKEHBLUR
Definition: BKE_node.h:1281
#define CMP_NODE_LENSDIST
Definition: BKE_node.h:1274
#define CMP_NODE_NORMALIZE
Definition: BKE_node.h:1247
#define CMP_NODE_VALUE
Definition: BKE_node.h:1198
#define CMP_NODE_ZCOMBINE
Definition: BKE_node.h:1221
#define CMP_NODE_MATH
Definition: BKE_node.h:1242
#define CMP_NODE_MAP_UV
Definition: BKE_node.h:1237
#define CMP_NODE_CRYPTOMATTE_LEGACY
Definition: BKE_node.h:1289
#define CMP_NODE_TRACKPOS
Definition: BKE_node.h:1267
#define CMP_NODE_SWITCH_VIEW
Definition: BKE_node.h:1288
#define CMP_NODE_OUTPUT_FILE
Definition: BKE_node.h:1218
#define CMP_NODE_COLORCORRECTION
Definition: BKE_node.h:1277
#define CMP_NODE_SETALPHA
Definition: BKE_node.h:1213
#define CMP_NODE_CURVE_RGB
Definition: BKE_node.h:1204
#define CMP_NODE_DOUBLEEDGEMASK
Definition: BKE_node.h:1261
#define CMP_NODE_STABILIZE2D
Definition: BKE_node.h:1258
#define CMP_NODE_PIXELATE
Definition: BKE_node.h:1283
#define CMP_NODE_COMBINE_COLOR
Definition: BKE_node.h:1298
#define CMP_NODE_SWITCH
Definition: BKE_node.h:1282
#define CMP_NODE_COMBRGBA_LEGACY
Definition: BKE_node.h:1222
#define CMP_NODE_RGB
Definition: BKE_node.h:1197
#define CMP_NODE_MASK_BOX
Definition: BKE_node.h:1278
#define CMP_NODE_DEFOCUS
Definition: BKE_node.h:1239
#define CMP_NODE_KEYING
Definition: BKE_node.h:1266
#define CMP_NODE_SEPARATE_XYZ
Definition: BKE_node.h:1296
#define CMP_NODE_POSTERIZE
Definition: BKE_node.h:1293
#define CMP_NODE_CONVERT_COLOR_SPACE
Definition: BKE_node.h:1294
#define CMP_NODE_ANTIALIASING
Definition: BKE_node.h:1270
#define CMP_NODE_R_LAYERS
Definition: BKE_node.h:1216
#define CMP_NODE_CURVE_VEC
Definition: BKE_node.h:1203
#define CMP_NODE_SEPYCCA_LEGACY
Definition: BKE_node.h:1226
#define CMP_NODE_INVERT
Definition: BKE_node.h:1246
#define CMP_NODE_COLOR_MATTE
Definition: BKE_node.h:1254
#define NODE_GROUP_INPUT
Definition: BKE_node.h:987
#define CMP_NODE_DIST_MATTE
Definition: BKE_node.h:1252
#define CMP_NODE_SUNBEAMS
Definition: BKE_node.h:1275
#define CMP_NODE_IMAGE
Definition: BKE_node.h:1215
#define CMP_NODE_NORMAL
Definition: BKE_node.h:1202
#define CMP_NODE_DBLUR
Definition: BKE_node.h:1249
#define CMP_NODE_VIEW_LEVELS
Definition: BKE_node.h:1253
#define CMP_NODE_BLUR
Definition: BKE_node.h:1206
#define CMP_NODE_BRIGHTCONTRAST
Definition: BKE_node.h:1244
#define CMP_NODE_FLIP
Definition: BKE_node.h:1234
#define CMP_NODE_CHANNEL_MATTE
Definition: BKE_node.h:1233
#define BLI_assert(a)
Definition: BLI_assert.h:46
#define ELEM(...)
NODE_GROUP_OUTPUT
NODE_GROUP
const CompositorContext & context() const
void add_link(NodeOperationOutput *from, NodeOperationInput *to)
void set_resize_mode(ResizeMode resize_mode)
NodeOperation contains calculation logic.
void set_canvas(const rcti &canvas_area)
NodeOperationOutput * get_output_socket(unsigned int index=0)
NodeOperationInput * get_input_socket(unsigned int index)
static void scale_area(rcti &area, float relative_scale_x, float relative_scale_y)
OperationNode * node
StackEntry * from
DataType
possible data types for sockets
Definition: COM_defines.h:30
ResizeMode
Resize modes of inputsockets How are the input and working resolutions matched.
@ Vector
Vector data type.
@ FitAny
Fit the width or the height of the input image to the width or height of the working area of the node...
@ FitWidth
Fit the width of the input image to the width of the working area of the node.
@ Center
Center the input image to the center of the working area of the node, no resizing occurs.
@ FitHeight
Fit the height of the input image to the height of the working area of the node.
@ Stretch
Fit the width and the height of the input image to the width and height of the working area of the no...
NodeOperation * COM_convert_data_type(const NodeOperationOutput &from, const NodeOperationInput &to)
This function will add a date-type conversion rule when the to-socket does not support the from-socke...
void COM_convert_canvas(NodeOperationBuilder &builder, NodeOperationOutput *from_socket, NodeOperationInput *to_socket)
This function will add a resolution rule based on the settings of the NodeInput.
Node * COM_convert_bnode(bNode *b_node)
Wraps a bNode in its Node instance.
bool COM_bnode_is_fast_node(const bNode &b_node)
True if the node is considered 'fast'.
short type
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