Blender V5.0
BKE_image_format.hh File Reference
#include <cstddef>
#include "BKE_path_templates.hh"

Go to the source code of this file.

Macros

#define BKE_IMAGE_PATH_EXT_MAX   3
#define IMA_CHAN_FLAG_BW   1
#define IMA_CHAN_FLAG_RGB   2
#define IMA_CHAN_FLAG_RGBA   4

Functions

void BKE_image_format_init (ImageFormatData *imf)
void BKE_image_format_copy (ImageFormatData *imf_dst, const ImageFormatData *imf_src)
void BKE_image_format_free (ImageFormatData *imf)
void BKE_image_format_update_color_space_for_type (ImageFormatData *format)
void BKE_image_format_blend_read_data (BlendDataReader *reader, ImageFormatData *imf)
void BKE_image_format_blend_write (BlendWriter *writer, ImageFormatData *imf)
void BKE_image_format_media_type_set (ImageFormatData *format, ID *owner_id, const MediaType media_type)
void BKE_image_format_set (ImageFormatData *imf, ID *owner_id, const char imtype)
blender::Vector< blender::bke::path_templates::ErrorBKE_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)
blender::Vector< blender::bke::path_templates::ErrorBKE_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)
int BKE_image_path_ext_from_imformat (const ImageFormatData *im_format, const char *r_ext[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_imformat_ensure (char *filepath, size_t filepath_maxncpy, const ImageFormatData *im_format)
int BKE_image_path_ext_from_imtype_ensure (char *filepath, size_t filepath_maxncpy, char imtype)
char BKE_ftype_to_imtype (int ftype, const ImbFormatOptions *options)
int BKE_imtype_to_ftype (char imtype, ImbFormatOptions *r_options)
bool BKE_imtype_is_image (char imtype)
bool BKE_imtype_is_multi_layer_image (char imtype)
bool BKE_imtype_is_movie (char imtype)
bool BKE_imtype_supports_compress (char imtype)
bool BKE_imtype_supports_quality (char imtype)
bool BKE_imtype_requires_linear_float (char imtype)
char BKE_imtype_valid_channels (char imtype)
char BKE_imtype_valid_depths (char imtype)
char BKE_imtype_valid_depths_with_video (char imtype, const ID *owner_id)
char BKE_imtype_first_valid_depth (const char valid_depths)
char BKE_imtype_from_arg (const char *imtype_arg)
void BKE_image_format_from_imbuf (ImageFormatData *im_format, const ImBuf *imbuf)
void BKE_image_format_to_imbuf (ImBuf *ibuf, const ImageFormatData *imf)
bool BKE_image_format_is_byte (const ImageFormatData *imf)
void BKE_image_format_color_management_copy (ImageFormatData *imf, const ImageFormatData *imf_src)
void BKE_image_format_color_management_copy_from_scene (ImageFormatData *imf, const Scene *scene)
void BKE_image_format_init_for_write (ImageFormatData *imf, const Scene *scene_src, const ImageFormatData *imf_src, const bool allow_video=false)

Macro Definition Documentation

◆ BKE_IMAGE_PATH_EXT_MAX

#define BKE_IMAGE_PATH_EXT_MAX   3

The number of extensions an image may have (.jpg, .jpeg for example). Add 1 as the array is nil terminated.

Definition at line 79 of file BKE_image_format.hh.

Referenced by BKE_image_path_ext_from_imformat(), BKE_image_path_ext_from_imtype(), blender::io::hydra::cache_image_file(), do_ensure_image_extension(), and image_path_ext_from_imformat_impl().

◆ IMA_CHAN_FLAG_BW

#define IMA_CHAN_FLAG_BW   1

Definition at line 98 of file BKE_image_format.hh.

Referenced by BKE_image_format_set(), and BKE_imtype_valid_channels().

◆ IMA_CHAN_FLAG_RGB

#define IMA_CHAN_FLAG_RGB   2

Definition at line 99 of file BKE_image_format.hh.

Referenced by BKE_imtype_valid_channels().

◆ IMA_CHAN_FLAG_RGBA

#define IMA_CHAN_FLAG_RGBA   4

Definition at line 100 of file BKE_image_format.hh.

Referenced by BKE_image_format_set(), and BKE_imtype_valid_channels().

Function Documentation

◆ BKE_ftype_to_imtype()

◆ BKE_image_format_blend_read_data()

◆ BKE_image_format_blend_write()

◆ BKE_image_format_color_management_copy()

◆ BKE_image_format_color_management_copy_from_scene()

◆ BKE_image_format_copy()

◆ BKE_image_format_free()

◆ BKE_image_format_from_imbuf()

void BKE_image_format_from_imbuf ( ImageFormatData * im_format,
const ImBuf * imbuf )

Definition at line 923 of file image_format.cc.

References BKE_image_format_init(), BLI_assert_msg, ImageFormatData::compress, ImageFormatData::depth, ELEM, ImageFormatData::exr_codec, ImageFormatData::exr_flag, ImbFormatOptions::flag, ImBuf::foptions, ImBuf::ftype, IMB_FTYPE_BMP, IMB_FTYPE_DDS, IMB_FTYPE_IRIS, IMB_FTYPE_OPENEXR, IMB_FTYPE_PNG, IMB_FTYPE_RADHDR, IMB_FTYPE_TGA, IMB_FTYPE_TIF, ImageFormatData::imtype, imtype_best_depth(), ImageFormatData::jp2_codec, ImageFormatData::jp2_flag, ImageFormatData::media_type, MEDIA_TYPE_IMAGE, OPENEXR_CODEC_MASK, OPENEXR_HALF, OPENEXR_MULTIPART, ImageFormatData::planes, ImBuf::planes, PNG_16BIT, ImageFormatData::quality, ImbFormatOptions::quality, R_IMF_CHAN_DEPTH_12, R_IMF_CHAN_DEPTH_16, R_IMF_EXR_CODEC_B44, R_IMF_EXR_CODEC_B44A, R_IMF_EXR_CODEC_MAX, R_IMF_EXR_CODEC_ZIP, R_IMF_EXR_FLAG_MULTIPART, R_IMF_IMTYPE_BMP, R_IMF_IMTYPE_CINEON, R_IMF_IMTYPE_DDS, R_IMF_IMTYPE_DPX, R_IMF_IMTYPE_IRIS, R_IMF_IMTYPE_JP2, R_IMF_IMTYPE_JPEG90, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_PNG, R_IMF_IMTYPE_RADHDR, R_IMF_IMTYPE_RAWTGA, R_IMF_IMTYPE_TARGA, R_IMF_IMTYPE_TIFF, R_IMF_IMTYPE_WEBP, R_IMF_JP2_CODEC_J2K, R_IMF_JP2_CODEC_JP2, R_IMF_JP2_FLAG_CINE_48, R_IMF_JP2_FLAG_CINE_PRESET, R_IMF_JP2_FLAG_YCC, R_IMF_TIFF_CODEC_DEFLATE, R_IMF_TIFF_CODEC_LZW, R_IMF_TIFF_CODEC_NONE, R_IMF_TIFF_CODEC_PACKBITS, RAWTGA, TIF_16BIT, TIF_COMPRESS_DEFLATE, TIF_COMPRESS_LZW, TIF_COMPRESS_NONE, TIF_COMPRESS_PACKBITS, and ImageFormatData::tiff_codec.

Referenced by BKE_image_buffer_format_writable(), BKE_image_save_options_init(), blender::io::usd::export_in_memory_imbuf(), and blender::io::usd::get_in_memory_texture_filename().

◆ BKE_image_format_init()

◆ BKE_image_format_init_for_write()

◆ BKE_image_format_is_byte()

bool BKE_image_format_is_byte ( const ImageFormatData * imf)

◆ BKE_image_format_media_type_set()

◆ BKE_image_format_set()

◆ BKE_image_format_to_imbuf()

void BKE_image_format_to_imbuf ( ImBuf * ibuf,
const ImageFormatData * imf )

◆ BKE_image_format_update_color_space_for_type()

◆ BKE_image_path_ext_from_imformat()

int BKE_image_path_ext_from_imformat ( const ImageFormatData * im_format,
const char * r_ext[BKE_IMAGE_PATH_EXT_MAX] )

Fill in an array of acceptable image extensions for the image format.

Note
In the case a file has no valid extension, the first extension should be used (r_ext[0]).
Returns
the number of extensions assigned to r_ext, 0 for unsupported formats.

Definition at line 593 of file image_format.cc.

References BKE_IMAGE_PATH_EXT_MAX, image_path_ext_from_imformat_impl(), and ImageFormatData::imtype.

Referenced by blender::io::hydra::cache_image_file().

◆ BKE_image_path_ext_from_imformat_ensure()

int BKE_image_path_ext_from_imformat_ensure ( char * filepath,
size_t filepath_maxncpy,
const ImageFormatData * im_format )

◆ BKE_image_path_ext_from_imtype()

int BKE_image_path_ext_from_imtype ( const char imtype,
const char * r_ext[BKE_IMAGE_PATH_EXT_MAX] )

Definition at line 599 of file image_format.cc.

References BKE_IMAGE_PATH_EXT_MAX, and image_path_ext_from_imformat_impl().

◆ BKE_image_path_ext_from_imtype_ensure()

int BKE_image_path_ext_from_imtype_ensure ( char * filepath,
size_t filepath_maxncpy,
char imtype )

◆ BKE_image_path_from_imformat()

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 )
Parameters
template_variablesthe map of variables to use for template substitution. Optional: if null, template substitution will not be performed.
Returns
If any template errors are encountered, returns those errors. On success, returns an empty Vector.

Definition at line 680 of file image_format.cc.

References do_makepicstring(), and ImageFormatData::imtype.

Referenced by blender::nodes::node_composite_file_output_cc::compute_image_path(), do_write_image_or_movie(), RE_RenderAnim(), RE_RenderFrame(), screen_opengl_render_anim_step(), screen_opengl_render_write(), and write_result().

◆ BKE_image_path_from_imtype()

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 )

