Blender  V2.93
COM_TranslateOperation.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * Copyright 2011, Blender Foundation.
17  */
18 
19 #pragma once
20 
21 #include "COM_NodeOperation.h"
22 
23 namespace blender::compositor {
24 
26  private:
27  SocketReader *m_inputOperation;
28  SocketReader *m_inputXOperation;
29  SocketReader *m_inputYOperation;
30  float m_deltaX;
31  float m_deltaY;
32  bool m_isDeltaSet;
33  float m_factorX;
34  float m_factorY;
35 
36  public:
39  ReadBufferOperation *readOperation,
40  rcti *output) override;
41  void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
42 
43  void initExecution() override;
44  void deinitExecution() override;
45 
46  float getDeltaX()
47  {
48  return this->m_deltaX * this->m_factorX;
49  }
50  float getDeltaY()
51  {
52  return this->m_deltaY * this->m_factorY;
53  }
54 
55  inline void ensureDelta()
56  {
57  if (!this->m_isDeltaSet) {
58  float tempDelta[4];
59  this->m_inputXOperation->readSampled(tempDelta, 0, 0, PixelSampler::Nearest);
60  this->m_deltaX = tempDelta[0];
61  this->m_inputYOperation->readSampled(tempDelta, 0, 0, PixelSampler::Nearest);
62  this->m_deltaY = tempDelta[0];
63  this->m_isDeltaSet = true;
64  }
65  }
66 
67  void setFactorXY(float factorX, float factorY);
68 };
69 
70 } // namespace blender::compositor
_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
#define output
NodeOperation contains calculation logic.
void readSampled(float result[4], float x, float y, PixelSampler sampler)
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 setFactorXY(float factorX, float factorY)