Blender V5.0
openimageio_support.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
7/* Include our own math header first to avoid warnings about M_PI
8 * redefinition between OpenImageIO and Windows headers. */
9#include "BLI_math_base.h" // IWYU pragma: keep
10#include "BLI_sys_types.h"
11
12#include <OpenImageIO/filesystem.h>
13#include <OpenImageIO/imageio.h>
14
15#include "IMB_imbuf.hh"
16#include "IMB_imbuf_types.hh"
17
18struct ImFileColorSpace;
19
20namespace blender::imbuf {
21
27 const size_t mem_size;
28 const char *file_format;
30 const int flags;
31
33 bool use_all_planes = false;
34
37};
38
43 const char *file_format;
45 int flags;
46
48 OIIO::stride_t mem_xstride;
49 OIIO::stride_t mem_ystride;
50 OIIO::ImageSpec mem_spec;
51};
52
56bool imb_oiio_check(const uchar *mem, size_t mem_size, const char *file_format);
57
68 const OIIO::ImageSpec &config,
69 ImFileColorSpace &r_colorspace,
70 OIIO::ImageSpec &r_newspec);
71
79 const char *filepath,
80 const OIIO::ImageSpec &file_spec);
81
89WriteContext imb_create_write_context(const char *file_format,
90 ImBuf *ibuf,
91 int flags,
92 bool prefer_float = true);
93
101OIIO::ImageSpec imb_create_write_spec(const WriteContext &ctx,
102 int file_channels,
103 OIIO::TypeDesc data_format);
104
105} // namespace blender::imbuf
unsigned char uchar
eImbFileType
bool imb_oiio_write(const WriteContext &ctx, const char *filepath, const ImageSpec &file_spec)
WriteContext imb_create_write_context(const char *file_format, ImBuf *ibuf, int flags, bool prefer_float)
ImBuf * imb_oiio_read(const ReadContext &ctx, const ImageSpec &config, ImFileColorSpace &r_colorspace, ImageSpec &r_newspec)
bool imb_oiio_check(const uchar *mem, size_t mem_size, const char *file_format)
ImageSpec imb_create_write_spec(const WriteContext &ctx, int file_channels, TypeDesc data_format)