38 .default_value({1.0f, 1.0f, 1.0f, 1.0f})
39 .compositor_domain_priority(0);
59 if (
STR_ELEM(sock->name,
"X",
"Y")) {
108 translation, rotation, scale);
110 transform(
context(), input, output, transformation, input.get_realization_options());
121 input.bind_as_texture(shader,
"input_tx");
131 output.allocate_texture(domain);
132 output.bind_as_image(shader,
"output_img");
136 input.unbind_as_texture();
139 output.unbind_as_image();
164 get_input(
"Y").get_float_value_default(1.0f));
172 get_input(
"Y").get_float_value_default(1.0f));
173 return absolute_size / input_size;
184 if (!
context().is_valid_compositing_region()) {
207 return render_size / input_size;
218 const float2 scale = render_size / input_size;
230 const float2 scale = render_size / input_size;
286 ntype.
declare = file_ns::cmp_node_scale_declare;
288 ntype.
updatefunc = file_ns::node_composite_update_scale;
#define NODE_CLASS_DISTORT
#define BLI_assert_unreachable()
#define LISTBASE_FOREACH(type, var, list)
CMPNodeScaleRenderSizeMethod
@ CMP_NODE_SCALE_RENDER_SIZE_STRETCH
@ CMP_NODE_SCALE_RENDER_SIZE_FIT
@ CMP_NODE_SCALE_RENDER_SIZE_CROP
@ CMP_NODE_SCALE_RENDER_SIZE
@ CMP_NODE_SCALE_RELATIVE
@ CMP_NODE_SCALE_ABSOLUTE
@ CMP_NODE_SCALE_RENDER_PERCENT
void GPU_shader_bind(GPUShader *shader)
void GPU_texture_extend_mode(GPUTexture *texture, GPUSamplerExtendMode extend_mode)
@ GPU_SAMPLER_EXTEND_MODE_CLAMP_TO_BORDER
void GPU_texture_filter_mode(GPUTexture *texture, bool use_filter)
uiLayout * uiLayoutRow(uiLayout *layout, bool align)
void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, eUI_Item_Flag flag, const char *name, int icon)
@ UI_ITEM_R_SPLIT_EMPTY_NAME
struct GPUShader GPUShader
int compositor_domain_priority() const
CMPNodeScaleMethod get_scale_method()
float2 get_scale_absolute()
float2 get_scale_render_size_fit()
void execute_variable_size()
float2 get_scale_render_size_stretch()
float2 get_scale_render_size()
float2 get_scale_render_size_crop()
float2 get_scale_render_percent()
CMPNodeScaleRenderSizeMethod get_scale_render_size_method()
float2 get_scale_relative()
void execute_constant_size()
GPUShader * get_shader(const char *info_name, ResultPrecision precision)
NodeOperation(Context &context, DNode node)
const bNode & bnode() const
Result & get_input(StringRef identifier) const
Result & get_result(StringRef identifier)
Context & context() const
virtual Domain compute_domain()
void unbind_as_texture() const
bool is_single_value() const
void bind_as_texture(GPUShader *shader, const char *texture_name) const
local_group_size(16, 16) .push_constant(Type b
void node_set_socket_availability(bNodeTree *ntree, bNodeSocket *sock, bool is_available)
void node_register_type(bNodeType *ntype)
T min(const T &a, const T &b)
T max(const T &a, const T &b)
MatT from_loc_rot_scale(const typename MatT::loc_type &location, const RotationT &rotation, const VecBase< typename MatT::base_type, ScaleDim > &scale)
static void cmp_node_scale_declare(NodeDeclarationBuilder &b)
static void node_composite_update_scale(bNodeTree *ntree, bNode *node)
static void node_composit_buts_scale(uiLayout *layout, bContext *, PointerRNA *ptr)
static NodeOperation * get_compositor_operation(Context &context, DNode node)
void transform(Context &context, Result &input, Result &output, const float3x3 &transformation, RealizationOptions realization_options)
void compute_dispatch_threads_at_least(GPUShader *shader, int2 threads_range, int2 local_size=int2(16))
VecBase< float, 2 > float2
void register_node_type_cmp_scale()
void cmp_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
int RNA_enum_get(PointerRNA *ptr, const char *name)
NodeGetCompositorOperationFunction get_compositor_operation
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeDeclareFunction declare
void(* updatefunc)(bNodeTree *ntree, bNode *node)