19 b.use_custom_socket_order();
20 b.allow_any_socket_order();
23 .structure_type(StructureType::Dynamic)
24 .align_with_previous();
30 .description(
"The number of pixels that correspond to the same output pixel");
49 if (this->
context().use_gpu()) {
86 output.allocate_texture(domain);
91 int2 start = (texel /
int2(pixel_size)) *
int2(pixel_size);
95 for (
int y = start.y;
y < end.y;
y++) {
96 for (
int x = start.x;
x < end.x;
x++) {
101 int2 size = end - start;
102 int count = size.x * size.y;
103 output.store_pixel(texel,
Color(accumulated_color / count));
125 "Reduce detail in an image by making individual pixels more prominent, for a blocky or "
126 "mosaic-like appearance";
#define NODE_CLASS_OP_FILTER
#define CMP_NODE_PIXELATE
#define NOD_REGISTER_NODE(REGISTER_FUNC)
gpu::Shader * get_shader(const char *info_name, ResultPrecision precision)
NodeOperation(Context &context, const bNode &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
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
T load_pixel(const int2 &texel) const
void unbind_as_image() const
void bind_as_image(gpu::Shader *shader, const char *image_name, bool read=false) const
NodeOperation(Context &context, const bNode &node)
void node_register_type(bNodeType &ntype)
void compute_dispatch_threads_at_least(gpu::Shader *shader, int2 threads_range, int2 local_size=int2(16))
ColorSceneLinear4f< eAlpha::Premultiplied > Color
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 node_register()
static void node_declare(NodeDeclarationBuilder &b)
static NodeOperation * get_compositor_operation(Context &context, const bNode &node)
void GPU_shader_bind(gpu::Shader *shader, const gpu::shader::SpecializationConstants *constants_state=nullptr)
void GPU_shader_uniform_1i(gpu::Shader *sh, const char *name, int value)
void cmp_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
std::string ui_description
NodeGetCompositorOperationFunction get_compositor_operation
const char * enum_name_legacy
NodeDeclareFunction declare