Definition at line 703 of file image_format.cc.

References do_makepicstring().

Referenced by blender::ed::object::bake_targets_output_external().

◆ BKE_imtype_first_valid_depth()

char BKE_imtype_first_valid_depth ( const char valid_depths)

◆ BKE_imtype_from_arg()

◆ BKE_imtype_is_image()

bool BKE_imtype_is_image ( char imtype)

◆ BKE_imtype_is_movie()

◆ BKE_imtype_is_multi_layer_image()

bool BKE_imtype_is_multi_layer_image ( char imtype)

◆ BKE_imtype_requires_linear_float()

◆ BKE_imtype_supports_compress()

bool BKE_imtype_supports_compress ( char imtype)

Definition at line 308 of file image_format.cc.

References R_IMF_IMTYPE_PNG.

Referenced by uiTemplateImageSettings().

◆ BKE_imtype_supports_quality()

bool BKE_imtype_supports_quality ( char imtype)

Definition at line 317 of file image_format.cc.

References R_IMF_IMTYPE_JP2, R_IMF_IMTYPE_JPEG90, and R_IMF_IMTYPE_WEBP.

Referenced by uiTemplateImageSettings().

◆ BKE_imtype_to_ftype()

◆ BKE_imtype_valid_channels()

◆ BKE_imtype_valid_depths()

◆ BKE_imtype_valid_depths_with_video()

char BKE_imtype_valid_depths_with_video ( char imtype,
const ID * owner_id )