Blender V5.0
IMB_imbuf.hh File Reference

Go to the source code of this file.

Macros

#define FILTER_MASK_NULL   0
#define FILTER_MASK_MARGIN   1
#define FILTER_MASK_USED   2

Enumerations

enum class  IMBThumbLoadFlags { Zero = 0 , LoadLargeFiles = (1 << 0) }
enum  IMB_BlendMode {
  IMB_BLEND_MIX = 0 , IMB_BLEND_ADD = 1 , IMB_BLEND_SUB = 2 , IMB_BLEND_MUL = 3 ,
  IMB_BLEND_LIGHTEN = 4 , IMB_BLEND_DARKEN = 5 , IMB_BLEND_ERASE_ALPHA = 6 , IMB_BLEND_ADD_ALPHA = 7 ,
  IMB_BLEND_OVERLAY = 8 , IMB_BLEND_HARDLIGHT = 9 , IMB_BLEND_COLORBURN = 10 , IMB_BLEND_LINEARBURN = 11 ,
  IMB_BLEND_COLORDODGE = 12 , IMB_BLEND_SCREEN = 13 , IMB_BLEND_SOFTLIGHT = 14 , IMB_BLEND_PINLIGHT = 15 ,
  IMB_BLEND_VIVIDLIGHT = 16 , IMB_BLEND_LINEARLIGHT = 17 , IMB_BLEND_DIFFERENCE = 18 , IMB_BLEND_EXCLUSION = 19 ,
  IMB_BLEND_HUE = 20 , IMB_BLEND_SATURATION = 21 , IMB_BLEND_LUMINOSITY = 22 , IMB_BLEND_COLOR = 23 ,
  IMB_BLEND_INTERPOLATE = 24 , IMB_BLEND_COPY = 1000 , IMB_BLEND_COPY_RGB = 1001 , IMB_BLEND_COPY_ALPHA = 1002
}
enum  eIMBInterpolationFilterMode {
  IMB_FILTER_NEAREST , IMB_FILTER_BILINEAR , IMB_FILTER_CUBIC_BSPLINE , IMB_FILTER_CUBIC_MITCHELL ,
  IMB_FILTER_BOX
}
enum class  IMBScaleFilter { Nearest , Bilinear , Box }
enum  eIMBTransformMode { IMB_TRANSFORM_MODE_REGULAR = 0 , IMB_TRANSFORM_MODE_CROP_SRC = 1 , IMB_TRANSFORM_MODE_WRAP_REPEAT = 2 }
 Transform modes to use for IMB_transform function. More...

Functions

void IMB_init ()
void IMB_exit ()
ImBufIMB_load_image_from_memory (const unsigned char *mem, const size_t size, const int flags, const char *descr, const char *filepath=nullptr, char r_colorspace[IM_MAX_SPACE]=nullptr)
ImBufIMB_load_image_from_file_descriptor (const int file, const int flags, const char *filepath=nullptr, char r_colorspace[IM_MAX_SPACE]=nullptr)
ImBufIMB_load_image_from_filepath (const char *filepath, const int flags, char r_colorspace[IM_MAX_SPACE]=nullptr)
bool IMB_save_image (ImBuf *ibuf, const char *filepath, const int flags)
bool IMB_test_image (const char *filepath)
bool IMB_test_image_type_matches (const char *filepath, int filetype)
int IMB_test_image_type_from_memory (const unsigned char *buf, size_t buf_size)
int IMB_test_image_type (const char *filepath)
 ENUM_OPERATORS (IMBThumbLoadFlags, IMBThumbLoadFlags::LoadLargeFiles)
ImBufIMB_thumb_load_image (const char *filepath, const size_t max_thumb_size, char colorspace[IM_MAX_SPACE], const IMBThumbLoadFlags load_flags=IMBThumbLoadFlags::Zero)
ImBufIMB_allocImBuf (unsigned int x, unsigned int y, unsigned char planes, unsigned int flags)
void IMB_freeImBuf (ImBuf *ibuf)
bool IMB_initImBuf (ImBuf *ibuf, unsigned int x, unsigned int y, unsigned char planes, unsigned int flags)
ImBufIMB_allocFromBufferOwn (uint8_t *byte_buffer, float *float_buffer, unsigned int w, unsigned int h, unsigned int channels)
ImBufIMB_allocFromBuffer (const uint8_t *byte_buffer, const float *float_buffer, unsigned int w, unsigned int h, unsigned int channels)
void IMB_assign_byte_buffer (ImBuf *ibuf, uint8_t *buffer_data, ImBufOwnership ownership)
void IMB_assign_float_buffer (ImBuf *ibuf, float *buffer_data, ImBufOwnership ownership)
void IMB_assign_byte_buffer (ImBuf *ibuf, const ImBufByteBuffer &buffer, ImBufOwnership ownership)
void IMB_assign_float_buffer (ImBuf *ibuf, const ImBufFloatBuffer &buffer, ImBufOwnership ownership)
void IMB_assign_dds_data (ImBuf *ibuf, const DDSData &data, ImBufOwnership ownership)
void IMB_make_writable_byte_buffer (ImBuf *ibuf)
void IMB_make_writable_float_buffer (ImBuf *ibuf)
uint8_t * IMB_steal_byte_buffer (ImBuf *ibuf)
floatIMB_steal_float_buffer (ImBuf *ibuf)
uint8_t * IMB_steal_encoded_buffer (ImBuf *ibuf)
void IMB_refImBuf (ImBuf *ibuf)
ImBufIMB_makeSingleUser (ImBuf *ibuf)
ImBufIMB_dupImBuf (const ImBuf *ibuf1)
size_t IMB_get_size_in_memory (const ImBuf *ibuf)
size_t IMB_get_pixel_count (const ImBuf *ibuf)
 Get the length of the data of the given image buffer in pixels.
