Blender  V3.3
COM_ColorExposureOperation.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2020 Blender Foundation. */
3 
5 
6 namespace blender::compositor {
7 
9 {
13  input_program_ = nullptr;
14  flags_.can_be_constant = true;
15 }
16 
18 {
19  input_program_ = this->get_input_socket_reader(0);
20  input_exposure_program_ = this->get_input_socket_reader(1);
21 }
22 
24  float x,
25  float y,
27 {
28  float input_value[4];
29  float input_exposure[4];
30  input_program_->read_sampled(input_value, x, y, sampler);
31  input_exposure_program_->read_sampled(input_exposure, x, y, sampler);
32  const float exposure = pow(2, input_exposure[0]);
33 
34  output[0] = input_value[0] * exposure;
35  output[1] = input_value[1] * exposure;
36  output[2] = input_value[2] * exposure;
37 
38  output[3] = input_value[3];
39 }
40 
42 {
43  for (; p.out < p.row_end; p.next()) {
44  const float *in_value = p.ins[0];
45  const float *in_exposure = p.ins[1];
46  const float exposure = pow(2, in_exposure[0]);
47  p.out[0] = in_value[0] * exposure;
48  p.out[1] = in_value[1] * exposure;
49  p.out[2] = in_value[2] * exposure;
50  p.out[3] = in_value[3];
51  }
52 }
53 
55 {
56  input_program_ = nullptr;
57  input_exposure_program_ = nullptr;
58 }
59 
60 } // namespace blender::compositor
_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 update_memory_buffer_row(PixelCursor &p) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
void add_output_socket(DataType datatype)
SocketReader * get_input_socket_reader(unsigned int index)
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
ccl_device_inline float3 pow(float3 v, float e)
Definition: math_float3.h:533