137 switch (b_node->
type) {
482 const float to_width = to_operation->
get_width();
483 const float to_height = to_operation->
get_height();
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;
502 scaleX = scaleY = to_width / from_width;
507 scaleX = scaleY = to_height / from_height;
512 scaleX = to_width / from_width;
513 scaleY = to_height / from_height;
514 if (scaleX < scaleY) {
524 scaleX = to_width / from_width;
525 scaleY = to_height / from_height;
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;
537 first = scale_operation;
565 first = translate_operation;
578 translate_canvas.
xmax = translate_canvas.
xmin + from_width;
579 translate_canvas.
ymax = translate_canvas.
ymin + from_height;
581 translate_operation->
set_canvas(translate_canvas);
596 builder.
add_link(from_socket, first->get_input_socket(0));
#define CMP_NODE_PREMULKEY
#define CMP_NODE_VALTORGB
#define CMP_NODE_EXPOSURE
#define CMP_NODE_COMBINE_XYZ
#define CMP_NODE_COMPOSITE
#define CMP_NODE_MAP_RANGE
#define CMP_NODE_SEPHSVA_LEGACY
#define CMP_NODE_COLOR_SPILL
#define CMP_NODE_SPLITVIEWER
#define CMP_NODE_DESPECKLE
#define CMP_NODE_LUMA_MATTE
#define CMP_NODE_CORNERPIN
#define CMP_NODE_KEYINGSCREEN
#define CMP_NODE_MASK_ELLIPSE
#define CMP_NODE_DISPLACE
#define CMP_NODE_COMBYCCA_LEGACY
#define CMP_NODE_SEPRGBA_LEGACY
#define CMP_NODE_SEPARATE_COLOR
#define CMP_NODE_CRYPTOMATTE
#define CMP_NODE_BILATERALBLUR
#define CMP_NODE_MAP_VALUE
#define CMP_NODE_TRANSLATE
#define CMP_NODE_MOVIEDISTORTION
#define CMP_NODE_COLORBALANCE
#define CMP_NODE_BOKEHIMAGE
#define CMP_NODE_COMBYUVA_LEGACY
bool nodeTypeUndefined(const struct bNode *node)
#define CMP_NODE_DIFF_MATTE
#define CMP_NODE_ALPHAOVER
#define CMP_NODE_HUECORRECT
#define CMP_NODE_SEPYUVA_LEGACY
#define CMP_NODE_COMBHSVA_LEGACY
#define CMP_NODE_CHROMA_MATTE
#define CMP_NODE_PLANETRACKDEFORM
#define CMP_NODE_MOVIECLIP
#define CMP_NODE_TRANSFORM
#define CMP_NODE_DILATEERODE
#define CMP_NODE_SCENE_TIME
#define CMP_NODE_BOKEHBLUR
#define CMP_NODE_LENSDIST
#define CMP_NODE_NORMALIZE
#define CMP_NODE_ZCOMBINE
#define CMP_NODE_CRYPTOMATTE_LEGACY
#define CMP_NODE_TRACKPOS
#define CMP_NODE_SWITCH_VIEW
#define CMP_NODE_OUTPUT_FILE
#define CMP_NODE_COLORCORRECTION
#define CMP_NODE_SETALPHA
#define CMP_NODE_CURVE_RGB
#define CMP_NODE_DOUBLEEDGEMASK
#define CMP_NODE_STABILIZE2D
#define CMP_NODE_PIXELATE
#define CMP_NODE_COMBINE_COLOR
#define CMP_NODE_COMBRGBA_LEGACY
#define CMP_NODE_MASK_BOX
#define CMP_NODE_SEPARATE_XYZ
#define CMP_NODE_POSTERIZE
#define CMP_NODE_CONVERT_COLOR_SPACE
#define CMP_NODE_ANTIALIASING
#define CMP_NODE_R_LAYERS
#define CMP_NODE_CURVE_VEC
#define CMP_NODE_SEPYCCA_LEGACY
#define CMP_NODE_COLOR_MATTE
#define CMP_NODE_DIST_MATTE
#define CMP_NODE_SUNBEAMS
#define CMP_NODE_VIEW_LEVELS
#define CMP_NODE_BRIGHTCONTRAST
#define CMP_NODE_CHANNEL_MATTE
eExecutionModel get_execution_model() const
HueSaturationValueCorrectNode.
void remove_input_link(NodeOperationInput *to)
void add_operation(NodeOperation *operation)
const CompositorContext & context() const
void add_link(NodeOperationOutput *from, NodeOperationInput *to)
NodeOperation & get_operation() const
DataType get_data_type() const
NodeOperation contains calculation logic.
unsigned int get_height() const
void set_canvas(const rcti &canvas_area)
unsigned int get_width() const
NodeOperationOutput * get_output_socket(unsigned int index=0)
const rcti & get_canvas() const
NodeOperationInput * get_input_socket(unsigned int index)
static void scale_area(rcti &area, float relative_scale_x, float relative_scale_y)
void set_value(float value)
DataType
possible data types for sockets
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'.