Blender  V2.93
Functions | Variables
allocimbuf.c File Reference
#include <stddef.h>
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "IMB_allocimbuf.h"
#include "IMB_colormanagement_intern.h"
#include "IMB_filetype.h"
#include "IMB_metadata.h"
#include "imbuf.h"
#include "MEM_guardedalloc.h"
#include "BLI_threads.h"
#include "BLI_utildefines.h"

Go to the source code of this file.

Functions

void imb_refcounter_lock_init (void)
 
void imb_refcounter_lock_exit (void)
 
void imb_mmap_lock_init (void)
 
void imb_mmap_lock_exit (void)
 
void imb_mmap_lock (void)
 
void imb_mmap_unlock (void)
 
void imb_freemipmapImBuf (ImBuf *ibuf)
 
void imb_freerectfloatImBuf (ImBuf *ibuf)
 
void imb_freerectImBuf (ImBuf *ibuf)
 
void imb_freetilesImBuf (ImBuf *ibuf)
 
static void freeencodedbufferImBuf (ImBuf *ibuf)
 
void IMB_freezbufImBuf (ImBuf *ibuf)
 
void IMB_freezbuffloatImBuf (ImBuf *ibuf)
 
void imb_freerectImbuf_all (ImBuf *ibuf)
 
void IMB_freeImBuf (ImBuf *ibuf)
 
void IMB_refImBuf (ImBuf *ibuf)
 
ImBufIMB_makeSingleUser (ImBuf *ibuf)
 
bool addzbufImBuf (ImBuf *ibuf)
 
bool addzbuffloatImBuf (ImBuf *ibuf)
 
bool imb_addencodedbufferImBuf (ImBuf *ibuf)
 
bool imb_enlargeencodedbufferImBuf (ImBuf *ibuf)
 
void * imb_alloc_pixels (unsigned int x, unsigned int y, unsigned int channels, size_t typesize, const char *name)
 
bool imb_addrectfloatImBuf (ImBuf *ibuf)
 
bool imb_addrectImBuf (ImBuf *ibuf)
 
struct ImBufIMB_allocFromBuffer (const unsigned int *rect, const float *rectf, unsigned int w, unsigned int h, unsigned int channels)
 
bool imb_addtilesImBuf (ImBuf *ibuf)
 
ImBufIMB_allocImBuf (unsigned int x, unsigned int y, uchar planes, unsigned int flags)
 
bool IMB_initImBuf (struct ImBuf *ibuf, unsigned int x, unsigned int y, unsigned char planes, unsigned int flags)
 
ImBufIMB_dupImBuf (const ImBuf *ibuf1)
 
size_t IMB_get_size_in_memory (ImBuf *ibuf)
 

Variables

static SpinLock refcounter_spin
 
static SpinLock mmap_spin
 

Function Documentation

◆ addzbuffloatImBuf()

bool addzbuffloatImBuf ( ImBuf ibuf)

◆ addzbufImBuf()

bool addzbufImBuf ( struct ImBuf ibuf)

◆ freeencodedbufferImBuf()

static void freeencodedbufferImBuf ( ImBuf ibuf)
static

◆ imb_addencodedbufferImBuf()

bool imb_addencodedbufferImBuf ( ImBuf ibuf)

◆ imb_addrectfloatImBuf()

bool imb_addrectfloatImBuf ( ImBuf ibuf)

◆ imb_addrectImBuf()

bool imb_addrectImBuf ( ImBuf ibuf)

◆ imb_addtilesImBuf()

bool imb_addtilesImBuf ( ImBuf ibuf)

Definition at line 462 of file allocimbuf.c.

References IB_tiles, ImBuf::mall, MEM_callocN, NULL, ImBuf::tiles, ImBuf::xtiles, and ImBuf::ytiles.

Referenced by imb_loadtiff().

◆ imb_alloc_pixels()

void* imb_alloc_pixels ( unsigned int  x,
unsigned int  y,
unsigned int  channels,
size_t  typesize,
const char *  name 
)

◆ IMB_allocFromBuffer()

