Blender V4.5
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
10
11#include <cstddef>
12
13#include "BKE_path_templates.hh"
14
15struct BlendDataReader;
16struct BlendWriter;
17struct ID;
18struct ImbFormatOptions;
19struct ImageFormatData;
20struct ImBuf;
21struct Scene;
22struct RenderData;
23
24/* Init/Copy/Free */
25
26void BKE_image_format_init(ImageFormatData *imf, const bool render);
27void BKE_image_format_copy(ImageFormatData *imf_dst, const ImageFormatData *imf_src);
29
30/* Updates the color space of the given image format based on its image type. This can be used to
31 * set a good default color space when the user changes the image type. See the implementation for
32 * more information on the logic. */
34
37
38void BKE_image_format_set(ImageFormatData *imf, ID *owner_id, const char imtype);
39
40/* File Paths */
41
50 char *filepath,
51 const char *base,
52 const char *relbase,
53 const blender::bke::path_templates::VariableMap *template_variables,
54 int frame,
56 bool use_ext,
57 bool use_frames,
58 const char *suffix);
60 char *filepath,
61 const char *base,
62 const char *relbase,
63 const blender::bke::path_templates::VariableMap *template_variables,
64 int frame,
65 char imtype,
66 bool use_ext,
67 bool use_frames,
68 const char *suffix);
69
74#define BKE_IMAGE_PATH_EXT_MAX 3
83 const char *r_ext[BKE_IMAGE_PATH_EXT_MAX]);
84int BKE_image_path_ext_from_imtype(const char imtype, const char *r_ext[BKE_IMAGE_PATH_EXT_MAX]);
85
87 size_t filepath_maxncpy,
89int BKE_image_path_ext_from_imtype_ensure(char *filepath, size_t filepath_maxncpy, char imtype);
90
91/* File Types */
92
93#define IMA_CHAN_FLAG_BW 1
94#define IMA_CHAN_FLAG_RGB 2
95#define IMA_CHAN_FLAG_RGBA 4
96
97char BKE_ftype_to_imtype(int ftype, const ImbFormatOptions *options);
98int BKE_imtype_to_ftype(char imtype, ImbFormatOptions *r_options);
99
100bool BKE_imtype_is_movie(char imtype);
101bool BKE_imtype_supports_compress(char imtype);
102bool BKE_imtype_supports_quality(char imtype);
103bool BKE_imtype_requires_linear_float(char imtype);
104char BKE_imtype_valid_channels(char imtype);
105char BKE_imtype_valid_depths(char imtype);
106char BKE_imtype_valid_depths_with_video(char imtype, const ID *owner_id);
107char BKE_imtype_first_valid_depth(const char valid_depths);
108
113char BKE_imtype_from_arg(const char *imtype_arg);
114
115/* Conversion between #ImBuf settings. */
116
118void BKE_image_format_to_imbuf(ImBuf *ibuf, const ImageFormatData *imf);
119
121
122/* Color Management */
123
126
127/* Image Output
128 *
129 * Initialize an image format that can be used for file writing, including
130 * color management settings from the scene. */
131
133 const Scene *scene_src,
134 const ImageFormatData *imf_src);
void BKE_image_format_free(ImageFormatData *imf)
void BKE_image_format_init(ImageFormatData *imf, const bool render)
void BKE_image_format_init_for_write(ImageFormatData *imf, const Scene *scene_src, const ImageFormatData *imf_src)
blender::Vector< blender::bke::path_templates::Error > BKE_image_path_from_imtype(char *filepath, const char *base, const char *relbase, const blender::bke::path_templates::VariableMap *template_variables, int frame, char imtype, bool use_ext, bool use_frames, const char *suffix)
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)
char BKE_imtype_valid_channels(char imtype)
int BKE_image_path_ext_from_imformat(const ImageFormatData *im_format, const char *r_ext[BKE_IMAGE_PATH_EXT_MAX])
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)
void BKE_image_format_set(ImageFormatData *imf, ID *owner_id, const char imtype)
char BKE_imtype_first_valid_depth(const char valid_depths)
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)
blender::Vector< blender::bke::path_templates::Error > BKE_image_path_from_imformat(char *filepath, const char *base, const char *relbase, const blender::bke::path_templates::VariableMap *template_variables, 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)
char BKE_imtype_valid_depths_with_video(char imtype, const ID *owner_id)
Functions and classes for applying templates with variable expressions to filepaths.
CCL_NAMESPACE_BEGIN struct Options options
format
Definition DNA_ID.h:404
struct ImageFormatData im_format