23 #define USE_FORCE_BILINEAR
32 #ifdef USE_FORCE_BILINEAR
47 this->m_inputOperation =
nullptr;
48 this->m_inputXOperation =
nullptr;
49 this->m_inputYOperation =
nullptr;
56 this->m_centerX = this->
getWidth() / 2.0;
57 this->m_centerY = this->
getHeight() / 2.0;
62 this->m_inputOperation =
nullptr;
63 this->m_inputXOperation =
nullptr;
64 this->m_inputYOperation =
nullptr;
74 this->m_inputXOperation->
readSampled(scaleX,
x,
y, effective_sampler);
75 this->m_inputYOperation->
readSampled(scaleY,
x,
y, effective_sampler);
77 const float scx = scaleX[0];
78 const float scy = scaleY[0];
80 float nx = this->m_centerX + (
x - this->m_centerX) / scx;
81 float ny = this->m_centerY + (
y - this->m_centerY) / scy;
97 const float scx = scaleX[0];
98 const float scy = scaleY[0];
100 newInput.
xmax = this->m_centerX + (input->
xmax - this->m_centerX) / scx + 1;
101 newInput.
xmin = this->m_centerX + (input->
xmin - this->m_centerX) / scx - 1;
102 newInput.
ymax = this->m_centerY + (input->
ymax - this->m_centerY) / scy + 1;
103 newInput.
ymin = this->m_centerY + (input->
ymin - this->m_centerY) / scy - 1;
122 this->m_inputOperation =
nullptr;
123 this->m_inputXOperation =
nullptr;
124 this->m_inputYOperation =
nullptr;
131 this->m_centerX = this->
getWidth() / 2.0;
132 this->m_centerY = this->
getHeight() / 2.0;
137 this->m_inputOperation =
nullptr;
138 this->m_inputXOperation =
nullptr;
139 this->m_inputYOperation =
nullptr;
152 this->m_inputXOperation->
readSampled(scaleX,
x,
y, effective_sampler);
153 this->m_inputYOperation->
readSampled(scaleY,
x,
y, effective_sampler);
155 const float scx = scaleX[0];
156 const float scy = scaleY[0];
161 float relativeXScale = scx /
width;
162 float relativeYScale = scy /
height;
164 float nx = this->m_centerX + (
x - this->m_centerX) / relativeXScale;
165 float ny = this->m_centerY + (
y - this->m_centerY) / relativeYScale;
182 const float scx = scaleX[0];
183 const float scy = scaleY[0];
187 float relateveXScale = scx /
width;
188 float relateveYScale = scy /
height;
190 newInput.
xmax = this->m_centerX + (input->
xmax - this->m_centerX) / relateveXScale;
191 newInput.
xmin = this->m_centerX + (input->
xmin - this->m_centerX) / relateveXScale;
192 newInput.
ymax = this->m_centerY + (input->
ymax - this->m_centerY) / relateveYScale;
193 newInput.
ymin = this->m_centerY + (input->
ymin - this->m_centerY) / relateveYScale;
211 this->m_inputOperation =
nullptr;
212 this->m_is_offset =
false;
217 this->m_relX = this->m_inputOperation->
getWidth() / (
float)this->m_newWidth;
218 this->m_relY = this->m_inputOperation->
getHeight() / (
float)this->m_newHeight;
221 if (this->m_offsetX != 0.0f || this->m_offsetY != 0.0f) {
222 this->m_is_offset =
true;
224 if (this->m_newWidth > this->m_newHeight) {
225 this->m_offsetX *= this->m_newWidth;
226 this->m_offsetY *= this->m_newWidth;
229 this->m_offsetX *= this->m_newHeight;
230 this->m_offsetY *= this->m_newHeight;
234 if (this->m_is_aspect) {
236 const float w_src = this->m_inputOperation->
getWidth();
237 const float h_src = this->m_inputOperation->
getHeight();
240 const float w_dst = this->m_newWidth;
241 const float h_dst = this->m_newHeight;
243 const float asp_src = w_src / h_src;
244 const float asp_dst = w_dst / h_dst;
246 if (
fabsf(asp_src - asp_dst) >= FLT_EPSILON) {
247 if ((asp_src > asp_dst) == (this->m_is_crop ==
true)) {
249 const float div = asp_src / asp_dst;
251 this->m_offsetX += ((w_src - (w_src * div)) / (w_src / w_dst)) / 2.0f;
255 const float div = asp_dst / asp_src;
257 this->m_offsetY += ((h_src - (h_src * div)) / (h_src / h_dst)) / 2.0f;
260 this->m_is_offset =
true;
268 this->m_inputOperation =
nullptr;
278 if (this->m_is_offset) {
279 float nx = ((
x - this->m_offsetX) * this->m_relX);
280 float ny = ((
y - this->m_offsetY) * this->m_relY);
285 output,
x * this->m_relX,
y * this->m_relY, effective_sampler);
295 newInput.
xmax = (input->
xmax - m_offsetX) * this->m_relX + 1;
296 newInput.
xmin = (input->
xmin - m_offsetX) * this->m_relX;
297 newInput.
ymax = (input->
ymax - m_offsetY) * this->m_relY + 1;
298 newInput.
ymin = (input->
ymin - m_offsetY) * this->m_relY;
307 nr[0] = this->m_newWidth;
308 nr[1] = this->m_newHeight;
310 resolution[0] = this->m_newWidth;
311 resolution[1] = this->m_newHeight;
typedef float(TangentPoint)[2]
_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 GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble ny
_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
PixelSampler getEffectiveSampler(PixelSampler sampler)
void readSampled(float result[4], float x, float y, PixelSampler sampler)
unsigned int getHeight() const
void addInputSocket(DataType datatype, ResizeMode resize_mode=ResizeMode::Center)
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
virtual void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
determine the resolution of this node
SocketReader * getInputSocketReader(unsigned int inputSocketindex)
virtual bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
void initExecution() override
void deinitExecution() override
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) override
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void deinitExecution() override
void initExecution() override
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) override
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
ScaleFixedSizeOperation()
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) override
determine the resolution of this node
void initExecution() override
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) override
void deinitExecution() override
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
@ None
The bottom left of the input image is the bottom left of the working area of the node,...