void IMB_blend_color_byte (unsigned char dst[4], const unsigned char src1[4], const unsigned char src2[4], IMB_BlendMode mode)
void IMB_blend_color_float (float dst[4], const float src1[4], const float src2[4], IMB_BlendMode mode)
void IMB_rect_crop (ImBuf *ibuf, const rcti *crop)
void IMB_rect_size_set (ImBuf *ibuf, const uint size[2])
void IMB_rectclip (ImBuf *dbuf, const ImBuf *sbuf, int *destx, int *desty, int *srcx, int *srcy, int *width, int *height)
void IMB_rectcpy (ImBuf *dbuf, const ImBuf *sbuf, int destx, int desty, int srcx, int srcy, int width, int height)
void IMB_rectblend (ImBuf *dbuf, const ImBuf *obuf, const ImBuf *sbuf, unsigned short *dmask, const unsigned short *curvemask, const unsigned short *texmask, float mask_max, int destx, int desty, int origx, int origy, int srcx, int srcy, int width, int height, IMB_BlendMode mode, bool accumulate)
void IMB_rectblend_threaded (ImBuf *dbuf, const ImBuf *obuf, const ImBuf *sbuf, unsigned short *dmask, const unsigned short *curvemask, const unsigned short *texmask, float mask_max, int destx, int desty, int origx, int origy, int srcx, int srcy, int width, int height, IMB_BlendMode mode, bool accumulate)
void IMB_mask_filter_extend (char *mask, int width, int height)
void IMB_mask_clear (ImBuf *ibuf, const char *mask, int val)
void IMB_filter_extend (ImBuf *ibuf, char *mask, int filter)
void IMB_filtery (ImBuf *ibuf)
bool IMB_scale (ImBuf *ibuf, unsigned int newx, unsigned int newy, IMBScaleFilter filter, bool threaded=true)
ImBufIMB_scale_into_new (const ImBuf *ibuf, unsigned int newx, unsigned int newy, IMBScaleFilter filter, bool threaded=true)
bool IMB_alpha_affects_rgb (const ImBuf *ibuf)
void IMB_byte_from_float (ImBuf *ibuf)
void IMB_float_from_byte_ex (ImBuf *dst, const ImBuf *src, const rcti *region_to_update)
void IMB_float_from_byte (ImBuf *ibuf)
void IMB_color_to_bw (ImBuf *ibuf)
void IMB_saturation (ImBuf *ibuf, float sat)
void IMB_buffer_byte_from_float (unsigned char *rect_to, const float *rect_from, int channels_from, float dither, int profile_to, int profile_from, bool predivide, int width, int height, int stride_to, int stride_from, int start_y=0)
void IMB_buffer_byte_from_float_mask (unsigned char *rect_to, const float *rect_from, int channels_from, float dither, bool predivide, int width, int height, int stride_to, int stride_from, char *mask)
void IMB_buffer_float_from_byte (float *rect_to, const unsigned char *rect_from, int profile_to, int profile_from, bool predivide, int width, int height, int stride_to, int stride_from)
void IMB_buffer_float_from_float (float *rect_to, const float *rect_from, int channels_from, int profile_to, int profile_from, bool predivide, int width, int height, int stride_to, int stride_from)
void IMB_buffer_float_from_float_threaded (float *rect_to, const float *rect_from, int channels_from, int profile_to, int profile_from, bool predivide, int width, int height, int stride_to, int stride_from)
void IMB_buffer_float_from_float_mask (float *rect_to, const float *rect_from, int channels_from, int width, int height, int stride_to, int stride_from, char *mask)
void IMB_buffer_byte_from_byte (unsigned char *rect_to, const unsigned char *rect_from, int profile_to, int profile_from, bool predivide, int width, int height, int stride_to, int stride_from)
void IMB_alpha_under_color_float (float *rect_float, int x, int y, float backcol[3])
void IMB_alpha_under_color_byte (unsigned char *rect, int x, int y, const float backcol[3])
void IMB_flipx (ImBuf *ibuf)
void IMB_flipy (ImBuf *ibuf)
bool IMB_rotate_orthogonal (ImBuf *ibuf, int degrees)
void IMB_premultiply_alpha (ImBuf *ibuf)
void IMB_unpremultiply_alpha (ImBuf *ibuf)
void IMB_rectfill (ImBuf *drect, const float col[4])
void IMB_rectfill_area (ImBuf *ibuf, const float scene_linear_color[4], int x1, int y1, int x2, int y2)
void IMB_rectfill_alpha (ImBuf *ibuf, float value)
void * imb_alloc_pixels (unsigned int x, unsigned int y, unsigned int channels, size_t typesize, bool initialize_pixels, const char *alloc_name)
bool IMB_alloc_byte_pixels (ImBuf *ibuf, bool initialize_pixels=true)
void IMB_free_byte_pixels (ImBuf *ibuf)
bool IMB_alloc_float_pixels (ImBuf *ibuf, const unsigned int channels, bool initialize_pixels=true)
void IMB_free_float_pixels (ImBuf *ibuf)
void IMB_free_all_data (ImBuf *ibuf)
void IMB_free_gpu_textures (ImBuf *ibuf)
void IMB_transform (const ImBuf *src, ImBuf *dst, eIMBTransformMode mode, eIMBInterpolationFilterMode filter, const blender::float3x3 &transform_matrix, const rctf *src_crop)
 Transform source image buffer onto destination image buffer using a transform matrix.
