Blender
V3.3
|
#include <cstring>
#include "DNA_defaults.h"
#include "DNA_scene_types.h"
#include "BLI_path_util.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "IMB_colormanagement.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "BKE_colortools.h"
#include "BKE_image_format.h"
Go to the source code of this file.
char BKE_ftype_to_imtype | ( | const int | ftype, |
const ImbFormatOptions * | options | ||
) |
Definition at line 134 of file image_format.cc.
References IMB_FTYPE_BMP, IMB_FTYPE_IMAGIC, IMB_FTYPE_NONE, IMB_FTYPE_OPENEXR, IMB_FTYPE_PNG, IMB_FTYPE_TGA, options, 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, and RAWTGA.
void BKE_image_format_blend_read_data | ( | BlendDataReader * | reader, |
ImageFormatData * | imf | ||
) |
Definition at line 57 of file image_format.cc.
References BKE_color_managed_view_settings_blend_read_data(), and ImageFormatData::view_settings.
Referenced by ntreeBlendReadData(), and scene_blend_read_data().
void BKE_image_format_blend_write | ( | BlendWriter * | writer, |
ImageFormatData * | imf | ||
) |
Definition at line 62 of file image_format.cc.
References BKE_color_managed_view_settings_blend_write(), and ImageFormatData::view_settings.
Referenced by ntreeBlendWrite(), and scene_blend_write().
void BKE_image_format_color_management_copy | ( | ImageFormatData * | imf, |
const ImageFormatData * | imf_src | ||
) |
Definition at line 921 of file image_format.cc.
References BKE_color_managed_colorspace_settings_copy(), BKE_color_managed_display_settings_copy(), BKE_color_managed_view_settings_copy(), BKE_color_managed_view_settings_free(), ImageFormatData::display_settings, ImageFormatData::linear_colorspace_settings, and ImageFormatData::view_settings.
void BKE_image_format_color_management_copy_from_scene | ( | ImageFormatData * | imf, |
const Scene * | scene | ||
) |
Definition at line 931 of file image_format.cc.
References BKE_color_managed_display_settings_copy(), BKE_color_managed_view_settings_copy(), BKE_color_managed_view_settings_free(), COLOR_ROLE_SCENE_LINEAR, ImageFormatData::display_settings, Scene::display_settings, IMB_colormanagement_role_colorspace_name_get(), ImageFormatData::linear_colorspace_settings, ColorManagedColorspaceSettings::name, scene, STRNCPY, ImageFormatData::view_settings, and Scene::view_settings.
void BKE_image_format_copy | ( | ImageFormatData * | imf_dst, |
const ImageFormatData * | imf_src | ||
) |
Definition at line 43 of file image_format.cc.
References BKE_color_managed_colorspace_settings_copy(), BKE_color_managed_display_settings_copy(), BKE_color_managed_view_settings_copy(), ImageFormatData::display_settings, ImageFormatData::linear_colorspace_settings, and ImageFormatData::view_settings.
void BKE_image_format_free | ( | ImageFormatData * | imf | ) |
Definition at line 52 of file image_format.cc.
References BKE_color_managed_view_settings_free(), and ImageFormatData::view_settings.
Referenced by BKE_image_render_write(), BKE_image_save_options_free(), blender::nodes::node_composite_output_file_cc::free_output_file(), RE_WriteRenderViewsMovie(), scene_free_data(), and blender::compositor::OutputSingleLayerOperation::~OutputSingleLayerOperation().
void BKE_image_format_from_imbuf | ( | ImageFormatData * | im_format, |
const ImBuf * | imbuf | ||
) |
Definition at line 776 of file image_format.cc.
References BKE_image_format_init(), BLI_assert_msg, ImageFormatData::compress, ImageFormatData::depth, ImageFormatData::exr_codec, ImbFormatOptions::flag, ImageFormatData::flag, ImBuf::foptions, ImBuf::ftype, IMB_FTYPE_BMP, IMB_FTYPE_IMAGIC, IMB_FTYPE_OPENEXR, IMB_FTYPE_PNG, IMB_FTYPE_TGA, ImageFormatData::imtype, ImageFormatData::jp2_codec, ImageFormatData::jp2_flag, OPENEXR_COMPRESS, OPENEXR_HALF, ImBuf::planes, ImageFormatData::planes, PNG_16BIT, ImbFormatOptions::quality, ImageFormatData::quality, R_IMF_CHAN_DEPTH_12, R_IMF_CHAN_DEPTH_16, R_IMF_EXR_CODEC_ZIP, R_IMF_FLAG_ZBUF, 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, ImageFormatData::tiff_codec, and ImBuf::zbuf_float.
void BKE_image_format_init | ( | ImageFormatData * | imf, |
const bool | render | ||
) |
Definition at line 26 of file image_format.cc.
References BKE_color_managed_colorspace_settings_init(), BKE_color_managed_display_settings_init(), BKE_color_managed_view_settings_init_default(), BKE_color_managed_view_settings_init_render(), ImageFormatData::display_settings, DNA_struct_default_get, ImageFormatData::linear_colorspace_settings, and ImageFormatData::view_settings.
Referenced by BKE_image_format_from_imbuf(), BKE_image_save_options_init(), blender::nodes::node_composite_output_file_cc::init_output_file(), ntreeCompositOutputFileAddSocket(), scene_init_data(), and screenshot_data_create().
void BKE_image_format_init_for_write | ( | ImageFormatData * | imf, |
const Scene * | scene_src, | ||
const ImageFormatData * | imf_src | ||
) |
Definition at line 943 of file image_format.cc.
References BKE_color_managed_colorspace_settings_copy(), BKE_color_managed_display_settings_copy(), BKE_color_managed_view_settings_copy(), ImageFormatData::color_management, COLOR_ROLE_SCENE_LINEAR, ImageFormatData::display_settings, Scene::display_settings, if(), RenderData::im_format, IMB_colormanagement_role_colorspace_name_get(), ImageFormatData::linear_colorspace_settings, ColorManagedColorspaceSettings::name, Scene::r, R_IMF_COLOR_MANAGEMENT_OVERRIDE, STRNCPY, ImageFormatData::view_settings, and Scene::view_settings.
bool BKE_image_format_is_byte | ( | const ImageFormatData * | imf | ) |
Definition at line 914 of file image_format.cc.
References BKE_imtype_valid_depths(), ImageFormatData::depth, ImageFormatData::imtype, and R_IMF_CHAN_DEPTH_8.
void BKE_image_format_to_imbuf | ( | ImBuf * | ibuf, |
const ImageFormatData * | imf | ||
) |
Definition at line 607 of file image_format.cc.
References BLI_assert_msg, ImageFormatData::cineon_flag, ImageFormatData::compress, ImageFormatData::depth, ELEM, ImageFormatData::exr_codec, ImbFormatOptions::flag, ImageFormatData::flag, ImBuf::foptions, ImBuf::ftype, IMB_freezbuffloatImBuf(), IMB_FTYPE_BMP, IMB_FTYPE_IMAGIC, IMB_FTYPE_JPG, IMB_FTYPE_OPENEXR, IMB_FTYPE_PNG, IMB_FTYPE_TGA, ImageFormatData::imtype, ImageFormatData::jp2_codec, ImageFormatData::jp2_flag, OPENEXR_COMPRESS, OPENEXR_HALF, PNG_16BIT, ImbFormatOptions::quality, ImageFormatData::quality, R_IMF_CHAN_DEPTH_10, R_IMF_CHAN_DEPTH_12, R_IMF_CHAN_DEPTH_16, R_IMF_CINEON_FLAG_LOG, R_IMF_FLAG_ZBUF, R_IMF_IMTYPE_BMP, R_IMF_IMTYPE_CINEON, R_IMF_IMTYPE_DDS, R_IMF_IMTYPE_DPX, R_IMF_IMTYPE_FFMPEG, R_IMF_IMTYPE_H264, R_IMF_IMTYPE_IRIS, R_IMF_IMTYPE_JP2, R_IMF_IMTYPE_MULTILAYER, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_PNG, R_IMF_IMTYPE_RADHDR, R_IMF_IMTYPE_RAWTGA, R_IMF_IMTYPE_TARGA, R_IMF_IMTYPE_THEORA, R_IMF_IMTYPE_TIFF, R_IMF_IMTYPE_WEBP, R_IMF_IMTYPE_XVID, 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, and ImageFormatData::tiff_codec.
int BKE_image_path_ensure_ext_from_imformat | ( | char * | string, |
const ImageFormatData * | im_format | ||
) |
Definition at line 541 of file image_format.cc.
References do_add_image_extension(), and ImageFormatData::imtype.
int BKE_image_path_ensure_ext_from_imtype | ( | char * | string, |
const char | imtype | ||
) |
Definition at line 546 of file image_format.cc.
References do_add_image_extension().
Referenced by dynamicPaint_outputSurfaceImage(), and unpack_generate_paths().
void BKE_image_path_from_imformat | ( | char * | string, |
const char * | base, | ||
const char * | relbase, | ||
int | frame, | ||
const ImageFormatData * | im_format, | ||
const bool | use_ext, | ||
const bool | use_frames, | ||
const char * | suffix | ||
) |
Definition at line 580 of file image_format.cc.
References do_makepicstring(), and ImageFormatData::imtype.
void BKE_image_path_from_imtype | ( | char * | string, |
const char * | base, | ||
const char * | relbase, | ||
int | frame, | ||
const char | imtype, | ||
const bool | use_ext, | ||
const bool | use_frames, | ||
const char * | suffix | ||
) |
Definition at line 593 of file image_format.cc.
References do_makepicstring().
Referenced by bake_targets_output_external(), blender::compositor::OutputOpenExrSingleLayerMultiViewOperation::deinit_execution(), blender::compositor::OutputOpenExrMultiLayerMultiViewOperation::deinit_execution(), and blender::compositor::OutputOpenExrMultiLayerOperation::deinit_execution().
char BKE_imtype_from_arg | ( | const char * | arg | ) |
String is from command line --render-format
argument, keep in sync with creator_args.c
help info.
Definition at line 321 of file image_format.cc.
References R_IMF_IMTYPE_AVIJPEG, R_IMF_IMTYPE_AVIRAW, R_IMF_IMTYPE_BMP, R_IMF_IMTYPE_CINEON, R_IMF_IMTYPE_DDS, R_IMF_IMTYPE_DPX, R_IMF_IMTYPE_FFMPEG, R_IMF_IMTYPE_INVALID, R_IMF_IMTYPE_IRIS, R_IMF_IMTYPE_IRIZ, R_IMF_IMTYPE_JP2, R_IMF_IMTYPE_JPEG90, R_IMF_IMTYPE_MULTILAYER, 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, and STREQ.
Referenced by arg_handle_image_type_set().
bool BKE_imtype_is_movie | ( | const char | imtype | ) |
Definition at line 195 of file image_format.cc.
References R_IMF_IMTYPE_AVIJPEG, R_IMF_IMTYPE_AVIRAW, R_IMF_IMTYPE_FFMPEG, R_IMF_IMTYPE_H264, R_IMF_IMTYPE_THEORA, and R_IMF_IMTYPE_XVID.
Referenced by BKE_scene_multiview_num_videos_get(), do_write_image_or_movie(), blender::nodes::node_composite_output_file_cc::init_output_file(), ntreeCompositOutputFileAddSocket(), RE_InitState(), RE_RenderAnim(), RE_RenderFrame(), screen_opengl_render_anim_init(), screen_opengl_render_anim_step(), screen_opengl_render_end(), screen_opengl_render_init(), screen_render_exec(), screen_render_invoke(), and write_result().
bool BKE_imtype_requires_linear_float | ( | const char | imtype | ) |
Definition at line 240 of file image_format.cc.
References R_IMF_IMTYPE_CINEON, R_IMF_IMTYPE_DPX, R_IMF_IMTYPE_MULTILAYER, R_IMF_IMTYPE_OPENEXR, and R_IMF_IMTYPE_RADHDR.
Referenced by BKE_image_save_options_update(), image_save_post(), IMB_colormanagement_imbuf_for_write(), and uiTemplateImageSettings().
bool BKE_imtype_supports_compress | ( | const char | imtype | ) |
Definition at line 219 of file image_format.cc.
References R_IMF_IMTYPE_PNG.
Referenced by uiTemplateImageSettings().
bool BKE_imtype_supports_quality | ( | const char | imtype | ) |
Definition at line 228 of file image_format.cc.
References R_IMF_IMTYPE_AVIJPEG, R_IMF_IMTYPE_JP2, R_IMF_IMTYPE_JPEG90, and R_IMF_IMTYPE_WEBP.
Referenced by uiTemplateImageSettings().
bool BKE_imtype_supports_zbuf | ( | const char | imtype | ) |
Definition at line 209 of file image_format.cc.
References R_IMF_IMTYPE_IRIZ, and R_IMF_IMTYPE_OPENEXR.
Referenced by uiTemplateImageSettings().
int BKE_imtype_to_ftype | ( | const char | imtype, |
ImbFormatOptions * | r_options | ||
) |
Definition at line 69 of file image_format.cc.
References ELEM, ImbFormatOptions::flag, IMB_FTYPE_BMP, IMB_FTYPE_IMAGIC, IMB_FTYPE_JPG, IMB_FTYPE_OPENEXR, IMB_FTYPE_PNG, IMB_FTYPE_TGA, ImbFormatOptions::quality, 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_MULTILAYER, 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, and RAWTGA.
Referenced by BKE_image_buffer_format_writable().
char BKE_imtype_valid_channels | ( | const char | imtype, |
bool | write_file | ||
) |
Definition at line 253 of file image_format.cc.
References ATTR_FALLTHROUGH, IMA_CHAN_FLAG_ALPHA, IMA_CHAN_FLAG_BW, IMA_CHAN_FLAG_RGB, R_IMF_IMTYPE_BMP, R_IMF_IMTYPE_DDS, R_IMF_IMTYPE_DPX, R_IMF_IMTYPE_IRIS, R_IMF_IMTYPE_JP2, R_IMF_IMTYPE_JPEG90, R_IMF_IMTYPE_MULTILAYER, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_PNG, R_IMF_IMTYPE_RAWTGA, R_IMF_IMTYPE_TARGA, R_IMF_IMTYPE_TIFF, and R_IMF_IMTYPE_WEBP.
char BKE_imtype_valid_depths | ( | const char | imtype | ) |
Definition at line 295 of file image_format.cc.
References R_IMF_CHAN_DEPTH_10, R_IMF_CHAN_DEPTH_12, R_IMF_CHAN_DEPTH_16, R_IMF_CHAN_DEPTH_32, R_IMF_CHAN_DEPTH_8, R_IMF_IMTYPE_CINEON, R_IMF_IMTYPE_DPX, R_IMF_IMTYPE_JP2, R_IMF_IMTYPE_MULTILAYER, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_PNG, R_IMF_IMTYPE_RADHDR, and R_IMF_IMTYPE_TIFF.
Referenced by BKE_image_format_is_byte(), imtype_best_depth(), RE_render_result_rect_to_ibuf(), and uiTemplateImageSettings().
|
static |
Definition at line 406 of file image_format.cc.
References BLI_assert_msg, BLI_path_extension_check(), BLI_path_extension_check_array(), BLI_path_extension_check_n(), BLI_path_extension_ensure(), BLI_path_extension_replace(), ELEM, FILE_MAX, imb_ext_image, ImageFormatData::jp2_codec, R_IMF_IMTYPE_BMP, R_IMF_IMTYPE_CINEON, R_IMF_IMTYPE_DDS, R_IMF_IMTYPE_DPX, R_IMF_IMTYPE_FFMPEG, R_IMF_IMTYPE_H264, R_IMF_IMTYPE_IRIS, R_IMF_IMTYPE_IRIZ, R_IMF_IMTYPE_JP2, R_IMF_IMTYPE_MULTILAYER, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_PNG, R_IMF_IMTYPE_PSD, R_IMF_IMTYPE_RADHDR, R_IMF_IMTYPE_RAWTGA, R_IMF_IMTYPE_TARGA, R_IMF_IMTYPE_THEORA, R_IMF_IMTYPE_TIFF, R_IMF_IMTYPE_WEBP, R_IMF_IMTYPE_XVID, R_IMF_JP2_CODEC_J2K, R_IMF_JP2_CODEC_JP2, and void.
Referenced by BKE_image_path_ensure_ext_from_imformat(), BKE_image_path_ensure_ext_from_imtype(), and do_makepicstring().
|
static |
Definition at line 551 of file image_format.cc.
References BLI_path_abs(), BLI_path_frame(), BLI_path_suffix(), BLI_strncpy(), do_add_image_extension(), and FILE_MAX.
Referenced by BKE_image_path_from_imformat(), and BKE_image_path_from_imtype().