31 {0,
nullptr, 0,
nullptr,
nullptr},
39 {0,
nullptr, 0,
nullptr,
nullptr},
44 b.use_custom_socket_order();
45 b.allow_any_socket_order();
48 .default_value({1.0f, 1.0f, 1.0f, 1.0f})
51 .structure_type(StructureType::Dynamic);
53 .structure_type(StructureType::Dynamic)
54 .align_with_previous();
76 .description(
"How the image fits in the camera frame");
83 .description(
"Interpolation method");
88 .description(
"The extension mode applied to the X axis");
93 .description(
"The extension mode applied to the Y axis");
127 output.transform(transformation);
143 if (this->
context().use_gpu()) {
179 output.allocate_texture(domain);
203 output.allocate_texture(domain);
211 float2 scaled_coordinates = center +
217 scaled_coordinates, interpolation, extension_mode_x, extension_mode_y));
224 return "compositor_scale_variable_bicubic";
226 return "compositor_scale_variable";
232 this->
get_input(
"Interpolation").get_single_value_default<MenuValue>().value);
233 switch (interpolation) {
250 this->
get_input(
"Extension X").get_single_value_default<MenuValue>().value);
251 switch (extension_x) {
266 this->
get_input(
"Extension Y").get_single_value_default<MenuValue>().value);
267 switch (extension_y) {
299 get_input(
"Y").get_single_value_default<float>());
307 get_input(
"Y").get_single_value_default<float>());
308 return absolute_size / input_size;
337 return render_size / input_size;
382 this->
get_input(
"Frame Type").get_single_value_default<MenuValue>().value);
#define NODE_CLASS_DISTORT
#define NOD_REGISTER_NODE(REGISTER_FUNC)
gpu::Shader * get_shader(const char *info_name, ResultPrecision precision)
NodeOperation(Context &context, const bNode &node)
Result & get_result(StringRef identifier)
Context & context() const
Result & get_input(StringRef identifier) const
virtual Domain compute_domain()
T sample(const float2 &coordinates, const Interpolation &interpolation, const Extension &extension_mode_x, const Extension &extension_mode_y, std::optional< float2x2 > jacobian=std::nullopt) const
bool is_single_value() const
void unbind_as_texture_or_single_value(gpu::Texture *single_value_texture) const
void unbind_as_texture() const
void bind_as_texture(gpu::Shader *shader, const char *texture_name) const
T load_pixel(const int2 &texel) const
gpu::Texture * bind_as_texture_or_single_value(gpu::Shader *shader, const char *texture_name) const
DeclType::Builder & add_input(UString name, UString identifier=""_ustr)
StructureType structure_type
const CompositorInputRealizationMode & compositor_realization_mode() const
NodeOperation(Context &context, const bNode &node)
void execute_variable_size_cpu()
float2 get_scale_absolute()
Extension get_extension_mode_x() const
float2 get_scale_render_size_fit()
void execute_variable_size()
float2 get_scale_render_size_stretch()
float2 get_scale_render_size()
CMPNodeScaleRenderSizeMethod get_frame_type()
const char * get_shader_name() const
CMPNodeScaleMethod get_type()
Extension get_extension_mode_y() const
float2 get_scale_render_size_crop()
float2 get_scale_render_percent()
void execute_variable_size_gpu()
float2 get_scale_relative()
void execute_constant_size()
Interpolation get_interpolation() const
float3x3 scale(float3x3 mat, float2 scale)
void node_register_type(bNodeType &ntype)
void node_type_storage(bNodeType &ntype, std::optional< StringRefNull > storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
void compute_dispatch_threads_at_least(gpu::Shader *shader, int2 threads_range, int2 local_size=int2(16))
ColorSceneLinear4f< eAlpha::Premultiplied > Color
GPUSamplerExtendMode map_extension_mode_to_extend_mode(const Extension &mode)
void parallel_for(const int2 range, const Function &function)
T min(const T &a, const T &b)
MatT from_scale(const VecBase< typename MatT::base_type, ScaleDim > &scale)
T max(const T &a, const T &b)
static NodeOperation * get_compositor_operation(Context &context, const bNode &node)
static void node_init(bNodeTree *, bNode *node)
static const EnumPropertyItem type_items[]
static const EnumPropertyItem frame_type_items[]
static void node_register()
static void node_declare(NodeDeclarationBuilder &b)
const EnumPropertyItem rna_enum_node_compositor_extension_items[]
CMPNodeScaleRenderSizeMethod
@ CMP_NODE_SCALE_RENDER_SIZE_STRETCH
@ CMP_NODE_SCALE_RENDER_SIZE_CROP
@ CMP_NODE_SCALE_RENDER_SIZE_FIT
BMesh const char void * data
void GPU_texture_filter_mode(gpu::Texture *texture, bool use_filter)
@ CMP_NODE_EXTENSION_MODE_REPEAT
@ CMP_NODE_EXTENSION_MODE_EXTEND
@ CMP_NODE_EXTENSION_MODE_CLIP
void GPU_shader_bind(gpu::Shader *shader, const gpu::shader::SpecializationConstants *constants_state=nullptr)
@ CMP_NODE_INTERPOLATION_NEAREST
@ CMP_NODE_INTERPOLATION_BICUBIC
@ CMP_NODE_INTERPOLATION_ANISOTROPIC
@ CMP_NODE_INTERPOLATION_BILINEAR
void GPU_texture_extend_mode_x(gpu::Texture *texture, GPUSamplerExtendMode extend_mode)
void GPU_texture_extend_mode_y(gpu::Texture *texture, GPUSamplerExtendMode extend_mode)
@ CMP_NODE_SCALE_ABSOLUTE
@ CMP_NODE_SCALE_RENDER_PERCENT
@ CMP_NODE_SCALE_RELATIVE
@ CMP_NODE_SCALE_RENDER_SIZE
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
void node_free_standard_storage(bNode *node)
const EnumPropertyItem rna_enum_node_compositor_interpolation_items[]
void cmp_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
std::string ui_description
NodeGetCompositorOperationFunction get_compositor_operation
void(*) initfunc(bNodeTree *ntree, bNode *node)
const char * enum_name_legacy
NodeDeclareFunction declare