Blender  V2.93
COM_ScaleOperation.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  public:
27  void setSampler(PixelSampler sampler)
28  {
29  this->m_sampler = (int)sampler;
30  }
31  void setVariableSize(bool variable_size)
32  {
33  m_variable_size = variable_size;
34  };
35 
36  protected:
38 
40  {
41  return (m_sampler == -1) ? sampler : (PixelSampler)m_sampler;
42  }
43 
44  int m_sampler;
46 };
47 
49  private:
50  SocketReader *m_inputOperation;
51  SocketReader *m_inputXOperation;
52  SocketReader *m_inputYOperation;
53  float m_centerX;
54  float m_centerY;
55 
56  public:
59  ReadBufferOperation *readOperation,
60  rcti *output) override;
61  void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
62 
63  void initExecution() override;
64  void deinitExecution() override;
65 };
66 
68  SocketReader *m_inputOperation;
69  SocketReader *m_inputXOperation;
70  SocketReader *m_inputYOperation;
71  float m_centerX;
72  float m_centerY;
73 
74  public:
77  ReadBufferOperation *readOperation,
78  rcti *output) override;
79  void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
80 
81  void initExecution() override;
82  void deinitExecution() override;
83 };
84 
86  SocketReader *m_inputOperation;
87  int m_newWidth;
88  int m_newHeight;
89  float m_relX;
90  float m_relY;
91 
92  /* center is only used for aspect correction */
93  float m_offsetX;
94  float m_offsetY;
95  bool m_is_aspect;
96  bool m_is_crop;
97  /* set from other properties on initialization,
98  * check if we need to apply offset */
99  bool m_is_offset;
100 
101  public:
104  ReadBufferOperation *readOperation,
105  rcti *output) override;
106  void determineResolution(unsigned int resolution[2],
107  unsigned int preferredResolution[2]) override;
108  void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
109 
110  void initExecution() override;
111  void deinitExecution() override;
112  void setNewWidth(int width)
113  {
114  this->m_newWidth = width;
115  }
117  {
118  this->m_newHeight = height;
119  }
120  void setIsAspect(bool is_aspect)
121  {
122  this->m_is_aspect = is_aspect;
123  }
124  void setIsCrop(bool is_crop)
125  {
126  this->m_is_crop = is_crop;
127  }
128  void setOffset(float x, float y)
129  {
130  this->m_offsetX = x;
131  this->m_offsetY = y;
132  }
133 };
134 
135 } // 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 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
#define output
PixelSampler getEffectiveSampler(PixelSampler sampler)
NodeOperation contains calculation logic.
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
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 determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) override
determine the resolution of this node
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