Blender V5.3
IMB_imbuf.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 * SPDX-FileCopyrightText: 2025 Blender Authors
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later */
5
9
10#pragma once
11
12#include "../gpu/GPU_texture.hh"
13
14#include "BLI_enum_flags.hh"
17#include "BLI_span.hh"
18#include "BLI_vector.hh"
19
20#include "IMB_imbuf_types.hh"
21
22namespace blender {
23
24struct ImBuf;
25struct rctf;
26struct rcti;
27
29struct ImageFormatData;
30struct Stereo3dFormat;
31
33struct Changes;
34}
35
39void IMB_init();
40void IMB_exit();
41
48
52ImBuf *IMB_load_image_from_memory(const unsigned char *mem,
53 size_t size,
54 ImBufFlags flags,
55 const char *descr,
56 const char *filepath = nullptr,
57 ColorManagedColorspaceSettings *colorspace_settings = nullptr);
58
60 int file,
61 ImBufFlags flags,
62 const char *filepath = nullptr,
63 ColorManagedColorspaceSettings *colorspace_settings = nullptr);
64
65ImBuf *IMB_load_image_from_filepath(const char *filepath,
66 ImBufFlags flags,
67 ColorManagedColorspaceSettings *colorspace_settings = nullptr);
68
72bool IMB_save_image(ImBuf *ibuf, const char *filepath, ImBufFlags flags);
74
78bool IMB_test_image(const char *filepath);
79bool IMB_test_image_type_matches(const char *filepath, eImbFileType filetype);
80eImbFileType IMB_test_image_type_from_memory(const unsigned char *buf, size_t buf_size);
81eImbFileType IMB_test_image_type(const char *filepath);
82
87
91const char *IMB_ftype_to_id(eImbFileType ftype);
92
96eImbFileType IMB_ftype_from_id(const char *id);
97
101const char **IMB_ftype_file_extensions(eImbFileType ftype);
102
107
112
117 Zero = 0,
121 LoadLargeFiles = (1 << 0),
122};
124
125ImBuf *IMB_thumb_load_image(const char *filepath,
126 size_t max_thumb_size,
127 ColorManagedColorspaceSettings *colorspace_settings,
129
133ImBuf *IMB_allocImBuf(unsigned int x, unsigned int y, ImBufFlags flags);
134void IMB_freeImBuf(ImBuf *ibuf);
135
141bool IMB_initImBuf(ImBuf *ibuf, unsigned int x, unsigned int y, ImBufFlags flags);
142
148 float *float_buffer,
149 unsigned int w,
150 unsigned int h,
151 unsigned int channels);
152
156ImBuf *IMB_allocFromBuffer(const uint8_t *byte_buffer,
157 const float *float_buffer,
158 unsigned int w,
159 unsigned int h,
160 unsigned int channels);
161
168
176void IMB_ensure_host_buffer(ImBuf *ibuf);
177
183
184void IMB_refImBuf(ImBuf *ibuf);
186
187ImBuf *IMB_dupImBuf(const ImBuf *ibuf1);
188
192size_t IMB_get_size_in_memory(const ImBuf *ibuf);
193
201size_t IMB_get_pixel_count(const ImBuf *ibuf);
202
233
234void IMB_blend_color_byte(unsigned char dst[4],
235 const unsigned char src1[4],
236 const unsigned char src2[4],
237 IMB_BlendMode mode);
238void IMB_blend_color_float(float dst[4],
239 const float src1[4],
240 const float src2[4],
241 IMB_BlendMode mode);
242void IMB_blend_color_float(MutableSpan<float4> dst,
243 Span<float4> src1,
244 Span<float4> src2,
245 IMB_BlendMode mode);
246
252void IMB_copy_rect(float *dst,
253 const int2 &dst_size,
254 const float *src,
255 const int2 &src_size,
256 int channels,
257 const int2 &src_rect_pos,
258 const int2 &dst_rect_pos,
259 const int2 &rect_size);
260void IMB_copy_rect(uchar *dst,
261 const int2 &dst_size,
262 const uchar *src,
263 const int2 &src_size,
264 const int2 &src_rect_pos,
265 const int2 &dst_rect_pos,
266 const int2 &rect_size);
267
271void IMB_crop(ImBuf *ibuf, const int2 &rect_pos, const int2 &rect_size);
272
277void IMB_copy_rect(ImBuf *dst,
278 const ImBuf *src,
279 const int2 &src_rect_pos,
280 const int2 &dst_rect_pos,
281 const int2 &rect_size);
282
286void IMB_rect_size_set(ImBuf *ibuf, const uint size[2]);
287
288void IMB_rectclip(ImBuf *dbuf,
289 const ImBuf *sbuf,
290 int *destx,
291 int *desty,
292 int *srcx,
293 int *srcy,
294 int *width,
295 int *height);
296void IMB_rectblend_threaded(ImBuf *dbuf,
297 const ImBuf *obuf,
298 const ImBuf *sbuf,
299 unsigned short *dmask,
300 const unsigned short *curvemask,
301 const unsigned short *texmask,
302 float mask_max,
303 int destx,
304 int desty,
305 int origx,
306 int origy,
307 int srcx,
308 int srcy,
309 int width,
310 int height,
311 IMB_BlendMode mode,
312 bool accumulate);
317void IMB_rectblend(ImBuf *dbuf,
318 uint8_t *dbuf_byte_data,
319 float *dbuf_float_data,
320 const ImBuf *obuf,
321 const ImBuf *sbuf,
322 unsigned short *dmask,
323 const unsigned short *curvemask,
324 const unsigned short *texmask,
325 float mask_max,
326 int destx,
327 int desty,
328 int origx,
329 int origy,
330 int srcx,
331 int srcy,
332 int width,
333 int height,
334 IMB_BlendMode mode,
335 bool accumulate);
336
344
345#define FILTER_MASK_NULL 0
346#define FILTER_MASK_MARGIN 1
347#define FILTER_MASK_USED 2
348
349void IMB_mask_filter_extend(char *mask, int width, int height);
350void IMB_mask_clear(ImBuf *ibuf, const char *mask, int val);
357void IMB_filter_extend(ImBuf *ibuf, char *mask, int filter);
358
359void IMB_filtery(ImBuf *ibuf);
360
362enum class IMBScaleFilter {
368 Bilinear,
374};
375
376void IMB_scale_box(const float *src_buffer,
377 int2 src_size,
378 int channels,
379 float *dst_buffer,
380 int2 dst_size,
381 bool threaded,
382 int src_stride = 0);
383void IMB_scale_box(const uchar *src_buffer,
384 int2 src_size,
385 int channels,
386 uchar *dst_buffer,
387 int2 dst_size,
388 bool threaded,
389 int src_stride = 0);
390
395bool IMB_scale(ImBuf *ibuf, int2 new_size, IMBScaleFilter filter, bool threaded = true);
396inline bool IMB_scale(
397 ImBuf *ibuf, unsigned int newx, unsigned int newy, IMBScaleFilter filter, bool threaded = true)
398{
399 return IMB_scale(ibuf, int2(newx, newy), filter, threaded);
400}
401
406ImBuf *IMB_scale_into_new(const ImBuf *ibuf,
407 int2 new_size,
408 IMBScaleFilter filter,
409 bool threaded = true);
410inline ImBuf *IMB_scale_into_new(const ImBuf *ibuf,
411 unsigned int newx,
412 unsigned int newy,
414 bool threaded = true)
415{
416 return IMB_scale_into_new(ibuf, int2(newx, newy), filter, threaded);
417}
418
422bool IMB_alpha_affects_rgb(const ImBuf *ibuf);
423
427void IMB_byte_from_float(ImBuf *ibuf);
428void IMB_float_from_byte_ex(ImBuf *dst, const ImBuf *src, const rcti *region_to_update);
429void IMB_float_from_byte(ImBuf *ibuf);
430void IMB_color_to_bw(ImBuf *ibuf);
431void IMB_saturation(ImBuf *ibuf, float sat);
432
444void IMB_buffer_byte_from_float(unsigned char *dest,
445 const float *src,
446 int src_channels,
447 float dither,
448 bool predivide,
449 int width,
450 int height,
451 int stride,
452 int start_y = 0);
457void IMB_buffer_byte_from_float_mask(unsigned char *dest,
458 const float *src,
459 int src_channels,
460 float dither,
461 int width,
462 int height,
463 const char *mask);
474 float *dest, const unsigned char *src, int width, int height, int dest_stride, int src_stride);
475
485 float *dest, const float *src, int src_channels, int width, int height);
486
492 float *dest, const float *src, int src_channels, int width, int height, const char *mask);
493
494void IMB_buffer_float_rgba_srgb_to_linear(float *buffer, int width, int height);
495
496void IMB_alpha_under_color_float(float *rect_float, int x, int y, float backcol[3]);
497void IMB_alpha_under_color_byte(unsigned char *rect, int x, int y, const float backcol[3]);
498
499void IMB_flipx(ImBuf *ibuf);
500void IMB_flipy(ImBuf *ibuf);
501
503bool IMB_rotate_orthogonal(ImBuf *ibuf, int degrees);
504
505/* Pre-multiply alpha. */
506
507void IMB_premultiply_alpha(ImBuf *ibuf);
508void IMB_unpremultiply_alpha(ImBuf *ibuf);
509
515void IMB_rectfill(ImBuf *drect, const float col[4]);
528 ImBuf *ibuf, const float scene_linear_color[4], int x1, int y1, int x2, int y2);
529void IMB_rectfill_alpha(ImBuf *ibuf, float value);
530
534void *imb_alloc_pixels(unsigned int x,
535 unsigned int y,
536 unsigned int channels,
537 size_t typesize,
538 bool initialize_pixels,
539 const char *alloc_name);
540
545bool IMB_alloc_byte_pixels(ImBuf *ibuf, bool initialize_pixels = true);
546
550void IMB_free_byte_pixels(ImBuf *ibuf);
551
556bool IMB_alloc_float_pixels(ImBuf *ibuf, unsigned int channels, bool initialize_pixels = true);
560void IMB_free_float_pixels(ImBuf *ibuf);
561
563void IMB_free_all_data(ImBuf *ibuf);
564
569void IMB_free_gpu_textures(ImBuf *ibuf);
570
584
604void IMB_transform(const ImBuf *src,
605 ImBuf *dst,
608 const float3x3 &transform_matrix,
609 const rctf *src_crop);
610
613 HighBitDepth = 1 << 0,
617 LimitSize = 1 << 2,
620};
622
623
626gpu::Texture *IMB_create_gpu_texture(const char *name, ImBuf *ibuf, GPUTextureCreateFlags flags);
627
628/* Acquire the GPU texture of the image buffer, creating it if it does not exist yet (with
629 * #IMB_create_gpu_texture), and return an owned reference to it.
630 *
631 * If #try_only is true, the texture is not created and null is returned when it does not exist
632 * yet. */
633gpu::Texture *IMB_acquire_gpu_texture(const char *name,
634 ImBuf *ibuf,
635 GPUTextureCreateFlags texture_create_flags,
636 bool try_only = false);
637
639 bool high_bitdepth,
640 bool use_grayscale);
641
642bool IMB_gpu_get_compressed_format(const ImBuf *ibuf, gpu::TextureFormat *r_texture_format);
643
649void IMB_gpu_clamp_half_float(ImBuf *image_buffer);
650
655gpu::Texture *IMB_touch_gpu_texture(const char *name,
656 ImBuf *ibuf,
657 int w,
658 int h,
659 int layers,
660 bool use_high_bitdepth,
661 bool use_grayscale);
662
667void IMB_update_gpu_texture_sub(gpu::Texture *tex,
668 ImBuf *ibuf,
669 int x,
670 int y,
671 int z,
672 int w,
673 int h,
674 bool use_grayscale,
675 bool use_premult);
676
683void IMB_gpu_texture_apply_partial_update(gpu::Texture *tex,
684 ImBuf *ibuf,
685 bool store_premultiplied,
686 const imbuf::partial_update::Changes &changes,
687 int layer = -1,
688 int2 tile_offset = int2(0),
689 int2 tile_size = int2(0));
690
692 char mode, bool is_squeezed, size_t width, size_t height, size_t *r_width, size_t *r_height);
694 char mode, bool is_squeezed, size_t width, size_t height, size_t *r_width, size_t *r_height);
698ImBuf *IMB_stereo3d_ImBuf(const ImageFormatData *im_format, ImBuf *ibuf_left, ImBuf *ibuf_right);
702void IMB_ImBufFromStereo3d(const Stereo3dFormat *s3d,
703 ImBuf *ibuf_stereo3d,
704 ImBuf **r_ibuf_left,
705 ImBuf **r_ibuf_right);
706
707} // namespace blender
#define ENUM_OPERATORS(_enum_type)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
Definition btQuadWord.h:117
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119
#define layer
constexpr T degrees(T) RET
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
unsigned int uchar
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
ENUM_OPERATORS(Layer::Flags)
BMesh Iterators.
void IMB_alpha_under_color_byte(unsigned char *rect, int x, int y, const float backcol[3])
bool IMB_test_image_type_matches(const char *filepath, eImbFileType filetype)
bool IMB_rotate_orthogonal(ImBuf *ibuf, int degrees)
eImbFileType IMB_ftype_from_id(const char *id)
Definition filetype.cc:354
void IMB_buffer_float_rgba_srgb_to_linear(float *buffer, int width, int height)
void IMB_mask_filter_extend(char *mask, int width, int height)
Definition filter.cc:102
void IMB_activate_gpu_context()
Definition module.cc:53
void IMB_float_from_byte_ex(ImBuf *dst, const ImBuf *src, const rcti *region_to_update)
const char ** IMB_ftype_file_extensions(eImbFileType ftype)
Definition filetype.cc:364
ImBuf * IMB_makeSingleUser(ImBuf *ibuf)
void IMB_buffer_float_from_byte(float *dest, const unsigned char *src, int width, int height, int dest_stride, int src_stride)
void IMB_free_byte_pixels(ImBuf *ibuf)
bool IMB_gpu_get_compressed_format(const ImBuf *ibuf, gpu::TextureFormat *r_texture_format)
Definition util_gpu.cc:115
void IMB_saturation(ImBuf *ibuf, float sat)
void IMB_assign_gpu_texture(ImBuf *ibuf, gpu::Texture *texture)
Definition util_gpu.cc:850
ImBuf * IMB_allocFromBufferOwn(uint8_t *byte_buffer, float *float_buffer, unsigned int w, unsigned int h, unsigned int channels)
GPUTextureCreateFlags
Definition IMB_imbuf.hh:611
void IMB_rectfill_alpha(ImBuf *ibuf, float value)
Definition rectop.cc:1309
unsigned int uint
Definition BKE_text.h:55
void IMB_unpremultiply_alpha(ImBuf *ibuf)
Definition filter.cc:444
void IMB_mask_clear(ImBuf *ibuf, const char *mask, int val)
Definition filter.cc:146
size_t IMB_get_pixel_count(const ImBuf *ibuf)
Get the length of the data of the given image buffer in pixels.
Vector< uint8_t > IMB_save_image_to_buffer(ImBuf *ibuf, ImBufFlags flags)
Definition writeimage.cc:64
const char * IMB_ftype_to_id(eImbFileType ftype)
Definition filetype.cc:348
bool IMB_alloc_byte_pixels(ImBuf *ibuf, bool initialize_pixels=true)
void IMB_ensure_gpu_context()
Definition module.cc:42
void IMB_rect_size_set(ImBuf *ibuf, const uint size[2])
Definition rectop.cc:489
@ IMB_BLEND_COLOR
Definition IMB_imbuf.hh:227
@ IMB_BLEND_HARDLIGHT
Definition IMB_imbuf.hh:213
@ IMB_BLEND_COPY_RGB
Definition IMB_imbuf.hh:230
@ IMB_BLEND_COLORBURN
Definition IMB_imbuf.hh:214
@ IMB_BLEND_SOFTLIGHT
Definition IMB_imbuf.hh:218
@ IMB_BLEND_COPY_ALPHA
Definition IMB_imbuf.hh:231
@ IMB_BLEND_SCREEN
Definition IMB_imbuf.hh:217
@ IMB_BLEND_VIVIDLIGHT
Definition IMB_imbuf.hh:220
@ IMB_BLEND_DARKEN
Definition IMB_imbuf.hh:209
@ IMB_BLEND_ADD_ALPHA
Definition IMB_imbuf.hh:211
@ IMB_BLEND_PINLIGHT
Definition IMB_imbuf.hh:219
@ IMB_BLEND_INTERPOLATE
Definition IMB_imbuf.hh:228
@ IMB_BLEND_MUL
Definition IMB_imbuf.hh:207
@ IMB_BLEND_LINEARBURN
Definition IMB_imbuf.hh:215
@ IMB_BLEND_COLORDODGE
Definition IMB_imbuf.hh:216
@ IMB_BLEND_DIFFERENCE
Definition IMB_imbuf.hh:222
@ IMB_BLEND_HUE
Definition IMB_imbuf.hh:224
@ IMB_BLEND_SUB
Definition IMB_imbuf.hh:206
@ IMB_BLEND_OVERLAY
Definition IMB_imbuf.hh:212
@ IMB_BLEND_LINEARLIGHT
Definition IMB_imbuf.hh:221
@ IMB_BLEND_SATURATION
Definition IMB_imbuf.hh:225
@ IMB_BLEND_EXCLUSION
Definition IMB_imbuf.hh:223
@ IMB_BLEND_MIX
Definition IMB_imbuf.hh:204
@ IMB_BLEND_ERASE_ALPHA
Definition IMB_imbuf.hh:210
@ IMB_BLEND_LIGHTEN
Definition IMB_imbuf.hh:208
@ IMB_BLEND_LUMINOSITY
Definition IMB_imbuf.hh:226
@ IMB_BLEND_ADD
Definition IMB_imbuf.hh:205
void IMB_rectfill(ImBuf *drect, const float col[4])
Definition rectop.cc:1165
gpu::TextureFormat IMB_gpu_get_texture_format(const ImBuf *ibuf, bool high_bitdepth, bool use_grayscale)
Definition util_gpu.cc:826
void IMB_refImBuf(ImBuf *ibuf)
void IMB_buffer_byte_from_float(unsigned char *dest, const float *src, int src_channels, float dither, bool predivide, int width, int height, int stride, int start_y=0)
Definition conversion.cc:50
bool IMB_initImBuf(ImBuf *ibuf, unsigned int x, unsigned int y, ImBufFlags flags)
void IMB_rectfill_area(ImBuf *ibuf, const float scene_linear_color[4], int x1, int y1, int x2, int y2)
Definition rectop.cc:1194
ImBuf * IMB_stereo3d_ImBuf(const ImageFormatData *im_format, ImBuf *ibuf_left, ImBuf *ibuf_right)
void IMB_crop(ImBuf *ibuf, const int2 &rect_pos, const int2 &rect_size)
Definition rectop.cc:470
void IMB_buffer_byte_from_float_mask(unsigned char *dest, const float *src, int src_channels, float dither, int width, int height, const char *mask)
size_t IMB_get_size_in_memory(const ImBuf *ibuf)
ImBuf * IMB_dupImBuf(const ImBuf *ibuf1)
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_save_image(ImBuf *ibuf, const char *filepath, ImBufFlags flags)
Definition writeimage.cc:40
void IMB_float_from_byte(ImBuf *ibuf)
ImBuf * IMB_load_image_from_filepath(const char *filepath, ImBufFlags flags, ColorManagedColorspaceSettings *colorspace_settings=nullptr)
Definition readimage.cc:201
void IMB_transform(const ImBuf *src, ImBuf *dst, eIMBTransformMode mode, eIMBInterpolationFilterMode filter, const float3x3 &transform_matrix, const rctf *src_crop)
Transform source image buffer onto destination image buffer using a transform matrix.
void IMB_rectblend(ImBuf *dbuf, uint8_t *dbuf_byte_data, float *dbuf_float_data, 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 rectop.cc:649
IMBThumbLoadFlags
Definition IMB_imbuf.hh:116
void IMB_stereo3d_read_dimensions(char mode, bool is_squeezed, size_t width, size_t height, size_t *r_width, size_t *r_height)
void IMB_freeImBuf(ImBuf *ibuf)
VecBase< int32_t, 2 > int2
void IMB_gpu_clamp_half_float(ImBuf *image_buffer)
Definition util_gpu.cc:866
unsigned char uint8_t
Definition BKE_text.h:79
void IMB_flipx(ImBuf *ibuf)
eImFileTypeCapability IMB_ftype_capability_read(eImbFileType ftype)
Definition filetype.cc:370
void IMB_flipy(ImBuf *ibuf)
void IMB_init()
Definition module.cc:26
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_scale_box(const float *src_buffer, int2 src_size, int channels, float *dst_buffer, int2 dst_size, bool threaded, int src_stride=0)
Definition scaling.cc:351
void IMB_ensure_host_buffer(ImBuf *ibuf)
void IMB_rectclip(ImBuf *dbuf, const ImBuf *sbuf, int *destx, int *desty, int *srcx, int *srcy, int *width, int *height)
Definition rectop.cc:511
void IMB_blend_color_float(float dst[4], const float src1[4], const float src2[4], IMB_BlendMode mode)
Definition rectop.cc:118
void IMB_buffer_float_rgba_from_float(float *dest, const float *src, int src_channels, int width, int height)
void IMB_gpu_texture_apply_partial_update(gpu::Texture *tex, ImBuf *ibuf, bool store_premultiplied, const imbuf::partial_update::Changes &changes, int layer=-1, int2 tile_offset=int2(0), int2 tile_size=int2(0))
Definition util_gpu.cc:686
void IMB_color_to_bw(ImBuf *ibuf)
eIMBInterpolationFilterMode
Definition IMB_imbuf.hh:337
@ IMB_FILTER_NEAREST
Definition IMB_imbuf.hh:338
@ IMB_FILTER_BOX
Definition IMB_imbuf.hh:342
@ IMB_FILTER_CUBIC_BSPLINE
Definition IMB_imbuf.hh:340
@ IMB_FILTER_CUBIC_MITCHELL
Definition IMB_imbuf.hh:341
@ IMB_FILTER_BILINEAR
Definition IMB_imbuf.hh:339
void IMB_buffer_float_rgba_from_float_mask(float *dest, const float *src, int src_channels, int width, int height, const char *mask)
eImFileTypeCapability IMB_ftype_capability_write(eImbFileType ftype)
Definition filetype.cc:376
ImBuf * IMB_allocImBuf(unsigned int x, unsigned int y, ImBufFlags flags)
bool IMB_alpha_affects_rgb(const ImBuf *ibuf)
Definition conversion.cc:45
bool IMB_ftype_is_supported(eImbFileType ftype)
Definition filetype.cc:343
eImbFileType IMB_test_image_type(const char *filepath)
ImBuf * IMB_load_image_from_memory(const unsigned char *mem, size_t size, ImBufFlags flags, const char *descr, const char *filepath=nullptr, ColorManagedColorspaceSettings *colorspace_settings=nullptr)
Definition readimage.cc:132
void IMB_update_gpu_texture_sub(gpu::Texture *tex, ImBuf *ibuf, int x, int y, int z, int w, int h, bool use_grayscale, bool use_premult)
Definition util_gpu.cc:428
eImbFileType IMB_test_image_type_from_memory(const unsigned char *buf, size_t buf_size)
void IMB_ImBufFromStereo3d(const Stereo3dFormat *s3d, ImBuf *ibuf_stereo3d, ImBuf **r_ibuf_left, ImBuf **r_ibuf_right)
void IMB_byte_from_float(ImBuf *ibuf)
gpu::Texture * IMB_acquire_gpu_texture(const char *name, ImBuf *ibuf, GPUTextureCreateFlags texture_create_flags, bool try_only=false)
Definition util_gpu.cc:778
gpu::Texture * IMB_create_gpu_texture(const char *name, ImBuf *ibuf, GPUTextureCreateFlags flags)
Definition util_gpu.cc:452
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)
Definition rectop.cc:1116
ImBuf * IMB_allocFromBuffer(const uint8_t *byte_buffer, const float *float_buffer, unsigned int w, unsigned int h, unsigned int channels)
bool IMB_test_image(const char *filepath)
void IMB_free_gpu_textures(ImBuf *ibuf)
Definition util_gpu.cc:835
void IMB_free_all_data(ImBuf *ibuf)
void IMB_filter_extend(ImBuf *ibuf, char *mask, int filter)
Definition filter.cc:203
void IMB_blend_color_byte(unsigned char dst[4], const unsigned char src1[4], const unsigned char src2[4], IMB_BlendMode mode)
Definition rectop.cc:30
ImBuf * IMB_thumb_load_image(const char *filepath, size_t max_thumb_size, ColorManagedColorspaceSettings *colorspace_settings, IMBThumbLoadFlags load_flags=IMBThumbLoadFlags::Zero)
Definition readimage.cc:226
void IMB_alpha_under_color_float(float *rect_float, int x, int y, float backcol[3])
bool IMB_alloc_float_pixels(ImBuf *ibuf, unsigned int channels, bool initialize_pixels=true)
void IMB_deactivate_gpu_context()
Definition module.cc:61
ImBuf * IMB_scale_into_new(const ImBuf *ibuf, int2 new_size, IMBScaleFilter filter, bool threaded=true)
Definition scaling.cc:531
bool IMB_scale(ImBuf *ibuf, int2 new_size, IMBScaleFilter filter, bool threaded=true)
Definition scaling.cc:467
void IMB_filtery(ImBuf *ibuf)
Definition filter.cc:65
void IMB_free_float_pixels(ImBuf *ibuf)
gpu::Texture * IMB_touch_gpu_texture(const char *name, ImBuf *ibuf, int w, int h, int layers, bool use_high_bitdepth, bool use_grayscale)
Definition util_gpu.cc:402
eIMBTransformMode
Transform modes to use for IMB_transform function.
Definition IMB_imbuf.hh:576
@ IMB_TRANSFORM_MODE_REGULAR
Do not crop or repeat.
Definition IMB_imbuf.hh:578
@ IMB_TRANSFORM_MODE_WRAP_REPEAT
Wrap repeat the source buffer. Only supported in with nearest filtering.
Definition IMB_imbuf.hh:582
@ IMB_TRANSFORM_MODE_CROP_SRC
Crop the source buffer.
Definition IMB_imbuf.hh:580
void IMB_copy_rect(float *dst, const int2 &dst_size, const float *src, const int2 &src_size, int channels, const int2 &src_rect_pos, const int2 &dst_rect_pos, const int2 &rect_size)
Definition rectop.cc:414
void IMB_premultiply_alpha(ImBuf *ibuf)
Definition filter.cc:382
ImBuf * IMB_load_image_from_file_descriptor(int file, ImBufFlags flags, const char *filepath=nullptr, ColorManagedColorspaceSettings *colorspace_settings=nullptr)
Definition readimage.cc:167
void IMB_exit()
Definition module.cc:32
ccl_device_inline int rect_size(const int4 rect)
Definition rect.h:56