31 .default_value({0.5f, 0.5f})
34 .description(
"Line position where the image should be split");
38 .description(
"Line angle where the image should be split");
40 b.add_input<
decl::Color>(
"Image").structure_type(StructureType::Dynamic);
41 b.add_input<
decl::Color>(
"Image",
"Image_001").structure_type(StructureType::Dynamic);
43 b.add_output<
decl::Color>(
"Image").structure_type(StructureType::Dynamic);
54 if (this->
context().use_gpu()) {
105 const float2 direction_to_line_point = line_point - float2(texel);
106 const float projection = math::dot(normal, direction_to_line_point);
107 const bool is_below_line = projection <= 0;
108 output_image.store_pixel(texel,
109 is_below_line ? first_image.load_pixel<float4, true>(texel) :
110 second_image.load_pixel<float4, true>(texel));
116 const float2 relative_position =
118 return float2(domain.
size) * relative_position;
143 "Combine two images for side-by-side display. Typically used in combination with a Viewer "
147 ntype.
declare = file_ns::cmp_node_split_declare;
#define NODE_CLASS_CONVERTER
void GPU_shader_bind(blender::gpu::Shader *shader, const blender::gpu::shader::SpecializationConstants *constants_state=nullptr)
void GPU_shader_uniform_2fv(blender::gpu::Shader *sh, const char *name, const float data[2])
#define NOD_REGISTER_NODE(REGISTER_FUNC)
gpu::Shader * get_shader(const char *info_name, ResultPrecision precision)
NodeOperation(Context &context, DNode node)
Result & get_result(StringRef identifier)
Context & context() const
Result & get_input(StringRef identifier) const
virtual Domain compute_domain()
T get_single_value_default(const T &default_value) const
void allocate_texture(const Domain domain, const bool from_pool=true, const std::optional< ResultStorageType > storage_type=std::nullopt)
void unbind_as_texture() const
void bind_as_texture(gpu::Shader *shader, const char *texture_name) const
void unbind_as_image() const
void bind_as_image(gpu::Shader *shader, const char *image_name, bool read=false) const
math::AngleRadian get_rotation()
float2 get_position(const Domain &domain)
NodeOperation(Context &context, DNode node)
void node_register_type(bNodeType &ntype)
void compute_dispatch_threads_at_least(gpu::Shader *shader, int2 threads_range, int2 local_size=int2(16))
void parallel_for(const int2 range, const Function &function)
AngleRadianBase< float > AngleRadian
T cos(const AngleRadianBase< T > &a)
T sin(const AngleRadianBase< T > &a)
static void cmp_node_split_declare(NodeDeclarationBuilder &b)
static NodeOperation * get_compositor_operation(Context &context, DNode node)
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
static void register_node_type_cmp_split()
void cmp_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
std::string ui_description
NodeGetCompositorOperationFunction get_compositor_operation
const char * enum_name_legacy
NodeDeclareFunction declare