38 .default_value({0.8f, 0.8f, 0.8f, 1.0f})
39 .compositor_domain_priority(0);
41 .default_value({1.0f, 1.0f, 1.0f, 1.0f})
42 .compositor_domain_priority(1);
54 data->screen_balance = 0.5f;
55 data->despill_balance = 0.5f;
56 data->despill_factor = 1.0f;
57 data->edge_kernel_radius = 3;
58 data->edge_kernel_tolerance = 0.1f;
59 data->clip_black = 0.0f;
60 data->clip_white = 1.0f;
129 const float blur_size = node_storage(
bnode()).blur_pre;
130 if (blur_size == 0.0f) {
132 output.increment_reference_count();
146 return blurred_input;
155 input.bind_as_texture(shader,
"input_tx");
159 output.bind_as_image(shader,
"output_img");
164 input.unbind_as_texture();
165 output.unbind_as_image();
176 input.bind_as_texture(shader,
"input_tx");
182 output.bind_as_image(shader,
"output_img");
187 input.unbind_as_texture();
189 output.unbind_as_image();
201 input.bind_as_texture(shader,
"input_tx");
208 output.bind_as_image(shader,
"output_img");
213 input.unbind_as_texture();
215 output.unbind_as_image();
224 const float black_level = node_storage(
bnode()).clip_black;
225 const float white_level = node_storage(
bnode()).clip_white;
228 const bool garbage_matte_exists =
234 if (!output_edges.
should_compute() && (black_level == 0.0f && white_level == 1.0f) &&
235 !core_matte_exists && !garbage_matte_exists)
237 Result output_matte = input_matte;
282 const float blur_size = node_storage(
bnode()).blur_post;
286 if (blur_size == 0.0f) {
287 Result output_matte = input_matte;
296 return blurred_matte;
301 const int distance = node_storage(
bnode()).dilate_distance;
306 Result output_matte = input_matte;
314 return morphed_matte;
319 const int distance = node_storage(
bnode()).feather_distance;
324 Result output_matte = input_matte;
331 context(), input_matte, feathered_matte, distance, node_storage(
bnode()).feather_falloff);
333 return feathered_matte;
345 input.bind_as_texture(shader,
"input_tx");
350 matte.bind_as_texture(shader,
"matte_tx");
353 output.allocate_texture(matte.domain());
354 output.bind_as_image(shader,
"output_img");
359 input.unbind_as_texture();
361 matte.unbind_as_texture();
362 output.unbind_as_image();
380 ntype.
declare = file_ns::cmp_node_keying_declare;
381 ntype.
draw_buttons = file_ns::node_composit_buts_keying;
382 ntype.
initfunc = file_ns::node_composit_init_keying;
#define NODE_STORAGE_FUNCS(StorageT)
void GPU_shader_uniform_1i(GPUShader *sh, const char *name, int value)
void GPU_shader_uniform_1f(GPUShader *sh, const char *name, float value)
void GPU_shader_bind(GPUShader *shader)
void GPU_shader_uniform_1b(GPUShader *sh, const char *name, bool value)
void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, eUI_Item_Flag flag, const char *name, int icon)
@ UI_ITEM_R_SPLIT_EMPTY_NAME
struct GPUShader GPUShader
DInputSocket input_by_identifier(StringRef identifier) const
int compositor_domain_priority() const
Result extract_input_chroma()
Result compute_feathered_matte(Result &input_matte)
Result compute_blurred_input()
Result compute_morphed_matte(Result &input_matte)
Result compute_matte(Result &input)
Result compute_tweaked_matte(Result &input_matte)
Result compute_blurred_matte(Result &input_matte)
Result replace_input_chroma(Result &new_chroma)
void compute_image(Result &matte)
GPUShader * get_shader(const char *info_name, ResultPrecision precision)
Result create_result(ResultType type, ResultPrecision precision)
NodeOperation(Context &context, DNode node)
const bNode & bnode() const
const DNode & node() const
Result & get_input(StringRef identifier) const
Result & get_result(StringRef identifier)
Context & context() const
void bind_as_image(GPUShader *shader, const char *image_name, bool read=false) const
void unbind_as_texture() const
const Domain & domain() const
void unbind_as_image() const
void increment_reference_count(int count=1)
void allocate_texture(Domain domain, bool from_pool=true)
void steal_data(Result &source)
void bind_as_texture(GPUShader *shader, const char *texture_name) const
local_group_size(16, 16) .push_constant(Type b
void node_type_storage(bNodeType *ntype, const char *storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
void node_register_type(bNodeType *ntype)
static void node_composit_buts_keying(uiLayout *layout, bContext *, PointerRNA *ptr)
static NodeOperation * get_compositor_operation(Context &context, DNode node)
static void node_composit_init_keying(bNodeTree *, bNode *node)
static void cmp_node_keying_declare(NodeDeclarationBuilder &b)
void symmetric_separable_blur(Context &context, Result &input, Result &output, float2 radius, int filter_type=R_FILTER_GAUSS, bool extend_bounds=false, bool gamma_correct=false)
void morphological_distance(Context &context, Result &input, Result &output, int distance)
void compute_dispatch_threads_at_least(GPUShader *shader, int2 threads_range, int2 local_size=int2(16))
void morphological_distance_feather(Context &context, Result &input, Result &output, int distance, int falloff_type=PROP_SMOOTH)
VecBase< float, 2 > float2
void register_node_type_cmp_keying()
void cmp_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
void node_free_standard_storage(bNode *node)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
NodeGetCompositorOperationFunction get_compositor_operation
void(* initfunc)(bNodeTree *ntree, bNode *node)
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeDeclareFunction declare