36 .default_value({1.0f, 1.0f, 1.0f, 1.0f})
37 .compositor_domain_priority(0);
43 NodeTwoXYs *nxy = MEM_cnew<NodeTwoXYs>(__func__);
102 int2 lower_bound, upper_bound;
126 int2 lower_bound, upper_bound;
130 if (lower_bound.x == upper_bound.x || lower_bound.y == upper_bound.y) {
132 result.allocate_invalid();
144 const int2 size = upper_bound - lower_bound;
174 if (input.is_single_value()) {
178 int2 lower_bound, upper_bound;
180 const int2 input_size = input.domain().size;
182 if (lower_bound ==
int2(0) && upper_bound == input_size) {
197 lower_bound.x = input_size.x * node_two_xys.
fac_x1;
198 lower_bound.y = input_size.y * node_two_xys.
fac_y2;
199 upper_bound.x = input_size.x * node_two_xys.
fac_x2;
200 upper_bound.y = input_size.y * node_two_xys.
fac_y1;
204 lower_bound.x =
min_ii(node_two_xys.
x1, input_size.x);
205 lower_bound.y =
min_ii(node_two_xys.
y2, input_size.y);
206 upper_bound.x =
min_ii(node_two_xys.
x2, input_size.x);
207 upper_bound.y =
min_ii(node_two_xys.
y1, input_size.y);
211 lower_bound.x =
min_ii(lower_bound.x, upper_bound.x);
212 lower_bound.y =
min_ii(lower_bound.y, upper_bound.y);
213 upper_bound.x =
max_ii(lower_bound.x, upper_bound.x);
214 upper_bound.y =
max_ii(lower_bound.y, upper_bound.y);
232 ntype.
declare = file_ns::cmp_node_crop_declare;
234 ntype.
initfunc = file_ns::node_composit_init_crop;
#define NODE_STORAGE_FUNCS(StorageT)
#define NODE_CLASS_DISTORT
MINLINE int min_ii(int a, int b)
MINLINE int max_ii(int a, int b)
void GPU_shader_uniform_2iv(GPUShader *sh, const char *name, const int data[2])
void GPU_shader_bind(GPUShader *shader)
uiLayout * uiLayoutColumn(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
void compute_cropping_bounds(int2 &lower_bound, int2 &upper_bound)
void execute_alpha_crop()
void execute_image_crop()
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 bind_as_image(GPUShader *shader, const char *image_name, bool read=false) const
void pass_through(Result &target)
void unbind_as_texture() const
const Domain & domain() const
void unbind_as_image() const
void allocate_texture(Domain domain, bool from_pool=true)
void bind_as_texture(GPUShader *shader, const char *texture_name) const
local_group_size(16, 16) .push_constant(Type b
void node_type_storage(bNodeType *ntype, const char *storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
void node_register_type(bNodeType *ntype)
static void node_composit_init_crop(bNodeTree *, bNode *node)
static void cmp_node_crop_declare(NodeDeclarationBuilder &b)
static NodeOperation * get_compositor_operation(Context &context, DNode node)
static void node_composit_buts_crop(uiLayout *layout, bContext *, PointerRNA *ptr)
void compute_dispatch_threads_at_least(GPUShader *shader, int2 threads_range, int2 local_size=int2(16))
VecBase< int32_t, 2 > int2
void register_node_type_cmp_crop()
void cmp_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
void node_free_standard_storage(bNode *node)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
NodeGetCompositorOperationFunction get_compositor_operation
void(* initfunc)(bNodeTree *ntree, bNode *node)
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeDeclareFunction declare