34 this->m_inputColorProgram =
nullptr;
35 this->m_inputVectorProgram =
nullptr;
36 this->m_inputScaleXProgram =
nullptr;
37 this->m_inputScaleYProgram =
nullptr;
47 this->m_width_x4 = this->
getWidth() * 4;
48 this->m_height_x4 = this->
getHeight() * 4;
57 float uv[2], deriv[2][2];
69 bool DisplaceOperation::read_displacement(
70 float x,
float y,
float xscale,
float yscale,
const float origin[2],
float &r_u,
float &r_v)
74 if (x < 0.0f || x >=
width || y < 0.0f || y >=
height) {
82 r_u = origin[0] -
col[0] * xscale;
83 r_v = origin[1] -
col[1] * yscale;
99 CLAMP(xs, -m_width_x4, m_width_x4);
100 CLAMP(ys, -m_height_x4, m_height_x4);
103 read_displacement(xy[0], xy[1], xs, ys, xy, r_uv[0], r_uv[1]);
106 const float epsilon[2] = {1.0f, 1.0f};
112 if (read_displacement(xy[0] +
epsilon[0], xy[1], xs, ys, xy, uv[0], uv[1])) {
113 r_deriv[0][0] += uv[0] - r_uv[0];
114 r_deriv[1][0] += uv[1] - r_uv[1];
117 if (read_displacement(xy[0] -
epsilon[0], xy[1], xs, ys, xy, uv[0], uv[1])) {
118 r_deriv[0][0] += r_uv[0] - uv[0];
119 r_deriv[1][0] += r_uv[1] - uv[1];
123 float numinv = 1.0f / (
float)num;
124 r_deriv[0][0] *= numinv;
125 r_deriv[1][0] *= numinv;
129 if (read_displacement(xy[0], xy[1] +
epsilon[1], xs, ys, xy, uv[0], uv[1])) {
130 r_deriv[0][1] += uv[0] - r_uv[0];
131 r_deriv[1][1] += uv[1] - r_uv[1];
134 if (read_displacement(xy[0], xy[1] -
epsilon[1], xs, ys, xy, uv[0], uv[1])) {
135 r_deriv[0][1] += r_uv[0] - uv[0];
136 r_deriv[1][1] += r_uv[1] - uv[1];
140 float numinv = 1.0f / (
float)num;
141 r_deriv[0][1] *= numinv;
142 r_deriv[1][1] *= numinv;
148 this->m_inputColorProgram =
nullptr;
149 this->m_inputVectorProgram =
nullptr;
150 this->m_inputScaleXProgram =
nullptr;
151 this->m_inputScaleYProgram =
nullptr;
typedef float(TangentPoint)[2]
MINLINE void zero_v2(float r[2])
MINLINE bool is_zero_v2(const float a[3]) 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
Group RGB to Bright Vector Camera CLAMP
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
void deinitExecution() override
void initExecution() override
void pixelTransform(const float xy[2], float r_uv[2], float r_deriv[2][2])
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 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)
@ Vector
Vector data type.