Blender  V2.93
COM_RenderLayersProg.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 "BLI_listbase.h"
22 #include "BLI_utildefines.h"
23 #include "COM_NodeOperation.h"
24 #include "DNA_scene_types.h"
25 #include "MEM_guardedalloc.h"
26 
27 #include "RE_pipeline.h"
28 
29 namespace blender::compositor {
30 
37  protected:
42 
46  short m_layerId;
47 
51  const char *m_viewName;
52 
56  float *m_inputBuffer;
57 
61  std::string m_passName;
62 
64 
68  const RenderData *m_rd;
69 
73  void determineResolution(unsigned int resolution[2],
74  unsigned int preferredResolution[2]) override;
75 
79  inline float *getInputBuffer()
80  {
81  return this->m_inputBuffer;
82  }
83 
84  void doInterpolation(float output[4], float x, float y, PixelSampler sampler);
85 
86  public:
90  RenderLayersProg(const char *passName, DataType type, int elementsize);
97  {
98  this->m_scene = scene;
99  }
100  Scene *getScene() const
101  {
102  return this->m_scene;
103  }
104  void setRenderData(const RenderData *rd)
105  {
106  this->m_rd = rd;
107  }
108  void setLayerId(short layerId)
109  {
110  this->m_layerId = layerId;
111  }
112  short getLayerId() const
113  {
114  return this->m_layerId;
115  }
116  void setViewName(const char *viewName)
117  {
118  this->m_viewName = viewName;
119  }
120  const char *getViewName()
121  {
122  return this->m_viewName;
123  }
124  void initExecution() override;
125  void deinitExecution() override;
126  void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
127 
128  std::unique_ptr<MetaData> getMetaData() override;
129 };
130 
132  public:
133  RenderLayersAOOperation(const char *passName, DataType type, int elementsize)
134  : RenderLayersProg(passName, type, elementsize)
135  {
136  }
137  void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
138 };
139 
141  public:
142  RenderLayersAlphaProg(const char *passName, DataType type, int elementsize)
143  : RenderLayersProg(passName, type, elementsize)
144  {
145  }
146  void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
147 };
148 
150  public:
151  RenderLayersDepthProg(const char *passName, DataType type, int elementsize)
152  : RenderLayersProg(passName, type, elementsize)
153  {
154  }
155  void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
156 };
157 
158 } // 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 type
_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
Read Guarded memory(de)allocation.
#define output
NodeOperation contains calculation logic.
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
RenderLayersAOOperation(const char *passName, DataType type, int elementsize)
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
RenderLayersAlphaProg(const char *passName, DataType type, int elementsize)
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
RenderLayersDepthProg(const char *passName, DataType type, int elementsize)
const RenderData * m_rd
render data used for active rendering
void doInterpolation(float output[4], float x, float y, PixelSampler sampler)
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) override
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
RenderLayersProg(const char *passName, DataType type, int elementsize)
void setRenderData(const RenderData *rd)
std::unique_ptr< MetaData > getMetaData() override
Scene scene
DataType
possible data types for sockets
Definition: COM_defines.h:27