24 b.use_custom_socket_order();
25 b.allow_any_socket_order();
27 .default_value({1.0f, 1.0f, 1.0f, 1.0f})
30 b.add_output<
decl::Color>(
"Image").structure_type(StructureType::Dynamic).align_with_previous();
32 b.add_input<
decl::Bool>(
"Flip X").default_value(
false);
33 b.add_input<
decl::Bool>(
"Flip Y").default_value(
false);
45 if (input.
is_single_value() || (!this->get_flip_x() && !this->get_flip_y())) {
51 if (this->
context().use_gpu()) {
68 input.bind_as_texture(shader,
"input_tx");
72 result.allocate_texture(domain);
73 result.bind_as_image(shader,
"output_img");
77 input.unbind_as_texture();
91 output.allocate_texture(domain);
95 int2 flipped_texel = texel;
97 flipped_texel.x = size.x - texel.x - 1;
100 flipped_texel.y =
size.y - texel.y - 1;
108 return this->
get_input(
"Flip X").get_single_value_default(
false);
113 return this->
get_input(
"Flip Y").get_single_value_default(
false);
135 ntype.
declare = file_ns::cmp_node_flip_declare;
#define NODE_CLASS_DISTORT
void GPU_shader_uniform_1b(blender::gpu::Shader *sh, const char *name, bool value)
void GPU_shader_bind(blender::gpu::Shader *shader, const blender::gpu::shader::SpecializationConstants *constants_state=nullptr)
#define NOD_REGISTER_NODE(REGISTER_FUNC)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
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()
void share_data(const Result &source)
bool is_single_value() const
StructureType structure_type
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)
static NodeOperation * get_compositor_operation(Context &context, DNode node)
static void cmp_node_flip_declare(NodeDeclarationBuilder &b)
VecBase< float, 4 > float4
VecBase< int32_t, 2 > int2
static void register_node_type_cmp_flip()
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
static pxr::UsdShadeInput get_input(const pxr::UsdShadeShader &usd_shader, const pxr::TfToken &input_name)