blender::gpu::TextureIMB_create_gpu_texture (const char *name, ImBuf *ibuf, bool use_high_bitdepth, bool use_premult)
blender::gpu::TextureFormat IMB_gpu_get_texture_format (const ImBuf *ibuf, bool high_bitdepth, bool use_grayscale)
bool IMB_gpu_get_compressed_format (const ImBuf *ibuf, blender::gpu::TextureFormat *r_texture_format)
void IMB_gpu_clamp_half_float (ImBuf *image_buffer)
blender::gpu::TextureIMB_touch_gpu_texture (const char *name, ImBuf *ibuf, int w, int h, int layers, bool use_high_bitdepth, bool use_grayscale)
void IMB_update_gpu_texture_sub (blender::gpu::Texture *tex, ImBuf *ibuf, int x, int y, int z, int w, int h, bool use_high_bitdepth, bool use_grayscale, bool use_premult)
void IMB_stereo3d_write_dimensions (char mode, bool is_squeezed, size_t width, size_t height, size_t *r_width, size_t *r_height)
void IMB_stereo3d_read_dimensions (char mode, bool is_squeezed, size_t width, size_t height, size_t *r_width, size_t *r_height)
ImBufIMB_stereo3d_ImBuf (const ImageFormatData *im_format, ImBuf *ibuf_left, ImBuf *ibuf_right)
void IMB_ImBufFromStereo3d (const Stereo3dFormat *s3d, ImBuf *ibuf_stereo3d, ImBuf **r_ibuf_left, ImBuf **r_ibuf_right)

Macro Definition Documentation

◆ FILTER_MASK_MARGIN

#define FILTER_MASK_MARGIN   1

Definition at line 289 of file IMB_imbuf.hh.

Referenced by IMB_filter_extend(), and IMB_mask_filter_extend().

◆ FILTER_MASK_NULL

#define FILTER_MASK_NULL   0

Definition at line 288 of file IMB_imbuf.hh.

◆ FILTER_MASK_USED

#define FILTER_MASK_USED   2

Enumeration Type Documentation

◆ eIMBInterpolationFilterMode

Enumerator
IMB_FILTER_NEAREST 
IMB_FILTER_BILINEAR 
IMB_FILTER_CUBIC_BSPLINE 
IMB_FILTER_CUBIC_MITCHELL 
IMB_FILTER_BOX 

Definition at line 280 of file IMB_imbuf.hh.

◆ eIMBTransformMode

Transform modes to use for IMB_transform function.

These are not flags as the combination of cropping and repeat can lead to different expectation.

Enumerator
IMB_TRANSFORM_MODE_REGULAR 

Do not crop or repeat.

IMB_TRANSFORM_MODE_CROP_SRC 

Crop the source buffer.

IMB_TRANSFORM_MODE_WRAP_REPEAT 

Wrap repeat the source buffer. Only supported in with nearest filtering.

Definition at line 526 of file IMB_imbuf.hh.

◆ IMB_BlendMode

Enumerator
IMB_BLEND_MIX 
IMB_BLEND_ADD 
IMB_BLEND_SUB 
IMB_BLEND_MUL 
IMB_BLEND_LIGHTEN 
IMB_BLEND_DARKEN 
IMB_BLEND_ERASE_ALPHA 
IMB_BLEND_ADD_ALPHA 
IMB_BLEND_OVERLAY 
IMB_BLEND_HARDLIGHT 
IMB_BLEND_COLORBURN 
IMB_BLEND_LINEARBURN 
IMB_BLEND_COLORDODGE 
IMB_BLEND_SCREEN 
IMB_BLEND_SOFTLIGHT 
IMB_BLEND_PINLIGHT 
IMB_BLEND_VIVIDLIGHT 
IMB_BLEND_LINEARLIGHT 
IMB_BLEND_DIFFERENCE 
IMB_BLEND_EXCLUSION 
IMB_BLEND_HUE 
IMB_BLEND_SATURATION 
IMB_BLEND_LUMINOSITY 
IMB_BLEND_COLOR 
IMB_BLEND_INTERPOLATE 
IMB_BLEND_COPY 
IMB_BLEND_COPY_RGB 
IMB_BLEND_COPY_ALPHA 

