28 b.add_input<
decl::Color>(
"Color").compositor_domain_priority(0);
32 .
description(
"The number of pixels that correspond to the same output pixel")
33 .compositor_expects_single_value();
54 if (this->
context().use_gpu()) {
91 output.allocate_texture(domain);
96 int2 start = (texel /
int2(pixel_size)) *
int2(pixel_size);
100 for (
int y = start.y;
y < end.y;
y++) {
101 for (
int x = start.x;
x < end.x;
x++) {
108 output.store_pixel(texel, accumulated_color /
count);
134 "Reduce detail in an image by making individual pixels more prominent, for a blocky or "
135 "mosaic-like appearance";
138 ntype.
declare = file_ns::cmp_node_pixelate_declare;
#define NODE_CLASS_OP_FILTER
#define CMP_NODE_PIXELATE
void GPU_shader_uniform_1i(GPUShader *sh, const char *name, int value)
void GPU_shader_bind(GPUShader *shader, const blender::gpu::shader::SpecializationConstants *constants_state=nullptr)
#define NOD_REGISTER_NODE(REGISTER_FUNC)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
GPUShader * 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(Domain domain, bool from_pool=true)
void unbind_as_texture() const
void bind_as_texture(GPUShader *shader, const char *texture_name) const
void bind_as_image(GPUShader *shader, const char *image_name, bool read=false) const
void unbind_as_image() const
bool is_single_value() const
NodeOperation(Context &context, DNode node)
void node_register_type(bNodeType &ntype)
void compute_dispatch_threads_at_least(GPUShader *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