Blender  V2.93
COM_CompositorOperation.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_rect.h"
22 #include "BLI_string.h"
23 #include "COM_NodeOperation.h"
24 
25 struct Scene;
26 
27 namespace blender::compositor {
28 
33  private:
34  const struct Scene *m_scene;
38  char m_sceneName[MAX_ID_NAME];
39 
43  const RenderData *m_rd;
44 
48  float *m_outputBuffer;
49 
53  float *m_depthBuffer;
54 
58  SocketReader *m_imageInput;
59 
63  SocketReader *m_alphaInput;
64 
68  SocketReader *m_depthInput;
69 
73  bool m_useAlphaInput;
74 
78  bool m_active;
79 
83  const char *m_viewName;
84 
85  public:
88  {
89  return this->m_active;
90  }
91  void executeRegion(rcti *rect, unsigned int tileNumber) override;
92  void setScene(const struct Scene *scene)
93  {
94  m_scene = scene;
95  }
96  void setSceneName(const char *sceneName)
97  {
98  BLI_strncpy(this->m_sceneName, sceneName, sizeof(this->m_sceneName));
99  }
100  void setViewName(const char *viewName)
101  {
102  this->m_viewName = viewName;
103  }
104  void setRenderData(const RenderData *rd)
105  {
106  this->m_rd = rd;
107  }
108  bool isOutputOperation(bool /*rendering*/) const override
109  {
110  return this->isActiveCompositorOutput();
111  }
112  void initExecution() override;
113  void deinitExecution() override;
115  {
117  }
118  void determineResolution(unsigned int resolution[2],
119  unsigned int preferredResolution[2]) override;
120  void setUseAlphaInput(bool value)
121  {
122  this->m_useAlphaInput = value;
123  }
124  void setActive(bool active)
125  {
126  this->m_active = active;
127  }
128 };
129 
130 } // namespace blender::compositor
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
Definition: string.c:108
#define MAX_ID_NAME
Definition: DNA_ID.h:269
void setScene(const struct Scene *scene)
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) override
determine the resolution of this node
eCompositorPriority getRenderPriority() const override
get the render priority of this node.
bool isOutputOperation(bool) const override
isOutputOperation determines whether this operation is an output of the ExecutionSystem during render...
void executeRegion(rcti *rect, unsigned int tileNumber) override
when a chunk is executed by a CPUDevice, this method is called
NodeOperation contains calculation logic.
Scene scene
eCompositorPriority
Possible priority settings.
Definition: COM_Enums.h:45
bool active
all scheduled work for the GPU.