14 input_image_program_ =
nullptr;
15 input_key_program_ =
nullptr;
27 input_image_program_ =
nullptr;
28 input_key_program_ =
nullptr;
39 const float acceptance = settings_->
t1;
40 const float cutoff = settings_->
t2;
43 float x_angle, z_angle, alpha;
58 in_image[1] = (in_image[1] * 2.0f) - 1.0f;
59 in_image[2] = (in_image[2] * 2.0f) - 1.0f;
62 in_key[1] = (in_key[1] * 2.0f) - 1.0f;
63 in_key[2] = (in_key[2] * 2.0f) - 1.0f;
65 theta =
atan2(in_key[2], in_key[1]);
68 x_angle = in_image[1] *
cosf(theta) + in_image[2] *
sinf(theta);
69 z_angle = in_image[2] *
cosf(theta) - in_image[1] *
sinf(theta);
73 kfg = x_angle - (
fabsf(z_angle) /
tanf(acceptance / 2.0f));
76 alpha = 1.0f - (kfg / gain);
86 if (alpha < in_image[3]) {
102 const float acceptance = settings_->
t1;
103 const float cutoff = settings_->
t2;
106 const float *in_image = it.in(0);
107 const float *in_key = it.in(1);
117 const float image_cb = (in_image[1] * 2.0f) - 1.0f;
118 const float image_cr = (in_image[2] * 2.0f) - 1.0f;
121 const float key_cb = (in_key[1] * 2.0f) - 1.0f;
122 const float key_cr = (in_key[2] * 2.0f) - 1.0f;
124 const float theta =
atan2(key_cr, key_cb);
127 const float x_angle = image_cb *
cosf(theta) + image_cr *
sinf(theta);
128 const float z_angle = image_cr *
cosf(theta) - image_cb *
sinf(theta);
132 const float kfg = x_angle - (
fabsf(z_angle) /
tanf(acceptance / 2.0f));
135 const float beta =
atan2(z_angle, x_angle);
136 float alpha = 1.0f - (kfg / gain);
144 it.out[0] = alpha < in_image[3] ? alpha : in_image[3];
147 it.out[0] = in_image[3];
_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
void init_execution() override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
void update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
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
INLINE Rall1d< T, V, S > atan2(const Rall1d< T, V, S > &y, const Rall1d< T, V, S > &x)
static void area(int d1, int d2, int e1, int e2, float weights[2])
typename BuffersIteratorBuilder< T >::Iterator BuffersIterator
static bNodeSocketTemplate inputs[]
ccl_device_inline float beta(float x, float y)