Definition at line 178 of file IMB_imbuf.hh.

◆ IMBScaleFilter

enum class IMBScaleFilter
strong

Interpolation filter used by IMB_scale.

Enumerator
Nearest 

No filtering (point sampling). This is fastest but lowest quality.

Bilinear 

Bilinear filter: each pixel in result image interpolates between 2x2 pixels of source image.

Box 

Box filter. Behaves exactly like Bilinear when scaling up, better results when scaling down by more than 2x.

Definition at line 305 of file IMB_imbuf.hh.

◆ IMBThumbLoadFlags

enum class IMBThumbLoadFlags
strong
Enumerator
Zero 
LoadLargeFiles 

Normally files larger than 100MB are not loaded for thumbnails, except when this flag is set.

Definition at line 68 of file IMB_imbuf.hh.

Function Documentation

◆ ENUM_OPERATORS()

◆ IMB_alloc_byte_pixels()

bool IMB_alloc_byte_pixels ( ImBuf * ibuf,
bool initialize_pixels = true )

◆ IMB_alloc_float_pixels()

◆ imb_alloc_pixels()

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().

◆ IMB_allocFromBuffer()

◆ IMB_allocFromBufferOwn()

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().

◆ IMB_allocImBuf()

ImBuf * IMB_allocImBuf ( unsigned int x,
unsigned int y,
unsigned char planes,
unsigned int flags )

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().

◆ IMB_alpha_affects_rgb()

◆ IMB_alpha_under_color_byte()

void IMB_alpha_under_color_byte ( unsigned char * rect,
int x,
int y,
const float backcol[3] )

◆ IMB_alpha_under_color_float()

void IMB_alpha_under_color_float ( float * rect_float,
int x,
int y,
float backcol[3] )

◆ IMB_assign_byte_buffer() [1/2]

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.

Note
Does not modify the topology (width, height, number of channels).
The ownership of the data in the source buffer is ignored.

Definition at line 417 of file allocimbuf.cc.

References ImBuf::byte_buffer, ImBufByteBuffer::colorspace, ImBufByteBuffer::data, and IMB_assign_byte_buffer().

◆ IMB_assign_byte_buffer() [2/2]

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.

Note
Does not modify the topology (width, height, number of channels).

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().

◆ IMB_assign_dds_data()

void IMB_assign_dds_data ( ImBuf * ibuf,
const DDSData & data,
ImBufOwnership ownership )

◆ IMB_assign_float_buffer() [1/2]

void IMB_assign_float_buffer ( ImBuf * ibuf,
const ImBufFloatBuffer & buffer,
ImBufOwnership ownership )

◆ IMB_assign_float_buffer() [2/2]

◆ IMB_blend_color_byte()

◆ IMB_blend_color_float()

void IMB_blend_color_float ( float dst[4],
const float src1[4],
const float src2[4],
IMB_BlendMode mode )

Definition at line 116 of file rectop.cc.

References blend_color_add_alpha_float(), blend_color_add_float(), blend_color_burn_float(), blend_color_color_float(), blend_color_darken_float(), blend_color_difference_float(), blend_color_dodge_float(), blend_color_erase_alpha_float(), blend_color_exclusion_float(), blend_color_hardlight_float(), blend_color_hue_float(), blend_color_lighten_float(), blend_color_linearburn_float(), blend_color_linearlight_float(), blend_color_luminosity_float(), blend_color_mix_float(), blend_color_mul_float(), blend_color_overlay_float(), blend_color_pinlight_float(), blend_color_saturation_float(), blend_color_screen_float(), blend_color_softlight_float(), blend_color_sub_float(), blend_color_vividlight_float(), IMB_BLEND_ADD, IMB_BLEND_ADD_ALPHA, IMB_BLEND_COLOR, IMB_BLEND_COLORBURN, IMB_BLEND_COLORDODGE, IMB_BLEND_DARKEN, IMB_BLEND_DIFFERENCE, IMB_BLEND_ERASE_ALPHA, IMB_BLEND_EXCLUSION, IMB_BLEND_HARDLIGHT, IMB_BLEND_HUE, IMB_BLEND_LIGHTEN, IMB_BLEND_LINEARBURN, IMB_BLEND_LINEARLIGHT, IMB_BLEND_LUMINOSITY, IMB_BLEND_MIX, IMB_BLEND_MUL, IMB_BLEND_OVERLAY, IMB_BLEND_PINLIGHT, IMB_BLEND_SATURATION, IMB_BLEND_SCREEN, IMB_BLEND_SOFTLIGHT, IMB_BLEND_SUB, and IMB_BLEND_VIVIDLIGHT.

