27 b.use_custom_socket_order();
28 b.allow_any_socket_order();
30 b.add_output<
decl::Color>(
"Color").structure_type(StructureType::Dynamic).align_with_previous();
33 "The number of pixels that correspond to the same output pixel");
52 if (this->
context().use_gpu()) {
89 output.allocate_texture(domain);
94 int2 start = (texel /
int2(pixel_size)) *
int2(pixel_size);
98 for (
int y = start.y;
y < end.y;
y++) {
99 for (
int x = start.x;
x < end.x;
x++) {
106 output.store_pixel(texel, accumulated_color /
count);
132 "Reduce detail in an image by making individual pixels more prominent, for a blocky or "
133 "mosaic-like appearance";
136 ntype.
declare = file_ns::cmp_node_pixelate_declare;
#define NODE_CLASS_OP_FILTER
#define CMP_NODE_PIXELATE
void GPU_shader_bind(blender::gpu::Shader *shader, const blender::gpu::shader::SpecializationConstants *constants_state=nullptr)
void GPU_shader_uniform_1i(blender::gpu::Shader *sh, const char *name, int value)
#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)
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
bool is_single_value() const
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)
T min(const T &a, const T &b)
T max(const T &a, const T &b)
static void cmp_node_pixelate_declare(NodeDeclarationBuilder &b)
static NodeOperation * get_compositor_operation(Context &context, DNode node)
VecBase< float, 4 > float4
VecBase< int32_t, 2 > int2
static void register_node_type_cmp_pixelate()
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