struct ImBuf* IMB_allocFromBuffer ( const unsigned int *  rect,
const float rectf,
unsigned int  w,
unsigned int  h,
unsigned int  channels 
)

◆ IMB_allocImBuf()

ImBuf* IMB_allocImBuf ( unsigned int  x,
unsigned int  y,
unsigned char  planes,
unsigned int  flags 
)
Attention
Defined in allocimbuf.c

Definition at line 478 of file allocimbuf.c.

References ImBuf::flags, IMB_freeImBuf(), IMB_initImBuf(), MEM_mallocN, NULL, ImBuf::planes, x, and y.

Referenced by accessor_get_ibuf(), add_ibuf_size(), anim_getnew(), BKE_main_thumbnail_to_imbuf(), BKE_previewimg_to_imbuf(), BKE_tracking_get_search_imbuf(), BKE_tracking_sample_pattern(), BKE_tracking_stabilize_frame(), brush_painter_imbuf_new(), brush_painter_imbuf_partial_update(), colormanage_cache_put(), blender::compositor::OutputStereoOperation::deinitExecution(), blender::compositor::OutputSingleLayerOperation::deinitExecution(), dynamicPaint_outputSurfaceImage(), ED_view3d_draw_offscreen_imbuf(), filelist_init_icons(), float_image_to_ibuf(), gpencil_render_offscreen(), GHOST_SystemCocoa::handleDraggingEvent(), ibJpegImageFromCinfo(), icon_draw_rect(), image_acquire_ibuf(), image_get_ibuf_multilayer(), image_get_render_result(), image_load_sequence_multilayer(), IMB_allocFromBuffer(), imb_bmp_decode(), IMB_double_fast_x(), IMB_double_fast_y(), IMB_dupImBuf(), IMB_half_x(), IMB_half_y(), IMB_ImBufFromStereo3d(), imb_load_dds(), imb_load_dpx_cineon(), imb_load_jp2_stream(), imb_load_openexr(), imb_loadhdr(), imb_loadiris(), imb_loadpng(), imb_loadtarga(), imb_loadtiff(), IMB_makemipmap(), imb_oiio_load_image(), imb_oiio_load_image_float(), IMB_onehalf(), imb_read_tiff_pixels(), IMB_remakemipmap(), IMB_stereo3d_ImBuf(), imb_stereo3d_squeeze_rect(), imb_stereo3d_squeeze_rectf(), IMB_thumb_load_font(), imbuf_alloc_temp_tile(), input_preprocess(), Freestyle::Canvas::loadMap(), M_imbuf_new(), make_grayscale_ibuf_copy(), make_histogram_view_from_ibuf_byte(), make_histogram_view_from_ibuf_float(), make_sep_waveform_view_from_ibuf_byte(), make_sep_waveform_view_from_ibuf_float(), make_vectorscope_view_from_ibuf_byte(), make_vectorscope_view_from_ibuf_float(), make_waveform_view_from_ibuf_byte(), make_waveform_view_from_ibuf_float(), make_zebra_view_from_ibuf(), paint_2d_lift_clone(), prepare_effect_imbufs(), RE_layer_load_from_file(), render_result_rect_to_ibuf(), Freestyle::SteerableViewMap::saveSteerableViewMap(), screen_opengl_render_doit(), screenshot_exec(), seq_disk_cache_read_file(), seq_render_effect_strip_impl(), seq_render_mask(), seq_render_scene_strip(), seq_render_strip(), seq_render_strip_stack(), thumb_create_ex(), and write_external_bake_pixels().

◆ IMB_dupImBuf()

ImBuf* IMB_dupImBuf ( const ImBuf ibuf1)

◆ imb_enlargeencodedbufferImBuf()

bool imb_enlargeencodedbufferImBuf ( ImBuf ibuf)

◆ IMB_freeImBuf()

void IMB_freeImBuf ( struct ImBuf ibuf)
Attention
Defined in allocimbuf.c

Definition at line 211 of file allocimbuf.c.