Referenced by blender::ed::sculpt_paint::expand::colors_update_task(), blender::ed::sculpt_paint::color::do_paint_brush_task(), do_projectpaint_clone_f(), do_projectpaint_draw_f(), do_projectpaint_mask_f(), do_projectpaint_thread(), blender::ed::sculpt_paint::paint::image::PaintingKernel< ImageBuffer >::paint(), paint_2d_bucket_fill(), and paint_2d_gradient_fill().

◆ IMB_buffer_byte_from_byte()

void IMB_buffer_byte_from_byte ( unsigned char * rect_to,
const unsigned char * rect_from,
int profile_to,
int profile_from,
bool predivide,
int width,
int height,
int stride_to,
int stride_from )

◆ IMB_buffer_byte_from_float()

◆ IMB_buffer_byte_from_float_mask()

void IMB_buffer_byte_from_float_mask ( unsigned char * rect_to,
const float * rect_from,
int channels_from,
float dither,
bool predivide,
int width,
int height,
int stride_to,
int stride_from,
char * mask )

◆ IMB_buffer_float_from_byte()

void IMB_buffer_float_from_byte ( float * rect_to,
const unsigned char * rect_from,
int profile_to,
int profile_from,
bool predivide,
int width,
int height,
int stride_to,
int stride_from )

◆ IMB_buffer_float_from_float()

void IMB_buffer_float_from_float ( float * rect_to,
const float * rect_from,
int channels_from,
int profile_to,
int profile_from,
bool predivide,
int width,
int height,
int stride_to,
int stride_from )

◆ IMB_buffer_float_from_float_mask()

void IMB_buffer_float_from_float_mask ( float * rect_to,
const float * rect_from,
int channels_from,
int width,
int height,
int stride_to,
int stride_from,
char * mask )

Float to float pixels, output 4-channel RGBA.

Definition at line 483 of file conversion.cc.

References copy_v3_v3(), copy_v4_v4(), FILTER_MASK_USED, mask(), x, and y.

Referenced by blender::ed::object::write_internal_bake_pixels().

◆ IMB_buffer_float_from_float_threaded()

void IMB_buffer_float_from_float_threaded ( float * rect_to,
const float * rect_from,
int channels_from,
int profile_to,
int profile_from,
bool predivide,
int width,
int height,
int stride_to,
int stride_from )

◆ IMB_byte_from_float()

void IMB_byte_from_float ( ImBuf * ibuf)

Create char buffer, color corrected if necessary, for ImBufs that lack one.

Definition at line 605 of file conversion.cc.

References Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), ImBuf::byte_buffer, blender::StringRefNull::c_str(), ImBuf::channels, COLOR_ROLE_DEFAULT_BYTE, COLOR_ROLE_SCENE_LINEAR, ImBufByteBuffer::colorspace, ImBufFloatBuffer::colorspace, Array< T, InlineBufferCapacity, Allocator >::data(), ImBufByteBuffer::data, ImBufFloatBuffer::data, ImBuf::dither, IndexRange::first(), ImBuf::float_buffer, IB_PROFILE_SRGB, IB_RECT_INVALID, IMB_alloc_byte_pixels(), IMB_alpha_affects_rgb(), IMB_buffer_byte_from_float(), IMB_colormanagement_colorspace_processor_new(), IMB_colormanagement_processor_apply(), IMB_colormanagement_processor_free(), IMB_colormanagement_processor_is_noop(), IMB_colormanagement_role_colorspace_name_get(), IMB_get_pixel_count(), IMB_unpremultiply_rect_float(), blender::ocio::ColorSpace::name(), nullptr, blender::threading::parallel_for(), Array< T, InlineBufferCapacity, Allocator >::size(), IndexRange::size(), STREQ, ImBuf::userflags, and ImBuf::x.

Referenced by BKE_image_preview(), BKE_main_thumbnail_from_imbuf(), blender::seq::compositor_modifier_apply(), ED_view3d_draw_offscreen_imbuf(), icon_copy_rect(), image_flip_exec(), image_invert_exec(), blender::ed::greasepencil::image_render::image_render_end(), IMB_colormanagement_imbuf_for_write(), imb_load_hdr(), imb_load_jp2_stream(), imb_load_openexr(), imb_loadiris(), IMB_rotate_orthogonal(), imb_save_dpx_cineon(), IMB_save_image(), IMB_thumb_manage(), paint_2d_canvas_set(), blender::seq::prepare_effect_imbufs(), project_paint_op(), blender::ed::space_node::sample_apply(), screen_opengl_render_doit(), thumb_create_ex(), ui_draw_but_TRACKPREVIEW(), and ui_tooltip_from_clip().

◆ IMB_color_to_bw()

◆ IMB_create_gpu_texture()

◆ IMB_dupImBuf()

◆ IMB_exit()

◆ IMB_filter_extend()

void IMB_filter_extend ( ImBuf * ibuf,
char * mask,
int filter )

If alpha is zero, it checks surrounding pixels and averages color. sets new alphas to 1.0 When a mask is given, the mask will be used instead of the alpha channel, where only pixels with a mask value of 0 will be written to, and only pixels with a mask value of 1 will be used for the average. The mask will be set to one for the pixels which were written.

Definition at line 200 of file filter.cc.

