40 float screen_color[4];
45 const int screen_primary_channel =
max_axis_v3(screen_color);
46 const int other_1 = (screen_primary_channel + 1) % 3;
47 const int other_2 = (screen_primary_channel + 2) % 3;
49 const int min_channel =
MIN2(other_1, other_2);
50 const int max_channel =
MAX2(other_1, other_2);
52 float average_value, amount;
56 amount = (pixel_color[screen_primary_channel] - average_value);
61 if (amount_despill > 0.0f) {
62 output[screen_primary_channel] = pixel_color[screen_primary_channel] - amount_despill;
71 const float *pixel_color = it.in(0);
72 const float *screen_color = it.in(1);
74 const int screen_primary_channel =
max_axis_v3(screen_color);
75 const int other_1 = (screen_primary_channel + 1) % 3;
76 const int other_2 = (screen_primary_channel + 2) % 3;
78 const int min_channel =
MIN2(other_1, other_2);
79 const int max_channel =
MAX2(other_1, other_2);
81 const float average_value =
color_balance_ * pixel_color[min_channel] +
83 const float amount = (pixel_color[screen_primary_channel] - average_value);
88 if (amount_despill > 0.0f) {
89 it.out[screen_primary_channel] = pixel_color[screen_primary_channel] - amount_despill;
MINLINE int max_axis_v3(const float vec[3])
MINLINE void copy_v4_v4(float r[4], const float a[4])
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
SocketReader * pixel_reader_
void init_execution() override
SocketReader * screen_reader_
void update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void deinit_execution() override
a MemoryBuffer contains access to the data of a chunk
void add_output_socket(DataType datatype)
SocketReader * get_input_socket_reader(unsigned int index)
NodeOperationFlags flags_
void read_sampled(float result[4], float x, float y, PixelSampler sampler)
void add_input_socket(DataType datatype, ResizeMode resize_mode=ResizeMode::Center)
depth_tx sampler(1, ImageType::FLOAT_2D, "combined_tx") .sampler(2
ccl_global KernelShaderEvalInput ccl_global float * output
static void area(int d1, int d2, int e1, int e2, float weights[2])
typename BuffersIteratorBuilder< T >::Iterator BuffersIterator
static bNodeSocketTemplate inputs[]