Blender
V5.3
source
blender
imbuf
intern
oiio
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
22
namespace
blender
{
23
24
struct
ImFileColorSpace
;
25
26
namespace
imbuf
{
27
31
struct
ReadContext
{
32
const
uchar
*
mem_start
;
33
const
size_t
mem_size
;
34
const
char
*
file_format
;
35
const
eImbFileType
file_type
;
36
const
ImBufFlags
flags
;
37
39
bool
use_all_planes
=
false
;
40
42
bool
use_metadata_colorspace
=
false
;
43
};
44
48
struct
WriteContext
{
49
const
char
*
file_format
;
50
const
ImBuf
*
ibuf
;
51
ImBufFlags
flags
;
52
53
OIIO::image_span<const std::byte>
mem_span
;
54
OIIO::ImageSpec
mem_spec
;
55
};
56
60
bool
imb_oiio_check
(
const
uchar
*mem,
size_t
mem_size,
const
char
*file_format);
61
71
ImBuf
*
imb_oiio_read
(
const
ReadContext
&ctx,
72
const
OIIO::ImageSpec &config,
73
ImFileColorSpace
&r_colorspace,
74
OIIO::ImageSpec &r_newspec);
75
81
bool
imb_oiio_write
(
const
WriteContext
&ctx,
82
const
char
*filepath,
83
const
OIIO::ImageSpec &file_spec);
84
90
Vector<uint8_t>
imb_oiio_write_buffer
(
const
WriteContext
&ctx,
const
OIIO::ImageSpec &file_spec);
91
99
WriteContext
imb_create_write_context
(
const
char
*file_format,
100
const
ImBuf
*ibuf,
101
ImBufFlags
flags,
102
bool
prefer_float =
true
);
103
111
OIIO::ImageSpec
imb_create_write_spec
(
const
WriteContext
&ctx,
112
int
file_channels,
113
OIIO::TypeDesc data_format);
114
115
}
// namespace imbuf
116
}
// namespace blender
BLI_math_base_c.hh
BLI_sys_types.hh
IMB_imbuf.hh
IMB_imbuf_types.hh
blender::Vector
Definition
BLI_vector.hh:76
blender::imbuf
Definition
IMB_imbuf.hh:32
blender::imbuf::imb_oiio_write
bool imb_oiio_write(const WriteContext &ctx, const char *filepath, const ImageSpec &file_spec)
Definition
openimageio_support.cc:381
blender::imbuf::imb_oiio_read
ImBuf * imb_oiio_read(const ReadContext &ctx, const ImageSpec &config, ImFileColorSpace &r_colorspace, ImageSpec &r_newspec)
Definition
openimageio_support.cc:304
blender::imbuf::imb_oiio_check
bool imb_oiio_check(const uchar *mem, size_t mem_size, const char *file_format)
Definition
openimageio_support.cc:294
blender::imbuf::imb_create_write_spec
ImageSpec imb_create_write_spec(const WriteContext &ctx, int file_channels, TypeDesc data_format)
Definition
openimageio_support.cc:488
blender::imbuf::imb_create_write_context
WriteContext imb_create_write_context(const char *file_format, const ImBuf *ibuf, ImBufFlags flags, bool prefer_float)
Definition
openimageio_support.cc:440
blender::imbuf::imb_oiio_write_buffer
Vector< uint8_t > imb_oiio_write_buffer(const WriteContext &ctx, const ImageSpec &file_spec)
Definition
openimageio_support.cc:409
blender
BMesh Iterators.
Definition
ANIM_action.hh:30
blender::uchar
unsigned char uchar
Definition
BKE_text.h:58
blender::ImBufFlags
ImBufFlags
Definition
IMB_imbuf_enums.h:17
blender::eImbFileType
eImbFileType
Definition
IMB_imbuf_enums.h:71
blender::ImBuf
Definition
IMB_imbuf_types.hh:171
blender::ImFileColorSpace
Definition
IMB_filetype.hh:82
blender::imbuf::ReadContext
Definition
openimageio_support.hh:31
blender::imbuf::ReadContext::use_metadata_colorspace
bool use_metadata_colorspace
Definition
openimageio_support.hh:42
blender::imbuf::ReadContext::flags
const ImBufFlags flags
Definition
openimageio_support.hh:36
blender::imbuf::ReadContext::file_type
const eImbFileType file_type
Definition
openimageio_support.hh:35
blender::imbuf::ReadContext::mem_size
const size_t mem_size
Definition
openimageio_support.hh:33
blender::imbuf::ReadContext::file_format
const char * file_format
Definition
openimageio_support.hh:34
blender::imbuf::ReadContext::use_all_planes
bool use_all_planes
Definition
openimageio_support.hh:39
blender::imbuf::ReadContext::mem_start
const uchar * mem_start
Definition
openimageio_support.hh:32
blender::imbuf::WriteContext
Definition
openimageio_support.hh:48
blender::imbuf::WriteContext::flags
ImBufFlags flags
Definition
openimageio_support.hh:51
blender::imbuf::WriteContext::ibuf
const ImBuf * ibuf
Definition
openimageio_support.hh:50
blender::imbuf::WriteContext::mem_span
OIIO::image_span< const std::byte > mem_span
Definition
openimageio_support.hh:53
blender::imbuf::WriteContext::mem_spec
OIIO::ImageSpec mem_spec
Definition
openimageio_support.hh:54
blender::imbuf::WriteContext::file_format
const char * file_format
Definition
openimageio_support.hh:49
Generated on
for Blender by
doxygen
1.18.0