Blender  V2.93
COM_OutputFileOperation.cc
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 
20 
21 #include "COM_MetaData.h"
22 
23 #include <cstring>
24 
25 #include "BLI_listbase.h"
26 #include "BLI_path_util.h"
27 #include "BLI_string.h"
28 
29 #include "BKE_global.h"
30 #include "BKE_image.h"
31 #include "BKE_main.h"
32 #include "BKE_scene.h"
33 
34 #include "DNA_color_types.h"
35 #include "MEM_guardedalloc.h"
36 
37 #include "IMB_colormanagement.h"
38 #include "IMB_imbuf.h"
39 #include "IMB_imbuf_types.h"
40 
41 #include "RE_pipeline.h"
42 
43 namespace blender::compositor {
44 
45 void add_exr_channels(void *exrhandle,
46  const char *layerName,
47  const DataType datatype,
48  const char *viewName,
49  const size_t width,
50  bool use_half_float,
51  float *buf)
52 {
53  /* create channels */
54  switch (datatype) {
55  case DataType::Value:
57  exrhandle, layerName, "V", viewName, 1, width, buf ? buf : nullptr, use_half_float);
58  break;
59  case DataType::Vector:
61  exrhandle, layerName, "X", viewName, 3, 3 * width, buf ? buf : nullptr, use_half_float);
62  IMB_exr_add_channel(exrhandle,
63  layerName,
64  "Y",
65  viewName,
66  3,
67  3 * width,
68  buf ? buf + 1 : nullptr,
69  use_half_float);
70  IMB_exr_add_channel(exrhandle,
71  layerName,
72  "Z",
73  viewName,
74  3,
75  3 * width,
76  buf ? buf + 2 : nullptr,
77  use_half_float);
78  break;
79  case DataType::Color:
81  exrhandle, layerName, "R", viewName, 4, 4 * width, buf ? buf : nullptr, use_half_float);
82  IMB_exr_add_channel(exrhandle,
83  layerName,
84  "G",
85  viewName,
86  4,
87  4 * width,
88  buf ? buf + 1 : nullptr,
89  use_half_float);
90  IMB_exr_add_channel(exrhandle,
91  layerName,
92  "B",
93  viewName,
94  4,
95  4 * width,
96  buf ? buf + 2 : nullptr,
97  use_half_float);
98  IMB_exr_add_channel(exrhandle,
99  layerName,
100  "A",
101  viewName,
102  4,
103  4 * width,
104  buf ? buf + 3 : nullptr,
105  use_half_float);
106  break;
107  default:
108  break;
109  }
110 }
111 
112 void free_exr_channels(void *exrhandle,
113  const RenderData *rd,
114  const char *layerName,
115  const DataType datatype)
116 {
117  SceneRenderView *srv;
118 
119  /* check renderdata for amount of views */
120  for (srv = (SceneRenderView *)rd->views.first; srv; srv = srv->next) {
121  float *rect = nullptr;
122 
123  if (BKE_scene_multiview_is_render_view_active(rd, srv) == false) {
124  continue;
125  }
126 
127  /* the pointer is stored in the first channel of each datatype */
128  switch (datatype) {
129  case DataType::Value:
130  rect = IMB_exr_channel_rect(exrhandle, layerName, "V", srv->name);
131  break;
132  case DataType::Vector:
133  rect = IMB_exr_channel_rect(exrhandle, layerName, "X", srv->name);
134  break;
135  case DataType::Color:
136  rect = IMB_exr_channel_rect(exrhandle, layerName, "R", srv->name);
137  break;
138  default:
139  break;
140  }
141  if (rect) {
142  MEM_freeN(rect);
143  }
144  }
145 }
146 
148 {
149  switch (datatype) {
150  case DataType::Value:
151  return 1;
152  case DataType::Vector:
153  return 3;
154  case DataType::Color:
155  return 4;
156  default:
157  return 0;
158  }
159 }
160 
161 static float *init_buffer(unsigned int width, unsigned int height, DataType datatype)
162 {
163  // When initializing the tree during initial load the width and height can be zero.
164  if (width != 0 && height != 0) {
165  int size = get_datatype_size(datatype);
166  return (float *)MEM_callocN(width * height * size * sizeof(float), "OutputFile buffer");
167  }
168 
169  return nullptr;
170 }
171 
172 static void write_buffer_rect(rcti *rect,
173  const bNodeTree *tree,
174  SocketReader *reader,
175  float *buffer,
176  unsigned int width,
177  DataType datatype)
178 {
179  float color[4];
180  int i, size = get_datatype_size(datatype);
181 
182  if (!buffer) {
183  return;
184  }
185  int x1 = rect->xmin;
186  int y1 = rect->ymin;
187  int x2 = rect->xmax;
188  int y2 = rect->ymax;
189  int offset = (y1 * width + x1) * size;
190  int x;
191  int y;
192  bool breaked = false;
193 
194  for (y = y1; y < y2 && (!breaked); y++) {
195  for (x = x1; x < x2 && (!breaked); x++) {
196  reader->readSampled(color, x, y, PixelSampler::Nearest);
197 
198  for (i = 0; i < size; i++) {
199  buffer[offset + i] = color[i];
200  }
201  offset += size;
202 
203  if (tree->test_break && tree->test_break(tree->tbh)) {
204  breaked = true;
205  }
206  }
207  offset += (width - (x2 - x1)) * size;
208  }
209 }
210 
212  const RenderData *rd,
213  const bNodeTree *tree,
214  DataType datatype,
216  const char *path,
217  const ColorManagedViewSettings *viewSettings,
218  const ColorManagedDisplaySettings *displaySettings,
219  const char *viewName,
220  const bool saveAsRender)
221 {
222  this->m_rd = rd;
223  this->m_tree = tree;
224 
225  this->addInputSocket(datatype);
226 
227  this->m_outputBuffer = nullptr;
228  this->m_datatype = datatype;
229  this->m_imageInput = nullptr;
230 
231  this->m_format = format;
232  BLI_strncpy(this->m_path, path, sizeof(this->m_path));
233 
234  this->m_viewSettings = viewSettings;
235  this->m_displaySettings = displaySettings;
236  this->m_viewName = viewName;
237  this->m_saveAsRender = saveAsRender;
238 }
239 
241 {
243  this->m_outputBuffer = init_buffer(this->getWidth(), this->getHeight(), this->m_datatype);
244 }
245 
246 void OutputSingleLayerOperation::executeRegion(rcti *rect, unsigned int /*tileNumber*/)
247 {
248  write_buffer_rect(rect,
249  this->m_tree,
250  this->m_imageInput,
251  this->m_outputBuffer,
252  this->getWidth(),
253  this->m_datatype);
254 }
255 
257 {
258  if (this->getWidth() * this->getHeight() != 0) {
259 
260  int size = get_datatype_size(this->m_datatype);
261  ImBuf *ibuf = IMB_allocImBuf(this->getWidth(), this->getHeight(), this->m_format->planes, 0);
262  char filename[FILE_MAX];
263  const char *suffix;
264 
265  ibuf->channels = size;
266  ibuf->rect_float = this->m_outputBuffer;
267  ibuf->mall |= IB_rectfloat;
268  ibuf->dither = this->m_rd->dither_intensity;
269 
272 
273  suffix = BKE_scene_multiview_view_suffix_get(this->m_rd, this->m_viewName);
274 
276  this->m_path,
278  this->m_rd->cfra,
279  this->m_format,
280  (this->m_rd->scemode & R_EXTENSION) != 0,
281  true,
282  suffix);
283 
284  if (0 == BKE_imbuf_write(ibuf, filename, this->m_format)) {
285  printf("Cannot save Node File Output to %s\n", filename);
286  }
287  else {
288  printf("Saved: %s\n", filename);
289  }
290 
291  IMB_freeImBuf(ibuf);
292  }
293  this->m_outputBuffer = nullptr;
294  this->m_imageInput = nullptr;
295 }
296 
297 /******************************* MultiLayer *******************************/
298 
299 OutputOpenExrLayer::OutputOpenExrLayer(const char *name_, DataType datatype_, bool use_layer_)
300 {
301  BLI_strncpy(this->name, name_, sizeof(this->name));
302  this->datatype = datatype_;
303  this->use_layer = use_layer_;
304 
305  /* these are created in initExecution */
306  this->outputBuffer = nullptr;
307  this->imageInput = nullptr;
308 }
309 
311  const RenderData *rd,
312  const bNodeTree *tree,
313  const char *path,
314  char exr_codec,
315  bool exr_half_float,
316  const char *viewName)
317 {
318  this->m_scene = scene;
319  this->m_rd = rd;
320  this->m_tree = tree;
321 
322  BLI_strncpy(this->m_path, path, sizeof(this->m_path));
323  this->m_exr_codec = exr_codec;
324  this->m_exr_half_float = exr_half_float;
325  this->m_viewName = viewName;
327 }
328 
330  DataType datatype,
331  bool use_layer)
332 {
333  this->addInputSocket(datatype);
334  this->m_layers.append(OutputOpenExrLayer(name, datatype, use_layer));
335 }
336 
338 {
339  /* StampData API doesn't provide functions to modify an instance without having a RenderResult.
340  */
341  RenderResult render_result;
343  render_result.stamp_data = stamp_data;
344  for (const OutputOpenExrLayer &layer : m_layers) {
345  /* Skip unconnected sockets. */
346  if (layer.imageInput == nullptr) {
347  continue;
348  }
349  std::unique_ptr<MetaData> meta_data = layer.imageInput->getMetaData();
350  if (meta_data) {
351  blender::StringRef layer_name =
353  blender::StringRef(layer.name, BLI_strnlen(layer.name, sizeof(layer.name))));
354  meta_data->replaceHashNeutralCryptomatteKeys(layer_name);
355  meta_data->addToRenderResult(&render_result);
356  }
357  }
358  return stamp_data;
359 }
360 
362 {
363  for (unsigned int i = 0; i < this->m_layers.size(); i++) {
364  if (this->m_layers[i].use_layer) {
365  SocketReader *reader = getInputSocketReader(i);
366  this->m_layers[i].imageInput = reader;
367  this->m_layers[i].outputBuffer = init_buffer(
368  this->getWidth(), this->getHeight(), this->m_layers[i].datatype);
369  }
370  }
371 }
372 
373 void OutputOpenExrMultiLayerOperation::executeRegion(rcti *rect, unsigned int /*tileNumber*/)
374 {
375  for (unsigned int i = 0; i < this->m_layers.size(); i++) {
376  OutputOpenExrLayer &layer = this->m_layers[i];
377  if (layer.imageInput) {
378  write_buffer_rect(rect,
379  this->m_tree,
380  layer.imageInput,
381  layer.outputBuffer,
382  this->getWidth(),
383  layer.datatype);
384  }
385  }
386 }
387 
389 {
390  unsigned int width = this->getWidth();
391  unsigned int height = this->getHeight();
392  if (width != 0 && height != 0) {
393  char filename[FILE_MAX];
394  const char *suffix;
395  void *exrhandle = IMB_exr_get_handle();
396 
397  suffix = BKE_scene_multiview_view_suffix_get(this->m_rd, this->m_viewName);
399  this->m_path,
401  this->m_rd->cfra,
403  (this->m_rd->scemode & R_EXTENSION) != 0,
404  true,
405  suffix);
406  BLI_make_existing_file(filename);
407 
408  for (unsigned int i = 0; i < this->m_layers.size(); i++) {
409  OutputOpenExrLayer &layer = this->m_layers[i];
410  if (!layer.imageInput) {
411  continue; /* skip unconnected sockets */
412  }
413 
414  add_exr_channels(exrhandle,
415  this->m_layers[i].name,
416  this->m_layers[i].datatype,
417  "",
418  width,
419  this->m_exr_half_float,
420  this->m_layers[i].outputBuffer);
421  }
422 
423  /* when the filename has no permissions, this can fail */
424  StampData *stamp_data = createStampData();
425  if (IMB_exr_begin_write(exrhandle, filename, width, height, this->m_exr_codec, stamp_data)) {
426  IMB_exr_write_channels(exrhandle);
427  }
428  else {
429  /* TODO, get the error from openexr's exception */
430  /* XXX nice way to do report? */
431  printf("Error Writing Render Result, see console\n");
432  }
433 
434  IMB_exr_close(exrhandle);
435  for (unsigned int i = 0; i < this->m_layers.size(); i++) {
436  if (this->m_layers[i].outputBuffer) {
437  MEM_freeN(this->m_layers[i].outputBuffer);
438  this->m_layers[i].outputBuffer = nullptr;
439  }
440 
441  this->m_layers[i].imageInput = nullptr;
442  }
443  BKE_stamp_data_free(stamp_data);
444  }
445 }
446 
447 } // namespace blender::compositor
void BKE_stamp_data_free(struct StampData *stamp_data)
Definition: image.c:2757
int BKE_imbuf_write(struct ImBuf *ibuf, const char *name, const struct ImageFormatData *imf)
void BKE_image_path_from_imformat(char *string, const char *base, const char *relbase, int frame, const struct ImageFormatData *im_format, const bool use_ext, const bool use_frames, const char *suffix)
void BKE_image_path_from_imtype(char *string, const char *base, const char *relbase, int frame, const char imtype, const bool use_ext, const bool use_frames, const char *suffix)
Definition: image.c:3091
struct StampData * BKE_stamp_info_from_scene_static(const struct Scene *scene)
const char * BKE_main_blendfile_path_from_global(void)
Definition: main.c:439
bool BKE_scene_multiview_is_render_view_active(const struct RenderData *rd, const struct SceneRenderView *srv)
const char * BKE_scene_multiview_view_suffix_get(const struct RenderData *rd, const char *viewname)
bool BLI_make_existing_file(const char *name)
Definition: path_util.c:1347
#define FILE_MAX
size_t BLI_strnlen(const char *str, const size_t maxlen) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition: string.c:878
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
Definition: string.c:108
#define R_EXTENSION
#define R_IMF_IMTYPE_MULTILAYER
_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 GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble y1
_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 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 GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble x2
_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
struct ImBuf * IMB_colormanagement_imbuf_for_write(struct ImBuf *ibuf, bool save_as_render, bool allocate_result, const struct ColorManagedViewSettings *view_settings, const struct ColorManagedDisplaySettings *display_settings, struct ImageFormatData *image_format_data)
struct ImBuf * IMB_allocImBuf(unsigned int x, unsigned int y, unsigned char planes, unsigned int flags)
Definition: allocimbuf.c:478
void IMB_freeImBuf(struct ImBuf *ibuf)
Definition: allocimbuf.c:211
Contains defines and structs used throughout the imbuf module.
@ IB_rectfloat
Read Guarded memory(de)allocation.
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
NodeOperation contains calculation logic.
void readSampled(float result[4], float x, float y, PixelSampler sampler)
void addInputSocket(DataType datatype, ResizeMode resize_mode=ResizeMode::Center)
void setResolutionInputSocketIndex(unsigned int index)
set the index of the input socket that will determine the resolution of this operation
SocketReader * getInputSocketReader(unsigned int inputSocketindex)
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)
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
void executeRegion(rcti *rect, unsigned int tileNumber) override
when a chunk is executed by a CPUDevice, this method is called
Scene scene
void * tree
DataType
possible data types for sockets
Definition: COM_defines.h:27
@ Vector
Vector data type.
__kernel void ccl_constant KernelData ccl_global void ccl_global char ccl_global int ccl_global char ccl_global unsigned int ccl_global float * buffer
format
Definition: logImageCore.h:47
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:41
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
StringRef BKE_cryptomatte_extract_layer_name(const StringRef render_pass_name)
Definition: cryptomatte.cc:496
static constexpr unsigned int RESOLUTION_INPUT_ANY
static void write_buffer_rect(rcti *rect, const bNodeTree *tree, SocketReader *reader, float *buffer, unsigned int width, DataType datatype)
static float * init_buffer(unsigned int width, unsigned int height, DataType datatype)
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)
void IMB_exr_close(void *handle)
void IMB_exr_add_channel(void *handle, const char *layname, const char *passname, const char *viewname, int xstride, int ystride, float *rect, bool use_half_float)
void IMB_exr_write_channels(void *handle)
int IMB_exr_begin_write(void *handle, const char *filename, int width, int height, int compress, const StampData *stamp)
void * IMB_exr_get_handle(void)
float * IMB_exr_channel_rect(void *handle, const char *layname, const char *passname, const char *viewname)
int channels
float dither
float * rect_float
void * first
Definition: DNA_listBase.h:47
float dither_intensity
ListBase views
struct StampData * stamp_data
Definition: RE_pipeline.h:157
struct SceneRenderView * next
OutputOpenExrLayer(const char *name, DataType datatype, bool use_layer)
int ymin
Definition: DNA_vec_types.h:80
int ymax
Definition: DNA_vec_types.h:80
int xmin
Definition: DNA_vec_types.h:79
int xmax
Definition: DNA_vec_types.h:79