32 .default_value({0.0f, 0.0f, 0.0f, 1.0f})
33 .compositor_domain_priority(0);
52 constexpr static float luminance_coefficients_bt709_[3] = {0.2126f, 0.7152f, 0.0722f};
59 if (
get_input(
"Image").is_single_value()) {
110 float luminance_coefficients[3];
124 return compute_sum() / (input.domain().size.x * input.domain().size.y);
140 float luminance_coefficients[3];
154 return std::sqrt(
sum / (input.domain().size.x * input.domain().size.y));
169 context(), input,
float3(luminance_coefficients_bt709_), subtrahend);
171 float luminance_coefficients[3];
174 context(), input,
float3(luminance_coefficients), subtrahend);
202 ntype.
declare = file_ns::cmp_node_levels_declare;
203 ntype.
draw_buttons = file_ns::node_composit_buts_view_levels;
205 ntype.
initfunc = file_ns::node_composit_init_view_levels;
#define NODE_CLASS_OUTPUT
#define BLI_assert_unreachable()
@ CMP_NODE_LEVLES_LUMINANCE
@ CMP_NODE_LEVLES_LUMINANCE_BT709
BLI_INLINE void IMB_colormanagement_get_luminance_coefficients(float r_rgb[3])
void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, eUI_Item_Flag flag, const char *name, int icon)
@ UI_ITEM_R_SPLIT_EMPTY_NAME
static T sum(const btAlignedObjectArray< T > &items)
float compute_standard_deviation(float mean)
CMPNodeLevelsChannel get_channel()
void execute_single_value()
float compute_sum_squared_difference(float subtrahend)
NodeOperation(Context &context, DNode node)
const bNode & bnode() const
Result & get_input(StringRef identifier) const
Result & get_result(StringRef identifier)
Context & context() const
void set_float_value(float value)
void allocate_single_value()
local_group_size(16, 16) .push_constant(Type b
void node_register_type(bNodeType *ntype)
T dot(const QuaternionBase< T > &a, const QuaternionBase< T > &b)
static void node_composit_init_view_levels(bNodeTree *, bNode *node)
static void cmp_node_levels_declare(NodeDeclarationBuilder &b)
static void node_composit_buts_view_levels(uiLayout *layout, bContext *, PointerRNA *ptr)
static NodeOperation * get_compositor_operation(Context &context, DNode node)
float sum_blue_squared_difference(Context &context, GPUTexture *texture, float subtrahend)
float sum_luminance_squared_difference(Context &context, GPUTexture *texture, float3 luminance_coefficients, float subtrahend)
float sum_blue(Context &context, GPUTexture *texture)
float sum_red_squared_difference(Context &context, GPUTexture *texture, float subtrahend)
float sum_luminance(Context &context, GPUTexture *texture, float3 luminance_coefficients)
float sum_red(Context &context, GPUTexture *texture)
float sum_green_squared_difference(Context &context, GPUTexture *texture, float subtrahend)
float sum_green(Context &context, GPUTexture *texture)
VecBase< float, 3 > float3
void register_node_type_cmp_view_levels()
void cmp_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
NodeGetCompositorOperationFunction get_compositor_operation
void(* initfunc)(bNodeTree *ntree, bNode *node)
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeDeclareFunction declare