Blender  V3.3
BKE_image_format.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 
4 #pragma once
5 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 struct BlendDataReader;
15 struct BlendWriter;
16 struct ImbFormatOptions;
17 struct ImageFormatData;
18 struct ImBuf;
19 struct Scene;
20 
21 /* Init/Copy/Free */
22 
23 void BKE_image_format_init(struct ImageFormatData *imf, const bool render);
24 void BKE_image_format_copy(struct ImageFormatData *imf_dst, const struct ImageFormatData *imf_src);
25 void BKE_image_format_free(struct ImageFormatData *imf);
26 
27 void BKE_image_format_blend_read_data(struct BlendDataReader *reader, struct ImageFormatData *imf);
28 void BKE_image_format_blend_write(struct BlendWriter *writer, struct ImageFormatData *imf);
29 
30 /* File Paths */
31 
32 void BKE_image_path_from_imformat(char *string,
33  const char *base,
34  const char *relbase,
35  int frame,
36  const struct ImageFormatData *im_format,
37  bool use_ext,
38  bool use_frames,
39  const char *suffix);
40 void BKE_image_path_from_imtype(char *string,
41  const char *base,
42  const char *relbase,
43  int frame,
44  char imtype,
45  bool use_ext,
46  bool use_frames,
47  const char *suffix);
48 int BKE_image_path_ensure_ext_from_imformat(char *string, const struct ImageFormatData *im_format);
49 int BKE_image_path_ensure_ext_from_imtype(char *string, char imtype);
50 
51 /* File Types */
52 
53 #define IMA_CHAN_FLAG_BW 1
54 #define IMA_CHAN_FLAG_RGB 2
55 #define IMA_CHAN_FLAG_ALPHA 4
56 
57 char BKE_ftype_to_imtype(int ftype, const struct ImbFormatOptions *options);
58 int BKE_imtype_to_ftype(char imtype, struct ImbFormatOptions *r_options);
59 
60 bool BKE_imtype_is_movie(char imtype);
61 bool BKE_imtype_supports_zbuf(char imtype);
62 bool BKE_imtype_supports_compress(char imtype);
63 bool BKE_imtype_supports_quality(char imtype);
64 bool BKE_imtype_requires_linear_float(char imtype);
65 char BKE_imtype_valid_channels(char imtype, bool write_file);
66 char BKE_imtype_valid_depths(char imtype);
67 
72 char BKE_imtype_from_arg(const char *arg);
73 
74 /* Conversion between ImBuf settings. */
75 
76 void BKE_image_format_from_imbuf(struct ImageFormatData *im_format, const struct ImBuf *imbuf);
77 void BKE_image_format_to_imbuf(struct ImBuf *ibuf, const struct ImageFormatData *imf);
78 
79 bool BKE_image_format_is_byte(const struct ImageFormatData *imf);
80 
81 /* Color Management */
82 
84  const struct ImageFormatData *imf_src);
86  const struct Scene *scene);
87 
88 /* Image Output
89  *
90  * Initialize an image format that can be used for file writing, including
91  * color management settings from the scene. */
92 
94  const struct Scene *scene_src,
95  const struct ImageFormatData *imf_src);
96 
97 #ifdef __cplusplus
98 }
99 #endif
void BKE_image_format_free(struct ImageFormatData *imf)
Definition: image_format.cc:52
void BKE_image_path_from_imformat(char *string, const char *base, const char *relbase, int frame, const struct ImageFormatData *im_format, bool use_ext, bool use_frames, const char *suffix)
char BKE_imtype_valid_channels(char imtype, bool write_file)
void BKE_image_format_blend_read_data(struct BlendDataReader *reader, struct ImageFormatData *imf)
Definition: image_format.cc:57
void BKE_image_format_copy(struct ImageFormatData *imf_dst, const struct ImageFormatData *imf_src)
void BKE_image_format_color_management_copy(struct ImageFormatData *imf, const struct ImageFormatData *imf_src)
void BKE_image_format_from_imbuf(struct ImageFormatData *im_format, const struct ImBuf *imbuf)
void BKE_image_format_to_imbuf(struct ImBuf *ibuf, const struct ImageFormatData *imf)
int BKE_image_path_ensure_ext_from_imformat(char *string, const struct ImageFormatData *im_format)
char BKE_imtype_from_arg(const char *arg)
void BKE_image_format_init(struct ImageFormatData *imf, const bool render)
Definition: image_format.cc:26
int BKE_image_path_ensure_ext_from_imtype(char *string, char imtype)
bool BKE_imtype_supports_compress(char imtype)
bool BKE_imtype_supports_zbuf(char imtype)
void BKE_image_path_from_imtype(char *string, const char *base, const char *relbase, int frame, char imtype, bool use_ext, bool use_frames, const char *suffix)
char BKE_ftype_to_imtype(int ftype, const struct ImbFormatOptions *options)
bool BKE_imtype_supports_quality(char imtype)
int BKE_imtype_to_ftype(char imtype, struct ImbFormatOptions *r_options)
Definition: image_format.cc:69
char BKE_imtype_valid_depths(char imtype)
bool BKE_imtype_is_movie(char imtype)
void BKE_image_format_color_management_copy_from_scene(struct ImageFormatData *imf, const struct Scene *scene)
void BKE_image_format_init_for_write(struct ImageFormatData *imf, const struct Scene *scene_src, const struct ImageFormatData *imf_src)
bool BKE_imtype_requires_linear_float(char imtype)
void BKE_image_format_blend_write(struct BlendWriter *writer, struct ImageFormatData *imf)
Definition: image_format.cc:62
bool BKE_image_format_is_byte(const struct ImageFormatData *imf)
CCL_NAMESPACE_BEGIN struct Options options
Scene scene