|
Blender V5.0
|
#include <algorithm>#include <cstddef>#include "IMB_imbuf.hh"#include "IMB_imbuf_types.hh"#include "IMB_allocimbuf.hh"#include "IMB_colormanagement_intern.hh"#include "IMB_filetype.hh"#include "IMB_metadata.hh"#include "imbuf.hh"#include "MEM_guardedalloc.h"#include "BLI_threads.h"#include "GPU_texture.hh"#include "CLG_log.h"#include "atomic_ops.h"Go to the source code of this file.
Functions | |
| template<class BufferType> | |
| static void | imb_free_buffer (BufferType &buffer) |
| static void | imb_free_dds_buffer (DDSData &dds_data) |
| template<class BufferType> | |
| bool | imb_alloc_buffer (BufferType &buffer, const uint x, const uint y, const uint channels, const size_t type_size, bool initialize_pixels) |
| template<class BufferType> | |
| void | imb_make_writeable_buffer (BufferType &buffer) |
| template<class BufferType> | |
| auto | imb_steal_buffer_data (BufferType &buffer) -> decltype(BufferType::data) |
| void | IMB_free_float_pixels (ImBuf *ibuf) |
| void | IMB_free_byte_pixels (ImBuf *ibuf) |
| static void | free_encoded_data (ImBuf *ibuf) |
| void | IMB_free_all_data (ImBuf *ibuf) |
| void | IMB_free_gpu_textures (ImBuf *ibuf) |
| void | IMB_freeImBuf (ImBuf *ibuf) |
| void | IMB_refImBuf (ImBuf *ibuf) |
| ImBuf * | IMB_makeSingleUser (ImBuf *ibuf) |
| bool | imb_addencodedbufferImBuf (ImBuf *ibuf) |
| bool | imb_enlargeencodedbufferImBuf (ImBuf *ibuf) |
| void * | imb_alloc_pixels (uint x, uint y, uint channels, size_t typesize, bool initialize_pixels, const char *alloc_name) |
| bool | IMB_alloc_float_pixels (ImBuf *ibuf, const uint channels, bool initialize_pixels) |
| bool | IMB_alloc_byte_pixels (ImBuf *ibuf, bool initialize_pixels) |
| uint8_t * | IMB_steal_byte_buffer (ImBuf *ibuf) |
| float * | IMB_steal_float_buffer (ImBuf *ibuf) |
| uint8_t * | IMB_steal_encoded_buffer (ImBuf *ibuf) |
| void | IMB_make_writable_byte_buffer (ImBuf *ibuf) |
| void | IMB_make_writable_float_buffer (ImBuf *ibuf) |
| void | IMB_assign_byte_buffer (ImBuf *ibuf, uint8_t *buffer_data, const ImBufOwnership ownership) |
| void | IMB_assign_float_buffer (ImBuf *ibuf, float *buffer_data, const ImBufOwnership ownership) |
| void | IMB_assign_byte_buffer (ImBuf *ibuf, const ImBufByteBuffer &buffer, const ImBufOwnership ownership) |
| void | IMB_assign_float_buffer (ImBuf *ibuf, const ImBufFloatBuffer &buffer, const ImBufOwnership ownership) |
| void | IMB_assign_dds_data (ImBuf *ibuf, const DDSData &data, const ImBufOwnership ownership) |
| ImBuf * | IMB_allocFromBufferOwn (uint8_t *byte_buffer, float *float_buffer, uint w, uint h, uint channels) |
| ImBuf * | IMB_allocFromBuffer (const uint8_t *byte_buffer, const float *float_buffer, uint w, uint h, uint channels) |
| ImBuf * | IMB_allocImBuf (uint x, uint y, uchar planes, uint flags) |
| bool | IMB_initImBuf (ImBuf *ibuf, uint x, uint y, uchar planes, uint flags) |
| ImBuf * | IMB_dupImBuf (const ImBuf *ibuf1) |
| size_t | IMB_get_pixel_count (const ImBuf *ibuf) |
| Get the length of the data of the given image buffer in pixels. | |
| size_t | IMB_get_size_in_memory (const ImBuf *ibuf) |
Variables | |
| static CLG_LogRef | LOG = {"image.buffer"} |
|
static |
Definition at line 162 of file allocimbuf.cc.
References ImBuf::encoded_buffer, ImBuf::encoded_buffer_size, ImBuf::encoded_size, ImBuf::flags, IB_mem, and imb_free_buffer().
Referenced by imb_addencodedbufferImBuf(), and IMB_free_all_data().
| bool imb_addencodedbufferImBuf | ( | ImBuf * | ibuf | ) |
Definition at line 239 of file allocimbuf.cc.
References ImBuf::encoded_buffer, ImBuf::encoded_buffer_size, ImBuf::encoded_size, ImBuf::flags, free_encoded_data(), IB_mem, and imb_alloc_buffer().
Referenced by IMB_dupImBuf(), blender::imbuf::imb_oiio_write(), and imb_save_openexr().
| bool imb_alloc_buffer | ( | BufferType & | buffer, |
| const uint | x, | ||
| const uint | y, | ||
| const uint | channels, | ||
| const size_t | type_size, | ||
| bool | initialize_pixels ) |
Definition at line 81 of file allocimbuf.cc.
References IB_TAKE_OWNERSHIP, imb_alloc_pixels(), x, and y.
Referenced by imb_addencodedbufferImBuf(), IMB_alloc_byte_pixels(), IMB_alloc_float_pixels(), IMB_allocFromBuffer(), and imb_enlargeencodedbufferImBuf().
Allocate storage for byte type pixels. If the image already contains byte data storage, it is freed first.
Definition at line 334 of file allocimbuf.cc.
References ImBuf::byte_buffer, ImBuf::flags, IB_byte_data, imb_alloc_buffer(), imb_free_buffer(), ImBuf::x, and ImBuf::y.
Referenced by colormanagement_imbuf_make_display_space(), IMB_byte_from_float(), IMB_ImBufFromStereo3d(), IMB_initImBuf(), imb_loadwebp(), IMB_stereo3d_ImBuf(), blender::bke::node_preview_verify(), and ubuf_ensure_compat_ibuf().
| bool IMB_alloc_float_pixels | ( | ImBuf * | ibuf, |
| const unsigned int | channels, | ||
| bool | initialize_pixels = true ) |
Allocate storage for float type pixels. If the image already contains float data storage, it is freed first.
Definition at line 312 of file allocimbuf.cc.
References ImBuf::channels, ImBufFloatBuffer::data, ImBuf::flags, ImBuf::float_buffer, IB_float_data, imb_alloc_buffer(), IMB_free_float_pixels(), ImBuf::x, and ImBuf::y.
Referenced by blender::seq::CompositorContext::get_output(), IMB_dupImBuf(), IMB_float_from_byte(), IMB_ImBufFromStereo3d(), IMB_initImBuf(), imb_load_openexr(), IMB_stereo3d_ImBuf(), blender::seq::seq_imbuf_to_sequencer_space(), seq_process_render_image(), ubuf_ensure_compat_ibuf(), and blender::render::Context::viewer_output_to_viewer_image().
| void * imb_alloc_pixels | ( | unsigned int | x, |
| unsigned int | y, | ||
| unsigned int | channels, | ||
| size_t | typesize, | ||
| bool | initialize_pixels, | ||
| const char * | alloc_name ) |
Exported for image tools in blender, to quickly allocate 32 bits rect.
Definition at line 299 of file allocimbuf.cc.
References MEM_callocN(), MEM_mallocN(), size(), SIZE_MAX, x, and y.
Referenced by convertRGBAToLogElement(), imb_alloc_buffer(), logImageGetDataRGBA(), and logImageSetDataRGBA().
| ImBuf * IMB_allocFromBuffer | ( | const uint8_t * | byte_buffer, |
| const float * | float_buffer, | ||
| unsigned int | w, | ||
| unsigned int | h, | ||
| unsigned int | channels ) |
Create a copy of a pixel buffer and wrap it to a new ImBuf
Definition at line 469 of file allocimbuf.cc.
References ImBuf::byte_buffer, ImBuf::channels, ImBufByteBuffer::data, ImBufFloatBuffer::data, ImBuf::float_buffer, imb_alloc_buffer(), IMB_allocImBuf(), and w().
Referenced by BKE_main_thumbnail_to_imbuf(), imb_gpu_get_data(), imb_load_filepath_thumbnail_openexr(), GHOST_SystemWayland::putClipboardImage(), putClipboardImagePNG(), studiolight_load_equirect_image(), UI_svg_icon_bitmap(), update_do_scale(), and WM_clipboard_image_get().
| ImBuf * IMB_allocFromBufferOwn | ( | uint8_t * | byte_buffer, |
| float * | float_buffer, | ||
| unsigned int | w, | ||
| unsigned int | h, | ||
| unsigned int | channels ) |
Create a copy of a pixel buffer and wrap it to a new ImBuf (transferring ownership to the in imbuf).
Definition at line 443 of file allocimbuf.cc.
References BLI_assert, ImBuf::channels, IB_TAKE_OWNERSHIP, IMB_allocImBuf(), IMB_assign_byte_buffer(), IMB_assign_float_buffer(), MEM_allocN_len, and w().
Referenced by blend_file_thumb_from_screenshot(), and studiolight_load_equirect_image().
Definition at line 501 of file allocimbuf.cc.
References IMB_freeImBuf(), IMB_initImBuf(), MEM_callocN(), x, and y.
Referenced by accessor_get_ibuf(), add_ibuf_for_tile(), blender::compositor::FileOutput::add_pass(), blender::compositor::FileOutput::add_view(), BKE_icon_geom_rasterize(), BKE_previewimg_to_imbuf(), BKE_tracking_get_plane_imbuf(), BKE_tracking_get_search_imbuf(), BKE_tracking_sample_pattern(), BKE_tracking_stabilize_frame(), brush_painter_imbuf_new(), brush_painter_imbuf_partial_update(), blender::io::usd::cache_image_color(), blender::image_engine::FloatBufferCache::cached_float_buffer(), colormanage_cache_put(), blender::compositor::compute_linear_buffer(), blender::imbuf::tests::create_6x2_test_image(), blender::imbuf::tests::create_6x2_test_image_fl(), blender::seq::create_missing_media_image(), dynamicPaint_outputSurfaceImage(), ED_view3d_draw_offscreen_imbuf(), float_image_to_ibuf(), ibJpegImageFromCinfo(), image_acquire_ibuf(), image_get_render_result(), blender::ed::greasepencil::image_render::image_render_end(), IMB_allocFromBuffer(), IMB_allocFromBufferOwn(), IMB_dupImBuf(), IMB_font_preview(), IMB_ImBufFromStereo3d(), imb_load_dpx_cineon(), imb_load_filepath_thumbnail_openexr(), imb_load_filepath_thumbnail_svg(), imb_load_filepath_thumbnail_webp(), imb_load_jp2_stream(), imb_load_openexr(), imb_loadiris(), imb_loadwebp(), IMB_scale_into_new(), IMB_stereo3d_ImBuf(), IMB_thumb_load_font(), imbuf_alloc_temp_tile(), blender::seq::input_preprocess(), blender::imbuf::load_pixels(), Freestyle::Canvas::loadMap(), M_imbuf_new(), make_grayscale_ibuf_copy(), blender::bke::node_preview_verify(), NSImageToImBuf(), paint_2d_lift_clone(), blender::seq::prepare_effect_imbufs(), RE_layer_load_from_file(), RE_render_result_rect_to_ibuf(), RE_RenderPassEnsureImBuf(), RE_RenderViewEnsureImBuf(), render_layer_allocate_pass(), Freestyle::SteerableViewMap::saveSteerableViewMap(), screen_opengl_render_doit(), screenshot_exec(), seq_process_render_image(), blender::seq::seq_render_effect_strip_impl(), blender::seq::seq_render_mask(), blender::seq::seq_render_scene_strip_ex(), blender::seq::seq_render_strip(), blender::seq::seq_render_strip_stack(), blender::ed::asset::take_screenshot_crop(), blender::imbuf::tests::TEST(), thumb_create_ex(), blender::imbuf::tests::transform_2x_smaller(), blender::imbuf::tests::transform_fractional_larger(), UI_tooltip_color_field_add(), and blender::ed::object::write_external_bake_pixels().
| void IMB_assign_byte_buffer | ( | ImBuf * | ibuf, |
| const ImBufByteBuffer & | buffer, | ||
| ImBufOwnership | ownership ) |
Assign the content and the color space of the corresponding buffer the data from the given buffer.
Definition at line 417 of file allocimbuf.cc.
References ImBuf::byte_buffer, ImBufByteBuffer::colorspace, ImBufByteBuffer::data, and IMB_assign_byte_buffer().
| void IMB_assign_byte_buffer | ( | ImBuf * | ibuf, |
| uint8_t * | buffer_data, | ||
| ImBufOwnership | ownership ) |
Assign the content of the corresponding buffer with the given data and ownership. The current content of the buffer is released corresponding to its ownership configuration.
Definition at line 391 of file allocimbuf.cc.
References ImBuf::byte_buffer, ImBufByteBuffer::data, ImBuf::flags, IB_byte_data, imb_free_buffer(), and ImBufByteBuffer::ownership.
Referenced by colormanage_cache_put(), blender::compositor::compute_linear_buffer(), image_undo_steal_and_assign_byte_buffer(), IMB_allocFromBufferOwn(), IMB_assign_byte_buffer(), IMB_rotate_orthogonal(), IMB_scale_into_new(), paint_2d_do_making_brush(), RE_render_result_rect_from_ibuf(), RE_render_result_rect_to_ibuf(), render_result_rect_fill_zero(), scale_with_function(), screenshot_exec(), and blender::ed::asset::take_screenshot_crop().
| void IMB_assign_dds_data | ( | ImBuf * | ibuf, |
| const DDSData & | data, | ||
| const ImBufOwnership | ownership ) |
Definition at line 433 of file allocimbuf.cc.
References BLI_assert, data, ImBuf::dds_data, ImBuf::ftype, imb_free_dds_buffer(), IMB_FTYPE_DDS, and DDSData::ownership.
Referenced by blender::compositor::compute_linear_buffer().
| void IMB_assign_float_buffer | ( | ImBuf * | ibuf, |
| const ImBufFloatBuffer & | buffer, | ||
| const ImBufOwnership | ownership ) |
Definition at line 425 of file allocimbuf.cc.
References ImBufFloatBuffer::colorspace, ImBufFloatBuffer::data, ImBuf::float_buffer, and IMB_assign_float_buffer().
| void IMB_assign_float_buffer | ( | ImBuf * | ibuf, |
| float * | buffer_data, | ||
| const ImBufOwnership | ownership ) |
Definition at line 404 of file allocimbuf.cc.
References ImBufFloatBuffer::data, ImBuf::flags, ImBuf::float_buffer, IB_float_data, imb_free_buffer(), and ImBufFloatBuffer::ownership.
Referenced by blender::compositor::FileOutput::add_pass(), blender::compositor::FileOutput::add_view(), BKE_brush_gen_radial_control_imbuf(), BKE_movieclip_convert_multilayer_ibuf(), blender::image_engine::FloatBufferCache::cached_float_buffer(), blender::compositor::compute_linear_buffer(), blender::seq::convert_multilayer_ibuf(), float_image_to_ibuf(), image_undo_steal_and_assign_float_buffer(), IMB_allocFromBufferOwn(), IMB_assign_float_buffer(), IMB_rotate_orthogonal(), IMB_scale_into_new(), make_grayscale_ibuf_copy(), blender::render::Context::output_to_render_result(), paint_2d_do_making_brush(), RE_pass_set_buffer_data(), RE_render_result_rect_from_ibuf(), RE_render_result_rect_to_ibuf(), render_layer_allocate_pass(), scale_with_function(), and shader_preview_texture().
Definition at line 550 of file allocimbuf.cc.
References ImBuf::byte_buffer, ImBuf::channels, ImBuf::colormanage_cache, ImBufByteBuffer::colorspace, ImBufFloatBuffer::colorspace, DDSData::data, ImBufByteBuffer::data, ImBufFloatBuffer::data, ImBuf::dds_data, ImBuf::display_buffer_flags, ImBuf::encoded_buffer, ImBuf::encoded_buffer_size, ImBuf::encoded_size, ImBuf::float_buffer, ImBuf::gpu, IB_byte_data, IB_uninitialized_pixels, imb_addencodedbufferImBuf(), IMB_alloc_float_pixels(), IMB_allocImBuf(), IMB_freeImBuf(), ImBuf::metadata, ImBuf::planes, ImBuf::refcounter, ImBufGPU::texture, ImBuf::x, x, ImBuf::y, and y.
Referenced by accessor_get_ibuf(), BKE_image_preview(), BKE_tracking_distortion_exec(), blend_file_thumb_from_camera(), blend_file_thumb_from_screenshot(), blender::bke::bNodePreview::bNodePreview(), blender::seq::compositor_modifier_apply(), blender::seq::do_render_strip_uncached(), blender::seq::do_speed_effect(), duplicate_render_pass(), duplicate_render_view(), image_save_single(), IMB_makeSingleUser(), IMB_scale_into_new(), imbuf_ensure_editable(), Freestyle::Canvas::loadMap(), postprocess_frame(), py_imbuf_copy(), RE_DuplicateRenderResult(), RE_render_result_rect_to_ibuf(), screen_opengl_render_doit(), seq_process_render_image(), and UI_tooltip_image_field_add().
| bool imb_enlargeencodedbufferImBuf | ( | ImBuf * | ibuf | ) |
Definition at line 264 of file allocimbuf.cc.
References CLOG_ERROR, ImBufByteBuffer::data, ImBuf::encoded_buffer, ImBuf::encoded_buffer_size, ImBuf::encoded_size, ImBuf::flags, IB_mem, imb_alloc_buffer(), imb_free_buffer(), and LOG.
Referenced by blender::imbuf::ImBufMemWriter::pwrite().
| void IMB_free_all_data | ( | ImBuf * | ibuf | ) |
Deallocate all CPU side data storage (byte, float, encoded).
Definition at line 176 of file allocimbuf.cc.
References free_encoded_data(), IMB_free_byte_pixels(), and IMB_free_float_pixels().
Referenced by blender::seq::CompositorContext::get_output(), IMB_freeImBuf(), and ubuf_ensure_compat_ibuf().
|
static |
Definition at line 39 of file allocimbuf.cc.
References IB_DO_NOT_TAKE_OWNERSHIP, IB_TAKE_OWNERSHIP, and MEM_freeN().
Referenced by free_encoded_data(), IMB_alloc_byte_pixels(), IMB_assign_byte_buffer(), IMB_assign_float_buffer(), imb_enlargeencodedbufferImBuf(), IMB_free_byte_pixels(), and IMB_free_float_pixels().
| void IMB_free_byte_pixels | ( | ImBuf * | ibuf | ) |
Deallocate image byte storage.
Definition at line 153 of file allocimbuf.cc.
References ImBuf::byte_buffer, ImBuf::flags, IB_byte_data, and imb_free_buffer().
Referenced by BKE_tracking_distortion_exec(), colormanage_imbuf_make_linear(), image_save_post(), IMB_colormanagement_imbuf_for_write(), IMB_free_all_data(), blender::seq::input_preprocess(), blender::seq::make_thumb_for_image(), project_paint_end(), RE_render_result_rect_from_ibuf(), scale_with_function(), blender::seq::seq_imbuf_to_sequencer_space(), blender::seq::seq_render_image_strip_view(), blender::seq::seq_render_movie_strip_view(), and blender::render::Context::viewer_output_to_viewer_image().
|
static |
Definition at line 59 of file allocimbuf.cc.
References DDSData::data, free(), IB_DO_NOT_TAKE_OWNERSHIP, IB_TAKE_OWNERSHIP, and DDSData::ownership.
Referenced by IMB_assign_dds_data(), and IMB_freeImBuf().
| void IMB_free_float_pixels | ( | ImBuf * | ibuf | ) |
Deallocate image float storage.
Definition at line 144 of file allocimbuf.cc.
References ImBuf::flags, ImBuf::float_buffer, IB_float_data, and imb_free_buffer().
Referenced by blender::seq::compositor_modifier_apply(), image_save_post(), IMB_alloc_float_pixels(), IMB_free_all_data(), IMB_thumb_manage(), project_paint_end(), RE_render_result_rect_from_ibuf(), scale_with_function(), screen_opengl_render_doit(), thumb_create_ex(), ubuf_ensure_compat_ibuf(), and blender::render::Context::viewer_output_to_viewer_image().
| void IMB_free_gpu_textures | ( | ImBuf * | ibuf | ) |
Definition at line 183 of file allocimbuf.cc.
References ImBuf::gpu, GPU_texture_free(), and ImBufGPU::texture.
Referenced by IMB_freeImBuf(), and render_result_free_gpu_texture_caches().
| void IMB_freeImBuf | ( | ImBuf * | ibuf | ) |
Definition at line 193 of file allocimbuf.cc.
References atomic_sub_and_fetch_int32(), BLI_assert_msg, colormanage_cache_free(), ImBuf::dds_data, ImBuf::filepath, IMB_free_all_data(), imb_free_dds_buffer(), IMB_free_gpu_textures(), IMB_metadata_free(), MEM_freeN(), ImBuf::metadata, and ImBuf::refcounter.
Referenced by accessor_get_ibuf(), accessor_release_image_callback(), action_preview_render(), blender::seq::add_image_init_alpha_mode(), blender::seq::add_image_strip(), blender::ed::space_node::all_nodes_preview_update(), BKE_image_acquire_multilayer_view_ibuf(), BKE_image_add_generated(), BKE_image_has_ibuf(), BKE_image_memorypack(), BKE_image_pool_free(), BKE_image_reassign_tile(), BKE_image_release_ibuf(), BKE_image_render_write(), BKE_image_signal(), BKE_movieclip_build_proxy_frame(), BKE_movieclip_build_proxy_frame_for_ibuf(), BKE_movieclip_get_gpu_texture(), BKE_movieclip_get_size(), BKE_movieclip_get_stable_ibuf(), BKE_movieclip_has_frame(), BKE_movieclip_update_scopes(), BKE_previewimg_ensure(), BKE_tracking_get_pattern_imbuf(), BKE_tracking_refine_marker(), blend_file_thumb_from_camera(), blend_file_thumb_from_screenshot(), brush_painter_2d_refresh_cache(), brush_painter_2d_require_imbuf(), brush_painter_cache_2d_free(), brush_painter_imbuf_partial_update(), build_pict_list_from_anim(), build_pict_list_from_image_sequence(), blender::io::usd::cache_image_color(), blender::compositor::CachedImage::CachedImage(), blender::seq::FinalImageCache::clear(), blender::seq::SourceImageCache::clear(), blender::seq::StripImageMap::clear(), blender::seq::ThumbnailCache::clear(), clip_draw_main(), clip_free(), clip_main_region_draw(), colormanage_cache_get(), colormanage_cache_handle_release(), blender::seq::compositor_modifier_apply(), blender::compositor::compute_marker_points(), detect_clip_source(), detect_features_exec(), blender::ed::sculpt_paint::paint::image::do_push_undo_tile(), do_render_sequencer(), blender::seq::do_render_strip_uncached(), blender::ed::vse::draw_strip_thumbnails(), dynamicPaint_outputSurfaceImage(), ED_imapaint_dirty_region(), ED_space_clip_color_sample(), ED_space_clip_get_buffer(), ED_space_clip_get_position(), ED_space_clip_get_stable_buffer(), blender::nodes::node_composite_movieclip_cc::MovieClipOperation::execute(), file_draw_tooltip_custom_func(), filelist_free_icons(), blender::seq::final_image_cache_evict(), blender::seq::final_image_cache_invalidate_frame_range(), blender::seq::final_image_cache_put(), frame_cache_remove(), free_buffers(), blender::ed::asset::generate_previewimg_from_buffer(), GHOST_SystemCocoa::getClipboardImage(), GHOST_SystemWayland::getClipboardImage(), getClipboardImageFilepath(), getClipboardImageImBuf(), gpu_texture_update_scaled(), GHOST_SystemWin32::hasClipboardImage(), icon_copy_rect(), icon_draw_size(), icon_free_data(), icon_verify_datatoc(), image_clipboard_copy_exec(), image_clipboard_paste_exec(), image_get_render_result(), image_init_color_management(), image_load_image_file(), image_load_movie_file(), image_memorypack_imbuf(), image_save_single(), image_undosys_step_encode(), IMB_allocImBuf(), IMB_dupImBuf(), imb_gpu_get_data(), IMB_ImBufFromStereo3d(), imb_load_dpx_cineon(), imb_load_filepath_thumbnail_openexr(), imb_load_filepath_thumbnail_webp(), IMB_load_image_from_file_descriptor(), imb_load_openexr(), IMB_makeSingleUser(), IMB_thumb_load_font(), IMB_thumb_manage(), imbuf_save_post(), blender::seq::input_preprocess(), blender::seq::StripImageMap::invalidate(), load_image_single(), blender::imbuf::load_pixels(), blender::ed::vse::metadata_panel_context_draw(), metadata_panel_context_draw(), blender::seq::modifier_apply_stack(), MOV_decode_preview_frame(), moviecache_destructor(), moviecache_valfree(), movieclip_build_proxy_ibuf(), movieclip_get_postprocessed_ibuf(), new_image_from_plane_marker_exec(), object_preview_render(), openanim(), paint_2d_op(), prefetch_movie_frame(), prefetch_task_func(), project_bucket_init(), proxy_task_func(), ptile_restore_runtime_map(), blender::seq::StripImageMap::put(), put_postprocessed_frame_to_cache(), put_stabilized_frame_to_cache(), GHOST_SystemWayland::putClipboardImage(), putClipboardImagePNG(), py_imbuf_dealloc(), py_imbuf_free(), RE_create_gp_pass(), RE_layer_load_from_file(), RE_render_result_rect_to_ibuf(), RE_WriteRenderViewsMovie(), release_keyframed_image_buffers(), blender::seq::SourceImageCache::remove_entry(), blender::seq::ThumbnailCache::remove_entry(), render_result_free(), render_result_views_free(), sample_plane_marker_image_for_operator(), scene_preview_render(), screen_opengl_render_doit(), screen_opengl_views_setup(), screenshot_exec(), blender::ed::asset::screenshot_preview_exec(), blender::seq::seq_prefetch_frames(), seq_process_render_image(), blender::seq::seq_proxy_build_frame(), blender::seq::seq_render_effect_strip_impl(), blender::seq::seq_render_image_strip(), blender::seq::seq_render_movie_strip(), blender::seq::seq_render_scene_strip_ex(), blender::seq::seq_render_strip_stack(), blender::ed::vse::sequencer_preview_region_draw(), sequencer_sample_apply(), blender::ed::space_node::shader_preview_startjob(), blender::seq::source_image_cache_evict(), blender::seq::source_image_cache_put(), studiolight_load_equirect_image(), blender::imbuf::tests::TEST(), blender::imbuf::tests::TEST(), blender::imbuf::tests::TEST(), blender::imbuf::tests::TEST(), blender::imbuf::tests::TEST(), blender::imbuf::tests::TEST(), blender::imbuf::tests::TEST(), blender::imbuf::tests::TEST(), blender::imbuf::tests::TEST(), blender::imbuf::tests::TEST(), blender::imbuf::tests::TEST(), blender::imbuf::tests::TEST(), blender::imbuf::tests::TEST(), blender::imbuf::tests::TEST(), blender::imbuf::tests::TEST(), blender::imbuf::tests::TEST(), blender::imbuf::tests::TEST(), blender::imbuf::tests::TEST(), blender::imbuf::tests::TEST(), blender::imbuf::tests::TEST(), blender::imbuf::tests::TEST(), blender::imbuf::tests::TEST(), blender::imbuf::tests::TEST(), blender::imbuf::tests::TEST(), blender::imbuf::tests::TEST(), blender::imbuf::tests::TEST(), texture_paint_image_from_view_exec(), thumb_create_ex(), thumb_create_or_fail(), blender::seq::thumbnail_cache_maintain_capacity(), track_get_search_floatbuf(), blender::imbuf::tests::transform_2x_smaller(), blender::imbuf::tests::transform_fractional_larger(), ubuf_from_image_all_tiles(), uhandle_restore_list(), ui_but_free(), ui_draw_but_TRACKPREVIEW(), UI_icon_to_preview(), UI_icons_free_drawinfo(), UI_tooltip_color_field_add(), ui_tooltip_from_clip(), ui_tooltip_from_image(), ui_tooltip_from_vfont(), ui_tooltip_region_free_cb(), uiTemplateMovieclipInformation(), uiTemplateRecentFiles_tooltip_func(), update_image_from_plane_marker_exec(), wm_file_write(), wm_main_playanim_intern(), blender::ed::object::write_external_bake_pixels(), blender::bke::bNodePreview::~bNodePreview(), blender::render::Context::~Context(), blender::image_engine::FloatImageBuffer::~FloatImageBuffer(), GHOST_EventDragnDrop::~GHOST_EventDragnDrop(), and blender::ed::space_node::NestedTreePreviews::~NestedTreePreviews().
| size_t IMB_get_pixel_count | ( | const ImBuf * | ibuf | ) |
Get the length of the data of the given image buffer in pixels.
This is the width * the height of the image buffer. This function is preferred over ibuf->x * ibuf->y due to 32 bit int overflow issues when working with very large resolution images.
Definition at line 630 of file allocimbuf.cc.
References ImBuf::x, and ImBuf::y.
Referenced by BKE_imbuf_alpha_test(), blender::ed::vse::ScopeHistogram::calc_from_ibuf(), IMB_byte_from_float(), IMB_color_to_bw(), IMB_get_size_in_memory(), imb_gpu_get_data(), IMB_rectfill(), IMB_rectfill_alpha(), IMB_saturation(), imb_savewebp(), imbuf_rgba_to_abgr(), blender::seq::multiply_ibuf(), and studiolight_create_matcap_gputexture().
| size_t IMB_get_size_in_memory | ( | const ImBuf * | ibuf | ) |
Approximate size of ImBuf in memory
Definition at line 635 of file allocimbuf.cc.
References ImBuf::byte_buffer, ImBuf::channels, ImBufByteBuffer::data, ImBufFloatBuffer::data, float, ImBuf::float_buffer, IMB_get_pixel_count(), and size().
Referenced by blender::seq::final_image_cache_calc_memory_size(), frame_cache_add(), get_size_in_memory(), image_mem_size(), and blender::seq::source_image_cache_calc_memory_size().
| bool IMB_initImBuf | ( | ImBuf * | ibuf, |
| unsigned int | x, | ||
| unsigned int | y, | ||
| unsigned char | planes, | ||
| unsigned int | flags ) |
Initialize given ImBuf.
Use in cases when temporary image buffer is allocated on stack.
Definition at line 515 of file allocimbuf.cc.
References ImBuf::channels, colormanage_imbuf_set_default_spaces(), ImBuf::foptions, ImBuf::ftype, IB_byte_data, IB_float_data, IB_uninitialized_pixels, IMB_alloc_byte_pixels(), IMB_alloc_float_pixels(), IMB_DPI_DEFAULT, IMB_FTYPE_PNG, ImBuf::planes, ImBuf::ppm, ImbFormatOptions::quality, ImBuf::x, x, ImBuf::y, and y.
Referenced by IMB_allocImBuf(), IMB_scale_into_new(), and paint_2d_do_making_brush().
| void IMB_make_writable_byte_buffer | ( | ImBuf * | ibuf | ) |
Make corresponding buffers available for modification. Is achieved by ensuring that the given ImBuf is the only owner of the underlying buffer data.
Definition at line 381 of file allocimbuf.cc.
References ImBuf::byte_buffer, and imb_make_writeable_buffer().
Referenced by imbuf_ensure_editable().
| void IMB_make_writable_float_buffer | ( | ImBuf * | ibuf | ) |
Definition at line 386 of file allocimbuf.cc.
References ImBuf::float_buffer, and imb_make_writeable_buffer().
Referenced by imbuf_ensure_editable().
| void imb_make_writeable_buffer | ( | BufferType & | buffer | ) |
Definition at line 101 of file allocimbuf.cc.
References IB_DO_NOT_TAKE_OWNERSHIP, IB_TAKE_OWNERSHIP, and MEM_dupallocN().
Referenced by IMB_make_writable_byte_buffer(), and IMB_make_writable_float_buffer().
Definition at line 219 of file allocimbuf.cc.
References atomic_load_int32(), IMB_dupImBuf(), IMB_freeImBuf(), IMB_metadata_copy(), and ImBuf::refcounter.
Referenced by blender::seq::input_preprocess(), and load_movie_single().
| void IMB_refImBuf | ( | ImBuf * | ibuf | ) |
Increase reference count to imbuf (to delete an imbuf you have to call freeImBuf as many times as it is referenced)
Definition at line 214 of file allocimbuf.cc.
References atomic_add_and_fetch_int32(), and ImBuf::refcounter.
Referenced by blender::ed::space_node::all_nodes_preview_update(), BKE_image_get_first_ibuf(), BKE_image_get_ibuf_with_name(), do_moviecache_put(), blender::seq::final_image_cache_get(), blender::seq::final_image_cache_put(), blender::seq::StripImageMap::get(), blender::render::Context::get_pass(), get_postprocessed_cached_frame(), get_stable_cached_frame(), image_get_ibuf_multilayer(), image_get_render_result(), image_load_sequence_multilayer(), IMB_moviecache_get(), blender::ed::space_node::node_preview_acquire_ibuf(), blender::seq::StripImageMap::put(), put_postprocessed_frame_to_cache(), put_stabilized_frame_to_cache(), blender::seq::source_image_cache_get(), blender::seq::source_image_cache_put(), and blender::seq::thumbnail_cache_get().
| auto imb_steal_buffer_data | ( | BufferType & | buffer | ) | -> decltype(BufferType::data) |
Definition at line 118 of file allocimbuf.cc.
References BLI_assert_msg, BLI_assert_unreachable, data, IB_DO_NOT_TAKE_OWNERSHIP, and IB_TAKE_OWNERSHIP.
Referenced by IMB_steal_byte_buffer(), IMB_steal_encoded_buffer(), and IMB_steal_float_buffer().
| uint8_t * IMB_steal_byte_buffer | ( | ImBuf * | ibuf | ) |
Steal the buffer data pointer: the ImBuf is no longer an owner of this data.
Definition at line 355 of file allocimbuf.cc.
References ImBuf::byte_buffer, data, ImBuf::flags, IB_byte_data, and imb_steal_buffer_data().
Referenced by icon_verify_datatoc(), image_undo_steal_and_assign_byte_buffer(), imb_gpu_get_data(), and UI_icon_to_preview().
| uint8_t * IMB_steal_encoded_buffer | ( | ImBuf * | ibuf | ) |
Definition at line 369 of file allocimbuf.cc.
References data, ImBuf::encoded_buffer, ImBuf::encoded_buffer_size, ImBuf::encoded_size, ImBuf::flags, IB_mem, and imb_steal_buffer_data().
Referenced by image_memorypack_imbuf().
Definition at line 362 of file allocimbuf.cc.
References data, ImBuf::flags, ImBuf::float_buffer, IB_float_data, and imb_steal_buffer_data().
Referenced by blender::image_engine::FloatBufferCache::cached_float_buffer(), image_undo_steal_and_assign_float_buffer(), and imb_gpu_get_data().
|
static |
Definition at line 35 of file allocimbuf.cc.