Blender  V2.93
COM_OutputFileOperation.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 #include "BLI_path_util.h"
24 #include "BLI_rect.h"
25 
26 #include "DNA_color_types.h"
27 
29 
30 namespace blender::compositor {
31 
32 /* Writes the image to a single-layer file. */
34  protected:
35  const RenderData *m_rd;
36  const bNodeTree *m_tree;
37 
40 
44 
47 
48  const char *m_viewName;
50 
51  public:
53  const bNodeTree *tree,
54  DataType datatype,
56  const char *path,
57  const ColorManagedViewSettings *viewSettings,
58  const ColorManagedDisplaySettings *displaySettings,
59  const char *viewName,
60  const bool saveAsRender);
61 
62  void executeRegion(rcti *rect, unsigned int tileNumber) override;
63  bool isOutputOperation(bool /*rendering*/) const override
64  {
65  return true;
66  }
67  void initExecution() override;
68  void deinitExecution() override;
70  {
72  }
73 };
74 
75 /* extra info for OpenEXR layers */
78 
79  char name[EXR_TOT_MAXNAME - 2];
81  bool use_layer;
82 
83  /* internals */
84  float *outputBuffer;
86 };
87 
88 /* Writes inputs into OpenEXR multilayer channels. */
90  protected:
91  const Scene *m_scene;
92  const RenderData *m_rd;
93  const bNodeTree *m_tree;
94 
99  const char *m_viewName;
100 
101  StampData *createStampData() const;
102 
103  public:
105  const RenderData *rd,
106  const bNodeTree *tree,
107  const char *path,
108  char exr_codec,
109  bool exr_half_float,
110  const char *viewName);
111 
112  void add_layer(const char *name, DataType datatype, bool use_layer);
113 
114  void executeRegion(rcti *rect, unsigned int tileNumber) override;
115  bool isOutputOperation(bool /*rendering*/) const override
116  {
117  return true;
118  }
119  void initExecution() override;
120  void deinitExecution() override;
122  {
124  }
125 };
126 
127 void add_exr_channels(void *exrhandle,
128  const char *layerName,
129  const DataType datatype,
130  const char *viewName,
131  const size_t width,
132  bool use_half_float,
133  float *buf);
134 void free_exr_channels(void *exrhandle,
135  const RenderData *rd,
136  const char *layerName,
137  const DataType datatype);
138 int get_datatype_size(DataType datatype);
139 
140 } // namespace blender::compositor
#define FILE_MAX
_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
NodeOperation contains calculation logic.
bool isOutputOperation(bool) const override
isOutputOperation determines whether this operation is an output of the ExecutionSystem during render...
eCompositorPriority getRenderPriority() const override
get the render priority of this node.
void add_layer(const char *name, DataType datatype, bool use_layer)
void executeRegion(rcti *rect, unsigned int tileNumber) override
when a chunk is executed by a CPUDevice, this method is called
OutputOpenExrMultiLayerOperation(const Scene *scene, const RenderData *rd, const bNodeTree *tree, const char *path, char exr_codec, bool exr_half_float, const char *viewName)
bool isOutputOperation(bool) const override
isOutputOperation determines whether this operation is an output of the ExecutionSystem during render...
OutputSingleLayerOperation(const RenderData *rd, const bNodeTree *tree, DataType datatype, ImageFormatData *format, const char *path, const ColorManagedViewSettings *viewSettings, const ColorManagedDisplaySettings *displaySettings, const char *viewName, const bool saveAsRender)
const ColorManagedDisplaySettings * m_displaySettings
eCompositorPriority getRenderPriority() const override
get the render priority of this node.
void executeRegion(rcti *rect, unsigned int tileNumber) override
when a chunk is executed by a CPUDevice, this method is called
Scene scene
DataType
Definition: device_memory.h:46
void * tree
eCompositorPriority
Possible priority settings.
Definition: COM_Enums.h:45
DataType
possible data types for sockets
Definition: COM_defines.h:27
format
Definition: logImageCore.h:47
int get_datatype_size(DataType datatype)
void add_exr_channels(void *exrhandle, const char *layerName, const DataType datatype, const char *viewName, const size_t width, bool use_half_float, float *buf)
void free_exr_channels(void *exrhandle, const RenderData *rd, const char *layerName, const DataType datatype)
#define EXR_TOT_MAXNAME
Definition: openexr_multi.h:33
OutputOpenExrLayer(const char *name, DataType datatype, bool use_layer)