Blender V5.0
conversion.cc File Reference
#include "BLI_array.hh"
#include "BLI_rect.h"
#include "BLI_task.hh"
#include "IMB_filter.hh"
#include "IMB_imbuf.hh"
#include "IMB_imbuf_types.hh"
#include "IMB_colormanagement.hh"
#include "IMB_colormanagement_intern.hh"
#include "MEM_guardedalloc.h"
#include "OCIO_colorspace.hh"

Go to the source code of this file.

Macros

#define USHORTTOFLOAT(val)

Functions

Generic Buffer Conversion
MINLINE void ushort_to_byte_v4 (uchar b[4], const ushort us[4])
MINLINE uchar ftochar (float value)
MINLINE void ushort_to_byte_dither_v4 (uchar b[4], const ushort us[4], float dither, int x, int y)
MINLINE void float_to_byte_dither_v4 (uchar b[4], const float f[4], float dither, int x, int y)
bool IMB_alpha_affects_rgb (const ImBuf *ibuf)
void IMB_buffer_byte_from_float (uchar *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)
void IMB_buffer_byte_from_float_mask (uchar *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 uchar *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 (uchar *rect_to, const uchar *rect_from, int profile_to, int profile_from, bool predivide, int width, int height, int stride_to, int stride_from)
ImBuf Conversion
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)
Color to Gray-Scale
void IMB_color_to_bw (ImBuf *ibuf)
Alter Saturation
void IMB_saturation (ImBuf *ibuf, float sat)

Macro Definition Documentation

◆ USHORTTOFLOAT

#define USHORTTOFLOAT ( val)
Value:
(float(val) / 65535.0f)
nullptr float

Referenced by ushort_to_byte_dither_v4().

Function Documentation

◆ float_to_byte_dither_v4()

MINLINE void float_to_byte_dither_v4 ( uchar b[4],
const float f[4],
float dither,
int x,
int y )

◆ ftochar()

MINLINE uchar ftochar ( float value)

Definition at line 38 of file conversion.cc.

References MINLINE, and unit_float_to_uchar_clamp().

Referenced by float_to_byte_dither_v4(), and ushort_to_byte_dither_v4().

◆ IMB_alpha_affects_rgb()

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

◆ IMB_float_from_byte_ex()

◆ IMB_saturation()

◆ ushort_to_byte_dither_v4()

MINLINE void ushort_to_byte_dither_v4 ( uchar b[4],
const ushort us[4],
float dither,
int x,
int y )

◆ ushort_to_byte_v4()

MINLINE void ushort_to_byte_v4 ( uchar b[4],
const ushort us[4] )

Definition at line 30 of file conversion.cc.

References b, MINLINE, and unit_ushort_to_uchar().

Referenced by IMB_buffer_byte_from_float().