References ImBuf::byte_buffer, check_pixel_assigned(), ImBufByteBuffer::data, ImBufFloatBuffer::data, filter, filter_make_index(), FILTER_MASK_MARGIN, float, ImBuf::float_buffer, i, mask(), MEM_dupallocN(), MEM_freeN(), nullptr, roundf, sqrt, ImBuf::x, x, ImBuf::y, and y.

Referenced by blender::render::texturemargin::generate_margin(), and RE_bake_margin().

◆ IMB_filtery()

◆ IMB_flipx()

◆ IMB_flipy()

◆ IMB_float_from_byte()

◆ IMB_float_from_byte_ex()

◆ IMB_free_all_data()

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().

◆ IMB_free_byte_pixels()

◆ IMB_free_float_pixels()

◆ IMB_free_gpu_textures()

void IMB_free_gpu_textures ( ImBuf * ibuf)

◆ IMB_freeImBuf()

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().

◆ IMB_get_pixel_count()

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().

◆ IMB_get_size_in_memory()

◆ IMB_gpu_clamp_half_float()

void IMB_gpu_clamp_half_float ( ImBuf * image_buffer)

Ensures that values stored in the float rect can safely loaded into half float gpu textures.

Does nothing when given image_buffer doesn't contain a float rect.

Definition at line 419 of file util_gpu.cc.

References ImBuf::channels, clamp_f(), ImBufFloatBuffer::data, ImBuf::float_buffer, i, ImBuf::x, and ImBuf::y.

◆ IMB_gpu_get_compressed_format()

◆ IMB_gpu_get_texture_format()

blender::gpu::TextureFormat IMB_gpu_get_texture_format ( const ImBuf * ibuf,
bool high_bitdepth,
bool use_grayscale )

Definition at line 410 of file util_gpu.cc.

References imb_gpu_get_format().

Referenced by uiTemplateImageInfo().

◆ IMB_ImBufFromStereo3d()

◆ IMB_init()

◆ IMB_initImBuf()

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

◆ IMB_load_image_from_file_descriptor()

ImBuf * IMB_load_image_from_file_descriptor ( const int file,
const int flags,
const char * filepath = nullptr,
char r_colorspace[IM_MAX_SPACE] = nullptr )

◆ IMB_load_image_from_filepath()

◆ IMB_load_image_from_memory()

◆ IMB_make_writable_byte_buffer()

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().

◆ IMB_make_writable_float_buffer()

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().

◆ IMB_makeSingleUser()

ImBuf * IMB_makeSingleUser ( ImBuf * ibuf)

◆ IMB_mask_clear()

void IMB_mask_clear ( ImBuf * ibuf,
const char * mask,
int val )

◆ IMB_mask_filter_extend()

void IMB_mask_filter_extend ( char * mask,
int width,
int height )

Definition at line 100 of file filter.cc.

References FILTER_MASK_MARGIN, mask(), MEM_dupallocN(), MEM_freeN(), x, and y.

◆ IMB_premultiply_alpha()

◆ IMB_rect_crop()

◆ IMB_rect_size_set()

void IMB_rect_size_set ( ImBuf * ibuf,
const uint size[2] )

◆ IMB_rectblend()

void IMB_rectblend ( ImBuf * dbuf,
const ImBuf * obuf,
const ImBuf * sbuf,
unsigned short * dmask,
const unsigned short * curvemask,
const unsigned short * texmask,
float mask_max,
int destx,
int desty,
int origx,
int origy,
int srcx,
int srcy,
int width,
int height,
IMB_BlendMode mode,
bool accumulate )

Definition at line 475 of file rectop.cc.

References blend_color_add_alpha_byte(), blend_color_add_alpha_float(), blend_color_add_byte(), blend_color_add_float(), blend_color_burn_byte(), blend_color_burn_float(), blend_color_color_byte(), blend_color_color_float(), blend_color_darken_byte(), blend_color_darken_float(), blend_color_difference_byte(), blend_color_difference_float(), blend_color_dodge_byte(), blend_color_dodge_float(), blend_color_erase_alpha_byte(), blend_color_erase_alpha_float(), blend_color_exclusion_byte(), blend_color_exclusion_float(), blend_color_hardlight_byte(), blend_color_hardlight_float(), blend_color_hue_byte(), blend_color_hue_float(), blend_color_interpolate_byte(), blend_color_interpolate_float(), blend_color_lighten_byte(), blend_color_lighten_float(), blend_color_linearburn_byte(), blend_color_linearburn_float(), blend_color_linearlight_byte(), blend_color_linearlight_float(), blend_color_luminosity_byte(), blend_color_luminosity_float(), blend_color_mix_byte(), blend_color_mix_float(), blend_color_mul_byte(), blend_color_mul_float(), blend_color_overlay_byte(), blend_color_overlay_float(), blend_color_pinlight_byte(), blend_color_pinlight_float(), blend_color_saturation_byte(), blend_color_saturation_float(), blend_color_screen_byte(), blend_color_screen_float(), blend_color_softlight_byte(), blend_color_softlight_float(), blend_color_sub_byte(), blend_color_sub_float(), blend_color_vividlight_byte(), blend_color_vividlight_float(), ImBuf::byte_buffer, ImBuf::channels, ImBufByteBuffer::data, ImBufFloatBuffer::data, divide_round_i(), float, ImBuf::float_buffer, IMB_BLEND_ADD, IMB_BLEND_ADD_ALPHA, IMB_BLEND_COLOR, IMB_BLEND_COLORBURN, IMB_BLEND_COLORDODGE, IMB_BLEND_COPY, IMB_BLEND_COPY_ALPHA, IMB_BLEND_COPY_RGB, IMB_BLEND_DARKEN, IMB_BLEND_DIFFERENCE, IMB_BLEND_ERASE_ALPHA, IMB_BLEND_EXCLUSION, IMB_BLEND_HARDLIGHT, IMB_BLEND_HUE, IMB_BLEND_INTERPOLATE, IMB_BLEND_LIGHTEN, IMB_BLEND_LINEARBURN, IMB_BLEND_LINEARLIGHT, IMB_BLEND_LUMINOSITY, IMB_BLEND_MIX, IMB_BLEND_MUL, IMB_BLEND_OVERLAY, IMB_BLEND_PINLIGHT, IMB_BLEND_SATURATION, IMB_BLEND_SCREEN, IMB_BLEND_SOFTLIGHT, IMB_BLEND_SUB, IMB_BLEND_VIVIDLIGHT, imb_rectclip3(), mask(), min_ff(), mul_v4_v4fl(), ImBuf::x, and x.

