29 this->m_gausstab =
nullptr;
30 this->m_filtersize = 0;
61 void GaussianAlphaXBlurOperation::updateGauss()
63 if (this->m_gausstab ==
nullptr) {
71 if (this->m_distbuf_inv ==
nullptr) {
83 return (
LIKELY(test ==
false)) ? f : 1.0f - f;
88 const bool do_invert = this->m_do_subtract;
91 int bufferwidth = inputBuffer->
getWidth();
93 int bufferstartx = input_rect.
xmin;
94 int bufferstarty = input_rect.
ymin;
103 int bufferindex = ((xmin - bufferstartx)) + ((ymin - bufferstarty) * bufferwidth);
106 float alpha_accum = 0.0f;
107 float multiplier_accum = 0.0f;
113 float distfacinv_max = 1.0f;
115 for (
int nx = xmin; nx < xmax; nx += step) {
116 const int index = (nx -
x) + this->m_filtersize;
122 multiplier = this->m_gausstab[index];
123 alpha_accum += value * multiplier;
124 multiplier_accum += multiplier;
128 if (value > value_max) {
129 multiplier = this->m_distbuf_inv[index];
131 if (value > value_max) {
133 distfacinv_max = multiplier;
140 const float value_blur = alpha_accum / multiplier_accum;
141 const float value_final = (value_max * distfacinv_max) + (value_blur * (1.0f - distfacinv_max));
149 if (this->m_gausstab) {
151 this->m_gausstab =
nullptr;
154 if (this->m_distbuf_inv) {
156 this->m_distbuf_inv =
nullptr;
181 newInput.
xmax = input->
xmax + this->m_filtersize + 1;
182 newInput.
xmin = input->
xmin - this->m_filtersize - 1;
MINLINE float max_ff(float a, float b)
MINLINE int min_ii(int a, int b)
MINLINE float min_ff(float a, float b)
MINLINE int max_ii(int a, int b)
#define MAX_GAUSSTAB_RADIUS
_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
Read Guarded memory(de)allocation.
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume Image Sky Noise Wave Voronoi Brick Texture Vector Combine Vertex Separate Vector White Value
void deinitExecution() override
float * make_gausstab(float rad, int size)
float * make_dist_fac_inverse(float rad, int size, int falloff)
void deinitExecution() override
Deinitialize the execution.
void * initializeTileData(rcti *rect) override
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) override
void initExecution() override
initialize the execution
GaussianAlphaXBlurOperation()
void executePixel(float output[4], int x, int y, void *data) override
The inner loop of this operation.
a MemoryBuffer contains access to the data of a chunk
const rcti & get_rect() const
get the rect 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
NodeOperation * getInputOperation(unsigned int inputSocketindex)
unsigned int getWidth() const
virtual bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
DataType
possible data types for sockets
__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
void(* MEM_freeN)(void *vmemh)
BLI_INLINE float finv_test(const float f, const bool test)
ccl_device_inline float3 ceil(const float3 &a)