Blender V4.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
5#pragma once
6
7#include <memory>
8
9/* Include our own math header first to avoid warnings about M_PI
10 * redefinition between OpenImageIO and Windows headers. */
11#include "BLI_math_base.h"
12#include "BLI_sys_types.h"
13
14#include <OpenImageIO/filesystem.h>
15#include <OpenImageIO/imageio.h>
16
17#include "IMB_imbuf.hh"
18#include "IMB_imbuf_types.hh"
19
20namespace blender::imbuf {
21
27 const size_t mem_size;
28 const char *file_format;
30 const int flags;
31
34
36 bool use_all_planes = false;
37
40};
41
46 const char *file_format;
48 int flags;
49
51 OIIO::stride_t mem_xstride;
52 OIIO::stride_t mem_ystride;
53 OIIO::ImageSpec mem_spec;
54};
55
59bool imb_oiio_check(const uchar *mem, size_t mem_size, const char *file_format);
60
71 const OIIO::ImageSpec &config,
72 char colorspace[IM_MAX_SPACE],
73 OIIO::ImageSpec &r_newspec);
74
82 const char *filepath,
83 const OIIO::ImageSpec &file_spec);
84
92WriteContext imb_create_write_context(const char *file_format,
93 ImBuf *ibuf,
94 int flags,
95 bool prefer_float = true);
96
104OIIO::ImageSpec imb_create_write_spec(const WriteContext &ctx,
105 int file_channels,
106 OIIO::TypeDesc data_format);
107
108} // namespace blender::imbuf
unsigned char uchar
#define IM_MAX_SPACE
Definition IMB_imbuf.hh:49
eImbFileType
Contains defines and structs used throughout the imbuf module.
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, char colorspace[IM_MAX_SPACE], 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)