References BLI_spin_lock(), BLI_spin_unlock(), colormanage_cache_free(), DDSData::data, ImBuf::dds_data, free(), imb_freerectImbuf_all(), IMB_metadata_free(), MEM_freeN, ImBuf::metadata, NULL, ImBuf::refcounter, and refcounter_spin.

Referenced by accessor_get_ibuf(), accessor_release_image_callback(), action_preview_render(), BKE_image_add_generated(), BKE_image_has_ibuf(), BKE_image_memorypack(), BKE_image_pool_free(), BKE_image_release_ibuf(), 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(), brush_free_data(), brush_painter_2d_refresh_cache(), brush_painter_2d_require_imbuf(), brush_painter_cache_2d_free(), brush_painter_imbuf_partial_update(), build_pict_list_ex(), blender::compositor::KeyingScreenOperation::buildVoronoiTriangulation(), clip_draw_main(), clip_free(), clip_main_region_draw(), colormanage_cache_get(), colormanage_cache_handle_release(), blender::compositor::MovieClipNode::convertToOperations(), blender::compositor::MovieClipBaseOperation::deinitExecution(), blender::compositor::OutputStereoOperation::deinitExecution(), blender::compositor::OutputSingleLayerOperation::deinitExecution(), detect_clip_source(), detect_features_exec(), do_gaussian_blur_effect(), do_render_sequencer(), do_render_strip_uncached(), 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(), filelist_free_icons(), filelist_init_icons(), frame_cache_remove(), free_buffers(), gpu_texture_update_scaled(), icon_copy_rect(), icon_draw_rect(), icon_draw_size(), icon_free_data(), icon_preview_startjob(), icon_verify_datatoc(), image_init_color_management(), image_load_image_file(), image_load_movie_file(), image_load_sequence_file(), image_memorypack_imbuf(), image_save_single(), image_undosys_step_encode(), IMB_allocImBuf(), IMB_anim_absolute(), IMB_anim_previewframe(), IMB_dupImBuf(), imb_freemipmapImBuf(), imb_gpu_get_data(), IMB_ImBufFromStereo3d(), imb_load_dpx_cineon(), imb_load_openexr(), imb_load_photoshop(), imb_loadpng(), IMB_makemipmap(), IMB_makeSingleUser(), IMB_moviecache_destructor(), imb_oiio_load_image(), imb_oiio_load_image_float(), imb_read_tiff_pixels(), IMB_remakemipmap(), imb_stereo3d_squeeze_rect(), imb_stereo3d_squeeze_rectf(), IMB_thumb_manage(), imbuf_save_post(), init_iconfile_list(), init_internal_icons(), input_preprocess(), load_image_single(), load_sequence_single(), metadata_panel_context_draw(), moviecache_valfree(), movieclip_build_proxy_ibuf(), movieclip_get_postprocessed_ibuf(), object_preview_render(), openanim(), paint_2d_op(), prefetch_movie_frame(), prefetch_task_func(), project_bucket_init(), proxy_task_func(), ptile_restore_runtime_list(), put_postprocessed_frame_to_cache(), put_stabilized_frame_to_cache(), py_imbuf_dealloc(), py_imbuf_free(), RE_layer_load_from_file(), RE_WriteRenderViewsImage(), RE_WriteRenderViewsMovie(), render_result_rect_to_ibuf(), screen_opengl_render_doit(), screenshot_exec(), SEQ_add_image_init_alpha_mode(), SEQ_add_image_strip(), seq_cache_put(), seq_cache_valfree(), seq_disk_cache_read_file(), SEQ_modifier_apply_stack(), seq_prefetch_do_skip_frame(), seq_prefetch_frames(), seq_proxy_build_frame(), seq_render_effect_strip_impl(), seq_render_image_strip(), seq_render_movie_strip(), seq_render_scene_strip(), seq_render_strip_stack(), sequencer_check_scopes(), sequencer_draw_preview(), sequencer_free(), sequencer_get_scope(), sequencer_make_scope(), sequencer_sample_apply(), studiolight_load_equirect_image(), texture_paint_image_from_view_exec(), thumb_create_ex(), thumb_create_or_fail(), track_get_search_floatbuf(), ubuf_from_image_all_tiles(), uhandle_restore_list(), ui_but_free(), UI_icon_to_preview(), UI_icons_free_drawinfo(), UI_icons_reload_internal_textures(), uiTemplateMovieclipInformation(), wm_file_write(), wm_main_playanim_intern(), write_external_bake_pixels(), and GHOST_EventDragnDrop::~GHOST_EventDragnDrop().

