Blender V4.3
BKE_image_format.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
11struct BlendDataReader;
12struct BlendWriter;
13struct ImbFormatOptions;
14struct ImageFormatData;
15struct ImBuf;
16struct Scene;
17
18/* Init/Copy/Free */
19
20void BKE_image_format_init(ImageFormatData *imf, const bool render);
21void BKE_image_format_copy(ImageFormatData *imf_dst, const ImageFormatData *imf_src);
23
24/* Updates the color space of the given image format based on its image type. This can be used to
25 * set a good default color space when the user changes the image type. See the implementation for
26 * more information on the logic. */
28
31
32/* File Paths */
33
34void BKE_image_path_from_imformat(char *filepath,
35 const char *base,
36 const char *relbase,
37 int frame,
38 const ImageFormatData *im_format,
39 bool use_ext,
40 bool use_frames,
41 const char *suffix);
42void BKE_image_path_from_imtype(char *filepath,
43 const char *base,
44 const char *relbase,
45 int frame,
46 char imtype,
47 bool use_ext,
48 bool use_frames,
49 const char *suffix);
50
55#define BKE_IMAGE_PATH_EXT_MAX 3
64 const char *r_ext[BKE_IMAGE_PATH_EXT_MAX]);
65int BKE_image_path_ext_from_imtype(const char imtype, const char *r_ext[BKE_IMAGE_PATH_EXT_MAX]);
66
68 size_t filepath_maxncpy,
69 const ImageFormatData *im_format);
70int BKE_image_path_ext_from_imtype_ensure(char *filepath, size_t filepath_maxncpy, char imtype);
71
72/* File Types */
73
74#define IMA_CHAN_FLAG_BW 1
75#define IMA_CHAN_FLAG_RGB 2
76#define IMA_CHAN_FLAG_RGBA 4
77
78char BKE_ftype_to_imtype(int ftype, const ImbFormatOptions *options);
79int BKE_imtype_to_ftype(char imtype, ImbFormatOptions *r_options);
80
81bool BKE_imtype_is_movie(char imtype);
82bool BKE_imtype_supports_compress(char imtype);
83bool BKE_imtype_supports_quality(char imtype);
84bool BKE_imtype_requires_linear_float(char imtype);
85char BKE_imtype_valid_channels(char imtype, bool write_file);
86char BKE_imtype_valid_depths(char imtype);
87
92char BKE_imtype_from_arg(const char *imtype_arg);
93
94/* Conversion between #ImBuf settings. */
95
96void BKE_image_format_from_imbuf(ImageFormatData *im_format, const ImBuf *imbuf);
97void BKE_image_format_to_imbuf(ImBuf *ibuf, const ImageFormatData *imf);
98
100
101/* Color Management */
102
105
106/* Image Output
107 *
108 * Initialize an image format that can be used for file writing, including
109 * color management settings from the scene. */
110
112 const Scene *scene_src,
113 const ImageFormatData *imf_src);
void BKE_image_format_free(ImageFormatData *imf)
void BKE_image_format_init(ImageFormatData *imf, const bool render)
char BKE_imtype_valid_channels(char imtype, bool write_file)
void BKE_image_format_init_for_write(ImageFormatData *imf, const Scene *scene_src, const ImageFormatData *imf_src)
void BKE_image_format_color_management_copy(ImageFormatData *imf, const ImageFormatData *imf_src)
void BKE_image_format_from_imbuf(ImageFormatData *im_format, const ImBuf *imbuf)
int BKE_image_path_ext_from_imformat(const ImageFormatData *im_format, const char *r_ext[BKE_IMAGE_PATH_EXT_MAX])
void BKE_image_path_from_imtype(char *filepath, const char *base, const char *relbase, int frame, char imtype, bool use_ext, bool use_frames, const char *suffix)
void BKE_image_format_blend_write(BlendWriter *writer, ImageFormatData *imf)
void BKE_image_format_blend_read_data(BlendDataReader *reader, ImageFormatData *imf)
int BKE_image_path_ext_from_imformat_ensure(char *filepath, size_t filepath_maxncpy, const ImageFormatData *im_format)
char BKE_imtype_from_arg(const char *imtype_arg)
char BKE_ftype_to_imtype(int ftype, const ImbFormatOptions *options)
void BKE_image_format_update_color_space_for_type(ImageFormatData *format)
#define BKE_IMAGE_PATH_EXT_MAX
int BKE_image_path_ext_from_imtype(const char imtype, const char *r_ext[BKE_IMAGE_PATH_EXT_MAX])
int BKE_image_path_ext_from_imtype_ensure(char *filepath, size_t filepath_maxncpy, char imtype)
bool BKE_imtype_supports_compress(char imtype)
void BKE_image_path_from_imformat(char *filepath, const char *base, const char *relbase, int frame, const ImageFormatData *im_format, bool use_ext, bool use_frames, const char *suffix)
void BKE_image_format_to_imbuf(ImBuf *ibuf, const ImageFormatData *imf)
bool BKE_imtype_supports_quality(char imtype)
void BKE_image_format_color_management_copy_from_scene(ImageFormatData *imf, const Scene *scene)
char BKE_imtype_valid_depths(char imtype)
int BKE_imtype_to_ftype(char imtype, ImbFormatOptions *r_options)
bool BKE_imtype_is_movie(char imtype)
bool BKE_image_format_is_byte(const ImageFormatData *imf)
bool BKE_imtype_requires_linear_float(char imtype)
void BKE_image_format_copy(ImageFormatData *imf_dst, const ImageFormatData *imf_src)
CCL_NAMESPACE_BEGIN struct Options options
format