Referenced by IMB_rectblend_threaded(), IMB_rectcpy(), paint_2d_do_making_brush(), paint_2d_lift_clone(), and paint_2d_lift_smear().

◆ IMB_rectblend_threaded()

void IMB_rectblend_threaded ( ImBuf * dbuf,
const ImBuf * obuf,
const ImBuf * sbuf,
unsigned short * dmask,
const unsigned short * curvemask,
const unsigned short * texmask,
float mask_max,
int destx,
int desty,
int origx,
int origy,
int srcx,
int srcy,
int width,
int height,
IMB_BlendMode mode,
bool accumulate )

◆ IMB_rectclip()

void IMB_rectclip ( ImBuf * dbuf,
const ImBuf * sbuf,
int * destx,
int * desty,
int * srcx,
int * srcy,
int * width,
int * height )

◆ IMB_rectcpy()

void IMB_rectcpy ( ImBuf * dbuf,
const ImBuf * sbuf,
int destx,
int desty,
int srcx,
int srcy,
int width,
int height )

◆ IMB_rectfill()

void IMB_rectfill ( ImBuf * drect,
const float col[4] )

Replace pixels of entire image with solid color.

Parameters
drectAn image to be filled with color. It must be 4 channel image.
colRGBA color, which is assigned directly to both byte (via scaling) and float buffers.

Definition at line 978 of file rectop.cc.

References ImBuf::byte_buffer, col, ImBufByteBuffer::data, ImBufFloatBuffer::data, ImBuf::float_buffer, IMB_get_pixel_count(), num, and unit_float_to_uchar_clamp_v4.

Referenced by blender::io::usd::cache_image_color(), blender::ed::object::clear_single_image(), blender::seq::create_missing_media_image(), IMB_font_preview(), IMB_thumb_load_font(), and RE_bake_ibuf_clear().

◆ IMB_rectfill_alpha()

void IMB_rectfill_alpha ( ImBuf * ibuf,
float value )

◆ IMB_rectfill_area()

void IMB_rectfill_area ( ImBuf * ibuf,
const float scene_linear_color[4],
int x1,
int y1,
int x2,
int y2 )

Blend pixels of image area with solid color.

Parameters
ibufan image to be filled with color. It must be 4 channel image.
scene_linear_colorRGBA color in scene linear colorspace. For byte buffers, this is converted to the byte buffer colorspace.
x1,y1,x2,y2(x1, y1) defines starting point of the rectangular area to be filled, (x2, y2) is the end point. Note that values are allowed to be loosely ordered, which means that x2 is allowed to be lower than x1, as well as y2 is allowed to be lower than y1. No matter the order the area between x1 and x2, and y1 and y2 is filled.
colorspacecolor-space reference for display space.

Definition at line 1007 of file rectop.cc.

References BLI_assert, ImBuf::byte_buffer, CLAMP, col, ImBufByteBuffer::colorspace, copy_v3_v3(), ImBufByteBuffer::data, ImBufFloatBuffer::data, fb(), ImBuf::float_buffer, i, IMB_colormanagement_scene_linear_to_colorspace_v3(), IMB_colormanagement_scene_linear_to_srgb_v3(), unit_float_to_uchar_clamp(), ImBuf::x, and ImBuf::y.

Referenced by BKE_image_stamp_buf(), and UI_tooltip_color_field_add().

◆ IMB_refImBuf()

◆ IMB_rotate_orthogonal()

◆ IMB_saturation()

◆ IMB_save_image()

◆ IMB_scale()

◆ IMB_scale_into_new()

◆ IMB_steal_byte_buffer()

