Blender V5.3
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
8
9#pragma once
10
11/* Include our own math header first to avoid warnings about M_PI
12 * redefinition between OpenImageIO and Windows headers. */
13#include "BLI_math_base_c.hh" // IWYU pragma: keep
14#include "BLI_sys_types.hh"
15
16#include <OpenImageIO/filesystem.h>
17#include <OpenImageIO/imageio.h>
18
19#include "IMB_imbuf.hh"
20#include "IMB_imbuf_types.hh"
21
22namespace blender {
23
24struct ImFileColorSpace;
25
26namespace imbuf {
27
33 const size_t mem_size;
34 const char *file_format;
37
39 bool use_all_planes = false;
40
43};
44
49 const char *file_format;
50 const ImBuf *ibuf;
52
53 OIIO::image_span<const std::byte> mem_span;
54 OIIO::ImageSpec mem_spec;
55};
56
60bool imb_oiio_check(const uchar *mem, size_t mem_size, const char *file_format);
61
72 const OIIO::ImageSpec &config,
73 ImFileColorSpace &r_colorspace,
74 OIIO::ImageSpec &r_newspec);
75
82 const char *filepath,
83 const OIIO::ImageSpec &file_spec);
84
90Vector<uint8_t> imb_oiio_write_buffer(const WriteContext &ctx, const OIIO::ImageSpec &file_spec);
91
99WriteContext imb_create_write_context(const char *file_format,
100 const ImBuf *ibuf,
101 ImBufFlags flags,
102 bool prefer_float = true);
103
111OIIO::ImageSpec imb_create_write_spec(const WriteContext &ctx,
112 int file_channels,
113 OIIO::TypeDesc data_format);
114
115} // namespace imbuf
116} // namespace blender
bool imb_oiio_write(const WriteContext &ctx, const char *filepath, const ImageSpec &file_spec)
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)
WriteContext imb_create_write_context(const char *file_format, const ImBuf *ibuf, ImBufFlags flags, bool prefer_float)
Vector< uint8_t > imb_oiio_write_buffer(const WriteContext &ctx, const ImageSpec &file_spec)
BMesh Iterators.
unsigned char uchar
Definition BKE_text.h:58
OIIO::image_span< const std::byte > mem_span