|
Blender V4.3
|
#include <cerrno>#include <cstring>#include "BLI_fileops.h"#include "BLI_index_range.hh"#include "BLI_listbase.h"#include "BLI_path_utils.hh"#include "BLI_string.h"#include "BLI_task.hh"#include "BLI_vector.hh"#include "BLT_translation.hh"#include "DNA_image_types.h"#include "MEM_guardedalloc.h"#include "IMB_colormanagement.hh"#include "IMB_imbuf.hh"#include "IMB_imbuf_types.hh"#include "IMB_openexr.hh"#include "BKE_colortools.hh"#include "BKE_global.hh"#include "BKE_image.hh"#include "BKE_image_format.hh"#include "BKE_image_save.hh"#include "BKE_main.hh"#include "BKE_report.hh"#include "BKE_scene.hh"#include "RE_pipeline.h"Go to the source code of this file.
Functions | |
| static char | imtype_best_depth (ImBuf *ibuf, const char imtype) |
| bool | BKE_image_save_options_init (ImageSaveOptions *opts, Main *bmain, Scene *scene, Image *ima, ImageUser *iuser, const bool guess_path, const bool save_as_render) |
| void | BKE_image_save_options_update (ImageSaveOptions *opts, const Image *image) |
| void | BKE_image_save_options_free (ImageSaveOptions *opts) |
| static void | image_save_update_filepath (Image *ima, const char *filepath, const ImageSaveOptions *opts) |
| static void | image_save_post (ReportList *reports, Image *ima, ImBuf *ibuf, int ok, const ImageSaveOptions *opts, const bool save_copy, const char *filepath, bool *r_colorspace_changed) |
| static void | imbuf_save_post (ImBuf *ibuf, ImBuf *colormanaged_ibuf) |
| static bool | image_save_single (ReportList *reports, Image *ima, ImageUser *iuser, const ImageSaveOptions *opts, bool *r_colorspace_changed) |
| bool | BKE_image_save (ReportList *reports, Main *bmain, Image *ima, ImageUser *iuser, const ImageSaveOptions *opts) |
| static float * | image_exr_from_scene_linear_to_output (float *rect, const int width, const int height, const int channels, const ImageFormatData *imf, Vector< float * > &tmp_output_rects) |
| static float * | image_exr_from_rgb_to_bw (float *input_buffer, int width, int height, int channels, Vector< float * > &temporary_buffers) |
| static float * | image_exr_opaque_alpha_buffer (int width, int height, Vector< float * > &temporary_buffers) |
| static void | add_exr_compositing_result (void *exr_handle, const RenderResult *render_result, const ImageFormatData *imf, bool save_as_render, const char *view_name, int layer, Vector< float * > &temporary_buffers) |
| bool | BKE_image_render_write_exr (ReportList *reports, const RenderResult *rr, const char *filepath, const ImageFormatData *imf, const bool save_as_render, const char *view, int layer) |
| static void | image_render_print_save_message (ReportList *reports, const char *filepath, int ok, int err) |
| static bool | image_render_write_stamp_test (ReportList *reports, const Scene *scene, const RenderResult *rr, ImBuf *ibuf, const char *filepath, const ImageFormatData *imf, const bool stamp) |
| bool | BKE_image_render_write (ReportList *reports, RenderResult *rr, const Scene *scene, const bool stamp, const char *filepath_basis, const ImageFormatData *format, bool save_as_render) |
|
static |
Definition at line 734 of file image_save.cc.
References ImageFormatData::depth, EXR_PASS_MAXNAME, RenderResult::have_combined, image_exr_from_rgb_to_bw(), image_exr_from_scene_linear_to_output(), IMB_exr_add_channel(), ImageFormatData::imtype, LISTBASE_FOREACH, ImageFormatData::planes, R_IMF_CHAN_DEPTH_16, R_IMF_IMTYPE_OPENEXR, RE_render_result_full_channel_name(), RenderResult::rectx, RenderResult::recty, STREQ, and RenderResult::views.
Referenced by BKE_image_render_write_exr().
| bool BKE_image_render_write | ( | ReportList * | reports, |
| RenderResult * | rr, | ||
| const Scene * | scene, | ||
| const bool | stamp, | ||
| const char * | filepath_basis, | ||
| const ImageFormatData * | format = nullptr, | ||
| bool | save_as_render = true ) |
| filepath_basis | May be used as-is, or used as a basis for multi-view images. |
| format | The image format to use for saving, if null, the scene format will be used. |
Definition at line 1064 of file image_save.cc.
References BKE_color_managed_colorspace_settings_copy(), BKE_image_format_free(), BKE_image_format_init_for_write(), BKE_image_path_ext_from_imformat_ensure(), BKE_image_render_write_exr(), BKE_scene_multiview_view_filepath_get(), BLI_assert, BLI_findstringindex(), BLI_listbase_count_at_most(), BLI_path_extension_check(), ImageFormatData::depth, ELEM, FILE_MAX, ListBase::first, ImageFormatData::flag, image_render_print_save_message(), image_render_write_stamp_test(), IMB_colormanagement_imbuf_for_write(), IMB_freeImBuf(), IMB_stereo3d_ImBuf(), ImageFormatData::imtype, ImageFormatData::linear_colorspace_settings, offsetof, ImBuf::planes, printf, R_IMF_CHAN_DEPTH_8, R_IMF_FLAG_PREVIEW_JPG, R_IMF_IMTYPE_JPEG90, R_IMF_IMTYPE_MULTILAYER, R_IMF_IMTYPE_OPENEXR, R_IMF_VIEWS_INDIVIDUAL, R_IMF_VIEWS_MULTIVIEW, R_IMF_VIEWS_STEREO_3D, RE_HasFloatPixels(), RE_render_result_rect_to_ibuf(), STEREO_LEFT_NAME, STEREO_RIGHT_NAME, STRNCPY, RenderResult::views, and ImageFormatData::views_format.
Referenced by do_write_image_or_movie(), blender::realtime_compositor::FileOutput::save(), screen_opengl_render_write(), and write_result().
| bool BKE_image_render_write_exr | ( | ReportList * | reports, |
| const RenderResult * | rr, | ||
| const char * | filepath, | ||
| const ImageFormatData * | imf, | ||
| const bool | save_as_render, | ||
| const char * | view, | ||
| int | layer ) |
Save single or multi-layer OpenEXR files from the render result. Optionally saves only a specific view or layer.
Definition at line 837 of file image_save.cc.
References add_exr_compositing_result(), BKE_reportf(), BLI_file_ensure_parent_dir_exists(), BLI_listbase_count_at_most(), ImageFormatData::depth, ImageFormatData::exr_codec, EXR_PASS_MAXNAME, ListBase::first, RenderResult::have_combined, image_exr_from_rgb_to_bw(), image_exr_from_scene_linear_to_output(), image_exr_opaque_alpha_buffer(), IMB_exr_add_channel(), IMB_exr_add_view(), IMB_exr_begin_write(), IMB_exr_close(), IMB_exr_get_handle(), IMB_exr_write_channels(), ImageFormatData::imtype, RenderResult::layers, LISTBASE_FOREACH, MEM_freeN(), RenderView::name, RenderView::next, ImageFormatData::planes, R_IMF_CHAN_DEPTH_16, R_IMF_IMTYPE_OPENEXR, RE_PASSNAME_COMBINED, RE_render_result_full_channel_name(), RE_RenderPassIsColor(), RenderResult::rectx, RenderResult::recty, RPT_ERROR, RenderResult::stamp_data, STR_ELEM, STREQ, STRNCPY, and RenderResult::views.
Referenced by BKE_image_render_write(), image_save_single(), and render_result_exr_file_cache_write().
| bool BKE_image_save | ( | ReportList * | reports, |
| Main * | bmain, | ||
| Image * | ima, | ||
| ImageUser * | iuser, | ||
| const ImageSaveOptions * | opts ) |
Definition at line 600 of file image_save.cc.
References BKE_image_get_tile_strformat(), BKE_image_set_filepath_from_tile_number(), BKE_image_signal(), BKE_imageuser_default(), BKE_reportf(), ImageSaveOptions::filepath, IMA_SIGNAL_COLORMANAGE, IMA_SRC_TILED, image_save_single(), image_save_update_filepath(), LISTBASE_FOREACH, MEM_freeN(), RPT_ERROR, ImageSaveOptions::scene, ImageUser::scene, Image::source, ImageUser::tile, tile, Image::tiles, and UDIM_TILE_FORMAT_NONE.
Referenced by blender::io::hydra::cache_image_file(), ED_image_save_all_modified(), blender::io::usd::process_usdz_textures(), and save_image_op().
| void BKE_image_save_options_free | ( | ImageSaveOptions * | opts | ) |
Definition at line 232 of file image_save.cc.
References BKE_image_format_free(), and ImageSaveOptions::im_format.
Referenced by blender::io::hydra::cache_image_file(), ED_image_save_all_modified(), image_save_as_free(), image_save_as_init(), image_save_exec(), and blender::io::usd::process_usdz_textures().
| bool BKE_image_save_options_init | ( | ImageSaveOptions * | opts, |
| Main * | bmain, | ||
| Scene * | scene, | ||
| Image * | ima, | ||
| ImageUser * | iuser, | ||
| const bool | guess_path, | ||
| const bool | save_as_render ) |
Definition at line 82 of file image_save.cc.
References BKE_image_acquire_ibuf(), BKE_image_format_color_management_copy_from_scene(), BKE_image_format_from_imbuf(), BKE_image_format_init(), BKE_image_format_init_for_write(), BKE_image_is_multiview(), BKE_image_release_ibuf(), BKE_image_user_file_path_ex(), BKE_imageuser_default(), BKE_main_blendfile_path(), BLI_path_abs(), BLI_path_join, BLI_path_make_safe(), ImageSaveOptions::bmain, ImageFormatData::color_management, COLOR_ROLE_DEFAULT_BYTE, Image::colorspace_settings, DATA_, ImageFormatData::depth, ELEM, ImageSaveOptions::filepath, G, Image::id, ImageSaveOptions::im_format, IMA_SRC_GENERATED, IMA_SRC_TILED, IMA_SRC_VIEWER, IMB_colormanagement_role_colorspace_name_get(), IMB_colormanagement_space_name_is_data(), ImageFormatData::imtype, imtype_best_depth(), len, ImageFormatData::linear_colorspace_settings, lock, ColorManagedColorspaceSettings::name, ID::name, ImageFormatData::planes, ImageSaveOptions::prev_imtype, ImageSaveOptions::prev_save_as_render, ImageFormatData::quality, R_IMF_COLOR_MANAGEMENT_FOLLOW_SCENE, R_IMF_PLANES_BW, R_IMF_PLANES_RGB, R_IMF_PLANES_RGBA, ImageSaveOptions::save_as_render, ImageSaveOptions::scene, ImageUser::scene, scene, Image::source, Image::stereo3d_format, ImageFormatData::stereo3d_format, STR_CONCAT, STREQ, STRNCPY, Image::views_format, and ImageFormatData::views_format.
Referenced by blender::io::hydra::cache_image_file(), ED_image_save_all_modified(), image_save_as_init(), image_save_exec(), and blender::io::usd::process_usdz_textures().
| void BKE_image_save_options_update | ( | ImageSaveOptions * | opts, |
| const Image * | image ) |
Definition at line 204 of file image_save.cc.
References BKE_color_managed_colorspace_settings_copy(), BKE_image_format_color_management_copy_from_scene(), BKE_image_format_init_for_write(), BKE_image_format_update_color_space_for_type(), ELEM, ImageSaveOptions::im_format, IMA_TYPE_COMPOSITE, IMA_TYPE_R_RESULT, ImageFormatData::imtype, ImageFormatData::linear_colorspace_settings, ImageSaveOptions::prev_imtype, ImageSaveOptions::prev_save_as_render, ImageSaveOptions::save_as_render, and ImageSaveOptions::scene.
Referenced by image_save_as_check(), and image_save_as_exec().
|
static |
Definition at line 693 of file image_save.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), IMB_colormanagement_get_luminance(), MEM_malloc_arrayN, blender::threading::parallel_for(), and x.
Referenced by add_exr_compositing_result(), and BKE_image_render_write_exr().
|
static |
Definition at line 666 of file image_save.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), COLOR_ROLE_SCENE_LINEAR, IMB_colormanagement_role_colorspace_name_get(), IMB_colormanagement_space_name_is_scene_linear(), IMB_colormanagement_transform(), ImageFormatData::linear_colorspace_settings, MEM_dupallocN, and ColorManagedColorspaceSettings::name.
Referenced by add_exr_compositing_result(), and BKE_image_render_write_exr().
|
static |
Definition at line 714 of file image_save.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), MEM_malloc_arrayN, blender::threading::parallel_for(), and x.
Referenced by BKE_image_render_write_exr().
|
static |
Definition at line 1023 of file image_save.cc.
References BKE_reportf(), G, printf, and RPT_ERROR.
Referenced by BKE_image_render_write(), and image_render_write_stamp_test().
|
static |
Definition at line 1041 of file image_save.cc.
References BKE_imbuf_write(), BKE_imbuf_write_stamp(), and image_render_print_save_message().
Referenced by BKE_image_render_write().
|
static |
Definition at line 252 of file image_save.cc.
References BKE_color_managed_colorspace_settings_copy(), BKE_color_managed_colorspace_settings_equals(), BKE_image_get_tile, BKE_imtype_requires_linear_float(), BKE_reportf(), Image::colorspace_settings, ImageSaveOptions::do_newpath, ELEM, ImBuf::filepath, ImageTile::gen_flag, ImageSaveOptions::im_format, IMA_SRC_FILE, IMA_SRC_GENERATED, IMA_SRC_TILED, IMA_SRC_VIEWER, IMA_TYPE_IMAGE, IMA_TYPE_R_RESULT, image_save_update_filepath(), imb_freerectfloatImBuf(), imb_freerectImBuf(), ImageFormatData::imtype, ImageFormatData::linear_colorspace_settings, ColorManagedColorspaceSettings::name, RPT_ERROR, ImageSaveOptions::save_as_render, Image::source, STRNCPY, Image::type, and ImBuf::userflags.
Referenced by image_save_single().
|
static |
ima->filepath and ibuf->filepath will reference the same path (although ima->filepath may be blend-file relative). ibuf is important to get the settings. Definition at line 334 of file image_save.cc.
References BKE_image_acquire_ibuf(), BKE_image_acquire_renderresult(), BKE_image_format_to_imbuf(), BKE_image_is_stereo(), BKE_image_multilayer_index(), BKE_image_multiview_index(), BKE_image_release_ibuf(), BKE_image_release_renderresult(), BKE_image_render_write_exr(), BKE_imageuser_default(), BKE_imbuf_alpha_test(), BKE_imbuf_stamp_info(), BKE_imbuf_write_as(), BKE_report(), BKE_reportf(), BKE_scene_multiview_view_filepath_get(), BLI_findlink(), BLI_findstring(), BLI_findstringindex(), BLI_listbase_count(), BLI_listbase_count_at_most(), ImBuf::byte_buffer, ImBufByteBuffer::data, ImBufFloatBuffer::data, ELEM, FILE_MAX, ImageSaveOptions::filepath, ImageUser::flag, ImBuf::float_buffer, IB_BITMAPDIRTY, ImageSaveOptions::im_format, IMA_TYPE_R_RESULT, image_save_post(), IMB_colormanagement_imbuf_for_write(), IMB_dupImBuf(), IMB_freeImBuf(), IMB_stereo3d_ImBuf(), imbuf_save_post(), ImageFormatData::imtype, ImageUser::layer, lock, offsetof, ImageFormatData::planes, ImBuf::planes, Scene::r, R_IMF_IMTYPE_MULTILAYER, R_IMF_IMTYPE_OPENEXR, R_IMF_PLANES_RGB, R_IMF_PLANES_RGBA, R_IMF_VIEWS_INDIVIDUAL, R_IMF_VIEWS_MULTIVIEW, R_IMF_VIEWS_STEREO_3D, RE_HasFloatPixels(), RPT_ERROR, ImageSaveOptions::save_as_render, ImageSaveOptions::save_copy, ImageSaveOptions::scene, STEREO_LEFT_NAME, STEREO_RIGHT_NAME, Image::type, ImBuf::userflags, ImageUser::view, Image::views, RenderResult::views, and ImageFormatData::views_format.
Referenced by BKE_image_save().
|
static |
Definition at line 237 of file image_save.cc.
References BLI_path_rel(), ImageSaveOptions::bmain, ImageSaveOptions::do_newpath, Image::filepath, Image::id, ID_BLEND_PATH, ImageSaveOptions::relative, and STRNCPY.
Referenced by BKE_image_save(), and image_save_post().
Definition at line 313 of file image_save.cc.
References ImBuf::foptions, ImBuf::ftype, IMB_freeImBuf(), and ImBuf::planes.
Referenced by image_save_single().
|
static |
Definition at line 44 of file image_save.cc.
References BKE_imtype_valid_depths(), ImBufFloatBuffer::data, ImBuf::float_buffer, R_IMF_CHAN_DEPTH_12, R_IMF_CHAN_DEPTH_16, R_IMF_CHAN_DEPTH_24, R_IMF_CHAN_DEPTH_32, and R_IMF_CHAN_DEPTH_8.
Referenced by BKE_image_save_options_init().