◆ imb_freemipmapImBuf()

void imb_freemipmapImBuf ( ImBuf ibuf)

◆ imb_freerectfloatImBuf()

void imb_freerectfloatImBuf ( ImBuf ibuf)

◆ imb_freerectImBuf()

void imb_freerectImBuf ( ImBuf ibuf)

◆ imb_freerectImbuf_all()

void imb_freerectImbuf_all ( ImBuf ibuf)

Free all pixel data (associated with image size).

Definition at line 201 of file allocimbuf.c.

References freeencodedbufferImBuf(), imb_freerectfloatImBuf(), imb_freerectImBuf(), imb_freetilesImBuf(), IMB_freezbuffloatImBuf(), and IMB_freezbufImBuf().

Referenced by IMB_freeImBuf(), and ubuf_ensure_compat_ibuf().

◆ imb_freetilesImBuf()

void imb_freetilesImBuf ( ImBuf ibuf)

◆ IMB_freezbuffloatImBuf()

void IMB_freezbuffloatImBuf ( ImBuf ibuf)

◆ IMB_freezbufImBuf()

void IMB_freezbufImBuf ( struct ImBuf ibuf)
Attention
Defined in allocimbuf.c

Definition at line 172 of file allocimbuf.c.

References IB_zbuf, ImBuf::mall, MEM_freeN, NULL, and ImBuf::zbuf.

Referenced by addzbufImBuf(), image_save_post(), imb_freerectImbuf_all(), and scalefast_Z_ImBuf().

◆ IMB_get_size_in_memory()

size_t IMB_get_size_in_memory ( struct ImBuf ibuf)

◆ IMB_initImBuf()

bool IMB_initImBuf ( struct ImBuf ibuf,
unsigned int  x,
unsigned int  y,
unsigned char  planes,
unsigned int  flags 
)

◆ IMB_makeSingleUser()

ImBuf* IMB_makeSingleUser ( ImBuf ibuf)

◆ imb_mmap_lock()

void imb_mmap_lock ( void  )

Definition at line 69 of file allocimbuf.c.

References BLI_spin_lock(), and mmap_spin.

Referenced by IMB_loadifffile(), and imb_loadtilefile().

◆ imb_mmap_lock_exit()

void imb_mmap_lock_exit ( void  )

Definition at line 64 of file allocimbuf.c.

References BLI_spin_end(), and mmap_spin.

Referenced by IMB_exit().

◆ imb_mmap_lock_init()

void imb_mmap_lock_init ( void  )

Definition at line 59 of file allocimbuf.c.

References BLI_spin_init(), and mmap_spin.

Referenced by IMB_init().

◆ imb_mmap_unlock()

void imb_mmap_unlock ( void  )

Definition at line 74 of file allocimbuf.c.

References BLI_spin_unlock(), and mmap_spin.

Referenced by IMB_loadifffile(), and imb_loadtilefile().

◆ imb_refcounter_lock_exit()

void imb_refcounter_lock_exit ( void  )

Definition at line 51 of file allocimbuf.c.

References BLI_spin_end(), and refcounter_spin.

Referenced by IMB_exit().

◆ imb_refcounter_lock_init()

void imb_refcounter_lock_init ( void  )

Definition at line 46 of file allocimbuf.c.

References BLI_spin_init(), and refcounter_spin.

Referenced by IMB_init().

◆ IMB_refImBuf()

void IMB_refImBuf ( struct ImBuf ibuf)

Variable Documentation

◆ mmap_spin

SpinLock mmap_spin
static

◆ refcounter_spin

SpinLock refcounter_spin
static