|
Blender V4.3
|
#include "BLI_rect.h"#include "BLI_task.hh"#include "BLI_utildefines.h"#include "IMB_filter.hh"#include "IMB_imbuf.hh"#include "IMB_imbuf_types.hh"#include "imbuf.hh"#include "IMB_colormanagement.hh"#include "IMB_colormanagement_intern.hh"#include "MEM_guardedalloc.h"Go to the source code of this file.
Classes | |
| struct | DitherContext |
| struct | FloatToFloatThreadData |
Macros | |
| #define | USHORTTOFLOAT(val) (float(val) / 65535.0f) |
Functions | |
Floyd-Steinberg dithering | |
| static DitherContext * | create_dither_context (float dither) |
| static void | clear_dither_context (DitherContext *di) |
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], DitherContext *di, float s, float t) |
| MINLINE void | float_to_byte_dither_v4 (uchar b[4], const float f[4], DitherContext *di, float s, float t) |
| 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) |
| 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) |
| static void | imb_buffer_float_from_float_thread_do (void *data_v, int scanline) |
| 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_rect_from_float (ImBuf *ibuf) |
| void | IMB_float_from_rect_ex (ImBuf *dst, const ImBuf *src, const rcti *region_to_update) |
| void | IMB_float_from_rect (ImBuf *ibuf) |
Color to Gray-Scale | |
| void | IMB_color_to_bw (ImBuf *ibuf) |
Alter Saturation | |
| void | IMB_saturation (ImBuf *ibuf, float sat) |
Referenced by ushort_to_byte_dither_v4().
|
static |
Definition at line 42 of file divers.cc.
References MEM_freeN().
Referenced by IMB_buffer_byte_from_float(), and IMB_buffer_byte_from_float_mask().
|
static |
Definition at line 32 of file divers.cc.
References DitherContext::dither.
Referenced by IMB_buffer_byte_from_float(), and IMB_buffer_byte_from_float_mask().
| MINLINE void float_to_byte_dither_v4 | ( | uchar | b[4], |
| const float | f[4], | ||
| DitherContext * | di, | ||
| float | s, | ||
| float | t ) |
Definition at line 80 of file divers.cc.
References b, DitherContext::dither, dither_random_value(), ftochar(), and unit_float_to_uchar_clamp.
Referenced by IMB_buffer_byte_from_float(), and IMB_buffer_byte_from_float_mask().
Definition at line 61 of file divers.cc.
References unit_float_to_uchar_clamp.
Referenced by float_to_byte_dither_v4(), and ushort_to_byte_dither_v4().
| bool IMB_alpha_affects_rgb | ( | const ImBuf * | ibuf | ) |
Test if color-space conversions of pixels in buffer need to take into account alpha.
Definition at line 91 of file divers.cc.
References ImBuf::flags, and IB_alphamode_channel_packed.
Referenced by colormanage_imbuf_make_linear(), display_buffer_init_handle(), blender::draw::image_engine::SpaceImageAccessor::get_shader_parameters(), blender::draw::image_engine::SpaceNodeAccessor::get_shader_parameters(), IMB_colormanagement_imbuf_to_byte_texture(), IMB_colormanagement_imbuf_to_float_texture(), IMB_float_from_rect_ex(), and IMB_rect_from_float().
| 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 ) |
Byte to byte pixels, input and output 4-channel RGBA.
Definition at line 625 of file divers.cc.
References BLI_assert, IB_PROFILE_LINEAR_RGB, IB_PROFILE_NONE, IB_PROFILE_SRGB, linearrgb_to_srgb_predivide_v4(), linearrgb_to_srgb_v4(), rgba_float_to_uchar(), rgba_uchar_to_float(), srgb_to_linearrgb_predivide_v4(), srgb_to_linearrgb_v4(), x, and y.
Referenced by do_display_buffer_apply_no_processor(), and imb_stereo3d_squeeze_rect().
| 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 ) |
Float to byte pixels, output 4-channel RGBA.
Definition at line 96 of file divers.cc.
References BLI_assert, clear_dither_context(), create_dither_context(), float_to_byte_dither_v4(), IB_PROFILE_LINEAR_RGB, IB_PROFILE_NONE, IB_PROFILE_SRGB, linearrgb_to_srgb_ushort4(), linearrgb_to_srgb_v3_v3(), premul_float_to_straight_uchar(), premul_to_straight_v4_v4(), rgb_float_to_uchar(), rgba_float_to_uchar(), srgb_to_linearrgb_predivide_v4(), srgb_to_linearrgb_v3_v3(), srgb_to_linearrgb_v4(), unit_float_to_uchar_clamp, ushort_to_byte_dither_v4(), ushort_to_byte_v4(), x, and y.
Referenced by do_display_buffer_apply_no_processor(), do_display_buffer_apply_thread(), do_glow_effect_byte(), IMB_display_buffer_transform_apply(), IMB_rect_from_float(), partial_buffer_update_rect(), blender::ed::object::write_external_bake_pixels(), and blender::ed::object::write_internal_bake_pixels().
| 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 ) |
Float to byte pixels, output 4-channel RGBA.
Definition at line 260 of file divers.cc.
References clear_dither_context(), create_dither_context(), FILTER_MASK_USED, float_to_byte_dither_v4(), premul_float_to_straight_uchar(), premul_to_straight_v4_v4(), rgb_float_to_uchar(), rgba_float_to_uchar(), unit_float_to_uchar_clamp, x, and y.
Referenced by blender::ed::object::write_internal_bake_pixels().
| 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 ) |
Byte to float pixels, input and output 4-channel RGBA.
Definition at line 348 of file divers.cc.
References BLI_assert, IB_PROFILE_LINEAR_RGB, IB_PROFILE_NONE, IB_PROFILE_SRGB, linearrgb_to_srgb_predivide_v4(), linearrgb_to_srgb_v4(), rgba_uchar_to_float(), srgb_to_linearrgb_uchar4(), srgb_to_linearrgb_uchar4_predivide(), x, and y.
Referenced by do_display_buffer_apply_no_processor(), do_processor_transform_thread(), IMB_colormanagement_transform_from_byte(), IMB_float_from_rect_ex(), and partial_buffer_update_rect().
| 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 ) |
Float to float pixels, output 4-channel RGBA.
Definition at line 407 of file divers.cc.
References BLI_assert, copy_v3_v3(), IB_PROFILE_LINEAR_RGB, IB_PROFILE_NONE, IB_PROFILE_SRGB, linearrgb_to_srgb_predivide_v4(), linearrgb_to_srgb_v3_v3(), linearrgb_to_srgb_v4(), srgb_to_linearrgb_predivide_v4(), srgb_to_linearrgb_v3_v3(), srgb_to_linearrgb_v4(), x, and y.
Referenced by do_display_buffer_apply_no_processor(), imb_buffer_float_from_float_thread_do(), IMB_buffer_float_from_float_threaded(), imb_stereo3d_squeeze_rectf(), studiolight_multilayer_convert_pass(), blender::ed::object::write_external_bake_pixels(), and blender::ed::object::write_internal_bake_pixels().
| 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 572 of file divers.cc.
References copy_v3_v3(), copy_v4_v4(), FILTER_MASK_USED, x, and y.
Referenced by blender::ed::object::write_internal_bake_pixels().
|
static |
Definition at line 516 of file divers.cc.
References IMB_buffer_float_from_float(), and FloatToFloatThreadData::stride_from.
Referenced by 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 ) |
Definition at line 534 of file divers.cc.
References data, IMB_buffer_float_from_float(), imb_buffer_float_from_float_thread_do(), IMB_processor_apply_threaded_scanlines(), and FloatToFloatThreadData::rect_to.
Referenced by BKE_image_buf_fill_checker_color().
| void IMB_color_to_bw | ( | ImBuf * | ibuf | ) |
No profile conversion.
Definition at line 838 of file divers.cc.
References ImBuf::byte_buffer, ImBuf::channels, ImBufByteBuffer::data, ImBufFloatBuffer::data, ImBuf::float_buffer, IMB_colormanagement_get_luminance(), IMB_colormanagement_get_luminance_byte(), and IMB_get_rect_len().
Referenced by RE_render_result_rect_to_ibuf(), and screenshot_exec().
| void IMB_float_from_rect | ( | ImBuf * | ibuf | ) |
Definition at line 802 of file divers.cc.
References BLI_rcti_init(), ImBuf::byte_buffer, ImBuf::channels, ImBufByteBuffer::data, ImBufFloatBuffer::data, ImBuf::float_buffer, IB_TAKE_OWNERSHIP, IMB_assign_float_buffer(), IMB_float_from_rect_ex(), IMB_get_rect_len(), MEM_callocN, ImBuf::x, and ImBuf::y.
Referenced by accessor_get_ibuf(), blender::draw::image_engine::FloatBufferCache::cached_float_buffer(), colorfn(), blender::realtime_compositor::compute_linear_buffer(), blender::nodes::node_geo_image_texture_cc::ImageFieldsFunction::ImageFieldsFunction(), IMB_colormanagement_imbuf_for_write(), blender::compositor::MovieClipBaseOperation::init_execution(), modifier_render_mask_input(), paint_2d_canvas_set(), project_paint_op(), RE_layer_load_from_file(), RE_render_result_rect_to_ibuf(), and studiolight_load_equirect_image().
Definition at line 748 of file divers.cc.
References BLI_assert_msg, BLI_rcti_size_x(), BLI_rcti_size_y(), ImBuf::byte_buffer, ImBuf::channels, ImBufByteBuffer::colorspace, ImBufByteBuffer::data, ImBufFloatBuffer::data, ImBuf::float_buffer, IB_PROFILE_SRGB, IMB_alpha_affects_rgb(), IMB_buffer_float_from_byte(), IMB_colormanagement_colorspace_to_scene_linear(), IMB_premultiply_rect_float(), ImBuf::x, rcti::xmax, rcti::xmin, ImBuf::y, rcti::ymax, and rcti::ymin.
Referenced by IMB_float_from_rect().
| void IMB_rect_from_float | ( | ImBuf * | ibuf | ) |
Create char buffer, color corrected if necessary, for ImBufs that lack one.
Definition at line 694 of file divers.cc.
References ImBuf::byte_buffer, ImBuf::channels, COLOR_ROLE_DEFAULT_BYTE, COLOR_ROLE_SCENE_LINEAR, ImBufByteBuffer::colorspace, ImBufFloatBuffer::colorspace, ImBufByteBuffer::data, ImBufFloatBuffer::data, ImBuf::dither, ImBuf::float_buffer, IB_PROFILE_SRGB, imb_addrectImBuf(), IMB_alpha_affects_rgb(), IMB_buffer_byte_from_float(), IMB_colormanagement_role_colorspace_name_get(), IMB_colormanagement_transform(), IMB_unpremultiply_rect_float(), MEM_dupallocN, MEM_freeN(), ColorSpace::name, ImBuf::userflags, ImBuf::x, and ImBuf::y.
Referenced by BKE_image_preview(), BKE_main_thumbnail_from_imbuf(), 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_saveiff(), IMB_thumb_manage(), modifier_render_mask_input(), paint_2d_canvas_set(), prepare_effect_imbufs(), project_paint_op(), blender::ed::space_node::sample_apply(), screen_opengl_render_doit(), sequencer_draw_scopes(), thumb_create_ex(), ui_draw_but_TRACKPREVIEW(), ui_tooltip_from_clip(), and WM_clipboard_image_set().
Definition at line 865 of file divers.cc.
References ImBuf::byte_buffer, channels(), ImBuf::channels, ImBufByteBuffer::data, ImBufFloatBuffer::data, ImBuf::float_buffer, hsv_to_rgb(), IMB_get_rect_len(), ptr, range, rgb_float_to_uchar(), rgb_to_hsv_v(), and rgb_uchar_to_float().
Referenced by input_preprocess().
| MINLINE void ushort_to_byte_dither_v4 | ( | uchar | b[4], |
| const ushort | us[4], | ||
| DitherContext * | di, | ||
| float | s, | ||
| float | t ) |
Definition at line 66 of file divers.cc.
References b, DitherContext::dither, dither_random_value(), ftochar(), unit_ushort_to_uchar, and USHORTTOFLOAT.
Referenced by IMB_buffer_byte_from_float().
Definition at line 53 of file divers.cc.
References b, and unit_ushort_to_uchar.
Referenced by IMB_buffer_byte_from_float().