33 this->m_inputUVProgram =
nullptr;
34 this->m_inputColorProgram =
nullptr;
49 float uv[2], deriv[2][2],
alpha;
61 const float threshold = this->m_alpha * 0.05f;
65 float du =
len_v2(deriv[0]);
66 float dv =
len_v2(deriv[1]);
67 float factor = 1.0f - threshold * (du / m_inputColorProgram->
getWidth() +
82 bool MapUVOperation::read_uv(
float x,
float y,
float &r_u,
float &r_v,
float &r_alpha)
86 if (x < 0.0f || x >=
width || y < 0.0f || y >=
height) {
109 read_uv(xy[0], xy[1], r_uv[0], r_uv[1], r_alpha);
112 const float epsilon[2] = {1.0f, 1.0f};
118 if (read_uv(xy[0] +
epsilon[0], xy[1], uv[0], uv[1],
alpha)) {
119 r_deriv[0][0] += uv[0] - r_uv[0];
120 r_deriv[1][0] += uv[1] - r_uv[1];
123 if (read_uv(xy[0] -
epsilon[0], xy[1], uv[0], uv[1],
alpha)) {
124 r_deriv[0][0] += r_uv[0] - uv[0];
125 r_deriv[1][0] += r_uv[1] - uv[1];
129 float numinv = 1.0f / (
float)num;
130 r_deriv[0][0] *= numinv;
131 r_deriv[1][0] *= numinv;
135 if (read_uv(xy[0], xy[1] +
epsilon[1], uv[0], uv[1],
alpha)) {
136 r_deriv[0][1] += uv[0] - r_uv[0];
137 r_deriv[1][1] += uv[1] - r_uv[1];
140 if (read_uv(xy[0], xy[1] -
epsilon[1], uv[0], uv[1],
alpha)) {
141 r_deriv[0][1] += r_uv[0] - uv[0];
142 r_deriv[1][1] += r_uv[1] - uv[1];
146 float numinv = 1.0f / (
float)num;
147 r_deriv[0][1] *= numinv;
148 r_deriv[1][1] *= numinv;
154 this->m_inputUVProgram =
nullptr;
155 this->m_inputColorProgram =
nullptr;
typedef float(TangentPoint)[2]
MINLINE void mul_v4_fl(float r[4], float f)
MINLINE void zero_v4(float r[4])
MINLINE void zero_v2(float r[2])
MINLINE float len_v2(const float a[2]) ATTR_WARN_UNUSED_RESULT
_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 GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_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 pixelTransform(const float xy[2], float r_uv[2], float r_deriv[2][2], float &r_alpha)
void deinitExecution() override
void initExecution() override
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) override
NodeOperation contains calculation logic.
void readSampled(float result[4], float x, float y, PixelSampler sampler)
unsigned int getHeight() const
void addInputSocket(DataType datatype, ResizeMode resize_mode=ResizeMode::Center)
NodeOperation * getInputOperation(unsigned int inputSocketindex)
void addOutputSocket(DataType datatype)
unsigned int getWidth() const
void setResolutionInputSocketIndex(unsigned int index)
set the index of the input socket that will determine the resolution of this operation
void readFiltered(float result[4], float x, float y, float dx[2], float dy[2])
SocketReader * getInputSocketReader(unsigned int inputSocketindex)
virtual bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
static CCL_NAMESPACE_BEGIN const double alpha
@ Vector
Vector data type.
@ None
The bottom left of the input image is the bottom left of the working area of the node,...