uint8_t * IMB_steal_byte_buffer ( ImBuf * ibuf)

Steal the buffer data pointer: the ImBuf is no longer an owner of this data.

Note
If the ImBuf does not own the data the behavior is undefined.
Stealing encoded buffer resets the encoded size.

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().

◆ IMB_steal_encoded_buffer()

uint8_t * IMB_steal_encoded_buffer ( ImBuf * ibuf)

◆ IMB_steal_float_buffer()

◆ IMB_stereo3d_ImBuf()

◆ IMB_stereo3d_read_dimensions()

void IMB_stereo3d_read_dimensions ( char mode,
bool is_squeezed,
size_t width,
size_t height,
size_t * r_width,
size_t * r_height )

◆ IMB_stereo3d_write_dimensions()

void IMB_stereo3d_write_dimensions ( char mode,
bool is_squeezed,
size_t width,
size_t height,
size_t * r_width,
size_t * r_height )

◆ IMB_test_image()

bool IMB_test_image ( const char * filepath)

◆ IMB_test_image_type()

int IMB_test_image_type ( const char * filepath)

◆ IMB_test_image_type_from_memory()

int IMB_test_image_type_from_memory ( const unsigned char * buf,
size_t buf_size )

◆ IMB_test_image_type_matches()

bool IMB_test_image_type_matches ( const char * filepath,
int filetype )

◆ IMB_thumb_load_image()

◆ IMB_touch_gpu_texture()

blender::gpu::Texture * IMB_touch_gpu_texture ( const char * name,
ImBuf * ibuf,
int w,
int h,
int layers,
bool use_high_bitdepth,
bool use_grayscale )

The ibuf is only here to detect the storage type. The produced texture will have undefined content. It will need to be populated by using IMB_update_gpu_texture_sub().

Definition at line 270 of file util_gpu.cc.

References GPU_texture_anisotropic_filter(), GPU_texture_create_2d(), GPU_texture_create_2d_array(), GPU_texture_swizzle_set(), GPU_TEXTURE_USAGE_SHADER_READ, imb_gpu_get_format(), imb_gpu_get_swizzle(), name, and w().

Referenced by gpu_texture_create_tile_array().

◆ IMB_transform()

void IMB_transform ( const ImBuf * src,
ImBuf * dst,
eIMBTransformMode mode,
eIMBInterpolationFilterMode filter,
const blender::float3x3 & transform_matrix,
const rctf * src_crop )

Transform source image buffer onto destination image buffer using a transform matrix.

Parameters
srcImage buffer to read from.
dstImage buffer to write to. rect or rect_float must already be initialized.
  • dst buffer must be a 4 channel buffers.
  • Only one data type buffer will be used (rect_float has priority over rect)
modeCropping/Wrap repeat effect to apply during transformation.
filterInterpolation to use during sampling.
transform_matrixTransformation matrix to use. The given matrix should transform between dst pixel space to src pixel space. One unit is one pixel.
src_cropCropping region how to crop the source buffer. Should only be passed when mode is set to IMB_TRANSFORM_MODE_CROP_SRC. For any other mode this should be empty.

During transformation no data/color conversion will happens. When transforming between float images the number of channels of the source buffer may be between 1 and 4. When source buffer has one channel the data will be read as a gray scale value.

Definition at line 467 of file imbuf/intern/transform.cc.

References BLI_assert_msg, ImBuf::channels, blender::imbuf::transform::TransformContext::dst, blender::imbuf::transform::TransformContext::dst_region_y_range, filter, if(), IMB_FILTER_BILINEAR, IMB_FILTER_BOX, IMB_FILTER_CUBIC_BSPLINE, IMB_FILTER_CUBIC_MITCHELL, IMB_TRANSFORM_MODE_CROP_SRC, blender::imbuf::transform::TransformContext::init(), blender::imbuf::transform::TransformContext::mode, blender::threading::parallel_for(), blender::imbuf::transform::TransformContext::src, blender::imbuf::transform::TransformContext::src_crop, and blender::imbuf::transform::transform_scanlines_filter().

Referenced by blender::seq::sequencer_preprocess_transform_crop(), blender::imbuf::tests::TEST(), blender::imbuf::tests::transform_2x_smaller(), and blender::imbuf::tests::transform_fractional_larger().

◆ IMB_unpremultiply_alpha()

◆ IMB_update_gpu_texture_sub()

void IMB_update_gpu_texture_sub ( blender::gpu::Texture * tex,
ImBuf * ibuf,
int x,
int y,
int z,
int w,
int h,
bool use_high_bitdepth,
bool use_grayscale,
bool use_premult )

Will update a blender::gpu::Texture using the content of the ImBuf. Only one layer will be updated. Will resize the ibuf if needed. Z is the layer to update. Unused if the texture is 2D.

Definition at line 296 of file util_gpu.cc.

References data, GPU_texture_update_sub(), imb_gpu_get_data(), imb_gpu_get_format(), MEM_freeN(), size(), w(), ImBuf::x, x, ImBuf::y, y, and z().

Referenced by gpu_texture_create_tile_array().