51 output[0] /= ((dr == 0.0f) ? 1.0f : dr);
52 output[1] /= ((dg == 0.0f) ? 1.0f : dg);
53 output[2] /= ((db == 0.0f) ? 1.0f : db);
54 const float igm = avg->
igm;
67 const float m = (ntm->
m > 0.0f) ? ntm->
m : (0.3f + 0.7f *
powf(avg->
auto_key, 1.4f));
68 const float ic = 1.0f - ntm->
c, ia = 1.0f - ntm->
a;
74 float I_g = avg->
cav[0] + ic * (avg->
lav - avg->
cav[0]);
75 float I_a = I_l + ia * (I_g - I_l);
78 I_g = avg->
cav[1] + ic * (avg->
lav - avg->
cav[1]);
79 I_a = I_l + ia * (I_g - I_l);
82 I_g = avg->
cav[2] + ic * (avg->
lav - avg->
cav[2]);
83 I_a = I_l + ia * (I_g - I_l);
123 float avl, maxl = -1e10f, minl = 1e10f;
124 const float sc = 1.0f / p;
126 float cav[4] = {0.0f, 0.0f, 0.0f, 0.0f};
132 maxl = (
L > maxl) ?
L : maxl;
133 minl = (
L < minl) ?
L : minl;
136 data->lav = Lav * sc;
138 maxl =
log((
double)maxl + 1
e-5);
139 minl =
log((
double)minl + 1
e-5);
141 data->auto_key = (maxl > minl) ? ((maxl - avl) / (maxl - minl)) : 1.0f;
142 float al =
exp((
double)avl);
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void add_v3_v3(float r[3], const float a[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
BLI_INLINE float IMB_colormanagement_get_luminance(const float rgb[3])
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
a MemoryBuffer contains access to the data of a chunk
const int getHeight() const
get the height of this MemoryBuffer
const int getWidth() const
get the width of this MemoryBuffer
float * getBuffer()
get the data of this MemoryBuffer
NodeOperation contains calculation logic.
virtual void * initializeTileData(rcti *)
unsigned int getHeight() const
void addInputSocket(DataType datatype, ResizeMode resize_mode=ResizeMode::Center)
NodeOperation * getInputOperation(unsigned int inputSocketindex)
void read(float result[4], int x, int y, void *chunkData)
void addOutputSocket(DataType datatype)
unsigned int getWidth() const
SocketReader * getInputSocketReader(unsigned int inputSocketindex)
virtual bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
void executePixel(float output[4], int x, int y, void *data) override
void deinitializeTileData(rcti *rect, void *data) override
SocketReader * m_imageReader
Cached reference to the reader.
void executePixel(float output[4], int x, int y, void *data) override
void initExecution() override
NodeTonemap * m_data
settings of the Tonemap
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) override
void * initializeTileData(rcti *rect) override
void deinitExecution() override
AvgLogLum * m_cachedInstance
temporarily cache of the execution storage
@ None
The bottom left of the input image is the bottom left of the working area of the node,...
__kernel void ccl_constant KernelData ccl_global void ccl_global char ccl_global int ccl_global char ccl_global unsigned int ccl_global float * buffer
INLINE Rall1d< T, V, S > log(const Rall1d< T, V, S > &arg)
INLINE Rall1d< T, V, S > exp(const Rall1d< T, V, S > &arg)
struct blender::compositor::AvgLogLum AvgLogLum
temporarily storage during execution of Tone-map
temporarily storage during execution of Tone-map