Blender  V3.3
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)
 
voidimb_alloc_pixels (unsigned int x, unsigned int y, unsigned int channels, size_t typesize, const char *name)
 
bool imb_addrectfloatImBuf (ImBuf *ibuf, const unsigned int channels)
 
bool imb_addrectImBuf (ImBuf *ibuf)
 
struct ImBufIMB_allocFromBufferOwn (unsigned int *rect, float *rectf, unsigned int w, unsigned int h, unsigned int channels)
 
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_rect_len (const ImBuf *ibuf)
 
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,
const unsigned int  channels 
)

◆ imb_addrectImBuf()

bool imb_addrectImBuf ( ImBuf ibuf)

◆ imb_addtilesImBuf()

bool imb_addtilesImBuf ( ImBuf ibuf)

Definition at line 484 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_allocFromBufferOwn()

struct ImBuf* IMB_allocFromBufferOwn ( unsigned int *  rect,
float rectf,
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).

Attention
Defined in allocimbuf.c

Definition at line 415 of file allocimbuf.c.

References BLI_assert, ImBuf::channels, channels(), ImBuf::flags, IB_rect, IB_rectfloat, IMB_allocImBuf(), ImBuf::mall, MEM_allocN_len, NULL, ImBuf::rect, ImBuf::rect_float, and w().

Referenced by blend_file_thumb_from_screenshot(), studiolight_calculate_irradiance_equirect_image(), and studiolight_load_equirect_image().

◆ 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 500 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(), 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(), colormanage_cache_put(), blender::compositor::OutputStereoOperation::deinit_execution(), blender::compositor::OutputSingleLayerOperation::deinit_execution(), dynamicPaint_outputSurfaceImage(), ED_view3d_draw_offscreen_imbuf(), FloatBufferCache::ensure_float_buffer(), blender::compositor::DebugInfo::export_operation(), filelist_init_icons(), float_image_to_ibuf(), gpencil_render_offscreen(), GHOST_SystemCocoa::handleDraggingEvent(), ibJpegImageFromCinfo(), image_acquire_ibuf(), image_get_ibuf_multilayer(), image_get_render_result(), image_load_sequence_multilayer(), IMB_allocFromBuffer(), IMB_allocFromBufferOwn(), 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_filepath_thumbnail_openexr(), imb_load_jp2_stream(), imb_load_openexr(), imb_loadhdr(), imb_loadiris(), imb_loadpng(), imb_loadtarga(), imb_loadtiff(), imb_loadwebp(), 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(), RE_render_result_rect_to_ibuf(), Freestyle::SteerableViewMap::saveSteerableViewMap(), screen_opengl_render_doit(), screenshot_exec(), seq_disk_cache_read_file(), seq_get_uncached_thumbnail(), 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)

◆ imb_freemipmapImBuf()

void imb_freemipmapImBuf ( ImBuf ibuf)

◆ imb_freerectfloatImBuf()

void imb_freerectfloatImBuf ( struct ImBuf ibuf)

◆ imb_freerectImBuf()

void imb_freerectImBuf ( struct ImBuf ibuf)

◆ imb_freerectImbuf_all()

void imb_freerectImbuf_all ( struct ImBuf ibuf)

Free all pixel data (associated with image size).

Definition at line 182 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 154 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_rect_len()

size_t IMB_get_rect_len ( const ImBuf ibuf)

Definition at line 650 of file allocimbuf.c.

References ImBuf::x, and ImBuf::y.

◆ 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  )

◆ imb_mmap_lock_exit()

void imb_mmap_lock_exit ( void  )

Definition at line 48 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 43 of file allocimbuf.c.

References BLI_spin_init(), and mmap_spin.

Referenced by IMB_init().

◆ imb_mmap_unlock()

void imb_mmap_unlock ( void  )

◆ imb_refcounter_lock_exit()

void imb_refcounter_lock_exit ( void  )

Definition at line 35 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 30 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