Blender V5.3
IMB_openexr.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2024 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10
11#pragma once
12
14#include "BLI_span.hh"
15#include "BLI_string_ref.hh"
16#include "BLI_sys_types.hh"
17#include "BLI_vector.hh"
18
19struct ImBuf;
20
21namespace blender {
22
23/* XXX layer+pass name max 64? */
24#define EXR_LAY_MAXNAME 64
25#define EXR_PASS_MAXNAME 64
26#define EXR_VIEW_MAXNAME 64
27#define EXR_TOT_MAXNAME 64
29#define EXR_PASS_MAXCHAN 24
30
31struct StampData;
32struct ExrReadHandle;
33struct ExrWriteHandle;
34
35/* -------------------------------------------------------------------- */
41
42ExrWriteHandle *IMB_exr_write_begin(bool write_multipart = false);
43
45void IMB_exr_write_view(ExrWriteHandle *handle, const char *viewname);
46
55void IMB_exr_write_pass(ExrWriteHandle *handle,
56 StringRefNull layerpassname,
57 StringRefNull channelnames,
58 StringRefNull viewname,
59 StringRefNull colorspace,
60 size_t xstride,
61 size_t ystride,
62 const float *rect,
63 bool use_half_float);
64
66bool IMB_exr_write_end(ExrWriteHandle *handle,
67 const char *filepath,
68 int width,
69 int height,
70 const double ppm[2],
71 int compress,
72 int quality,
73 const StampData *stamp);
74
76
77/* -------------------------------------------------------------------- */
80
85ExrReadHandle *IMB_exr_open(const char *filepath);
86
90ExrReadHandle *IMB_exr_open_multilayer(const char *filepath);
91
96ExrReadHandle *IMB_exr_open_multilayer_from_memory(const uchar *mem, size_t size);
97
99bool IMB_exr_get_ppm(ExrReadHandle *handle, double ppm[2]);
100
101/* Get display window metadata. The information is in the same structure
102 * specified in ImBuf, see its documentation for more information. */
103void IMB_exr_get_display_window(ExrReadHandle *handle,
104 int display_size[2],
105 int display_offset[2],
106 int data_offset[2]);
107
109int2 IMB_exr_get_size(ExrReadHandle *handle);
110
111/* Close reader. */
112void IMB_exr_close(ExrReadHandle *handle);
113
115
116/* -------------------------------------------------------------------- */
119
131
137
143
151 const char *src_colorspace = nullptr,
152 bool predivide = false);
153
155
156} // namespace blender
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
unsigned int uchar
BMesh Iterators.
int2 IMB_exr_get_size(ExrReadHandle *handle)
ExrReadHandle * IMB_exr_open(const char *filepath)
void IMB_exr_write_pass(ExrWriteHandle *handle, StringRefNull layerpassname, StringRefNull channelnames, StringRefNull viewname, StringRefNull colorspace, size_t xstride, size_t ystride, const float *rect, bool use_half_float)
bool IMB_exr_write_end(ExrWriteHandle *handle, const char *filepath, int width, int height, const double ppm[2], int compress, int quality, const StampData *stamp)
ExrReadHandle * IMB_exr_open_multilayer(const char *filepath)
void IMB_exr_get_display_window(ExrReadHandle *handle, int display_size[2], int display_offset[2], int data_offset[2])
void IMB_exr_write_view(ExrWriteHandle *handle, const char *viewname)
Vector< StringRefNull > IMB_exr_get_views(ExrReadHandle *handle)
bool IMB_exr_get_ppm(ExrReadHandle *handle, double ppm[2])
ExrWriteHandle * IMB_exr_write_begin(bool write_multipart=false)
void IMB_exr_close(ExrReadHandle *handle)
ExrReadHandle * IMB_exr_open_multilayer_from_memory(const uchar *mem, size_t size)
Vector< ExrPassInfo > IMB_exr_get_passes(ExrReadHandle *handle)
void IMB_exr_read_passes(ExrReadHandle *handle, MutableSpan< ExrPassInfo > entries, const char *src_colorspace=nullptr, bool predivide=false)
StringRefNull chan_id
StringRefNull layer