|
Blender V5.0
|
#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) |
| #define USHORTTOFLOAT | ( | val | ) |
Referenced by ushort_to_byte_dither_v4().
Definition at line 56 of file conversion.cc.
References b, dither_random_value(), ftochar(), MINLINE, unit_float_to_uchar_clamp(), x, and y.
Referenced by IMB_buffer_byte_from_float(), and IMB_buffer_byte_from_float_mask().
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().
| 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 66 of file conversion.cc.
References ImBuf::flags, and IB_alphamode_channel_packed.
Referenced by colormanage_imbuf_make_linear(), display_buffer_init_handle(), blender::image_engine::SpaceImageAccessor::get_shader_parameters(), blender::image_engine::SpaceNodeAccessor::get_shader_parameters(), IMB_byte_from_float(), IMB_colormanagement_imbuf_to_byte_texture(), IMB_colormanagement_imbuf_to_float_texture(), and IMB_float_from_byte_ex().
| 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 536 of file conversion.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().
| 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 ) |
Float to byte pixels, output 4-channel RGBA.
Definition at line 71 of file conversion.cc.
References BLI_assert, 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(), blender::seq::do_glow_effect_byte(), IMB_byte_from_float(), IMB_display_buffer_transform_apply(), 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 223 of file conversion.cc.
References FILTER_MASK_USED, float_to_byte_dither_v4(), mask(), 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 299 of file conversion.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(), 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 358 of file conversion.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_threaded(), 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 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().
| 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 455 of file conversion.cc.
References IndexRange::first(), IMB_buffer_float_from_float(), blender::threading::parallel_for(), and IndexRange::size().
Referenced by BKE_image_buf_fill_checker_color(), and blender::seq::convert_multilayer_ibuf().
| 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().
| void IMB_color_to_bw | ( | ImBuf * | ibuf | ) |
No profile conversion.
Definition at line 757 of file conversion.cc.
References ImBuf::byte_buffer, ImBuf::channels, ImBufByteBuffer::data, ImBufFloatBuffer::data, ImBuf::float_buffer, i, IMB_colormanagement_get_luminance(), IMB_colormanagement_get_luminance_byte(), and IMB_get_pixel_count().
Referenced by RE_render_result_rect_to_ibuf(), and screenshot_exec().
| void IMB_float_from_byte | ( | ImBuf * | ibuf | ) |
Definition at line 732 of file conversion.cc.
References BLI_rcti_init(), ImBuf::byte_buffer, ImBufByteBuffer::data, ImBufFloatBuffer::data, ImBuf::float_buffer, IMB_alloc_float_pixels(), IMB_float_from_byte_ex(), ImBuf::x, and ImBuf::y.
Referenced by accessor_get_ibuf(), blender::image_engine::FloatBufferCache::cached_float_buffer(), colorfn(), blender::compositor::compute_linear_buffer(), blender::seq::ensure_linear_float_buffer(), blender::nodes::node_composite_movieclip_cc::MovieClipOperation::get_movie_clip_buffer(), blender::nodes::node_geo_image_texture_cc::ImageFieldsFunction::ImageFieldsFunction(), IMB_colormanagement_imbuf_for_write(), 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 677 of file conversion.cc.
References BLI_assert_msg, BLI_rcti_size_x(), BLI_rcti_size_y(), ImBuf::byte_buffer, ImBuf::channels, ImBufByteBuffer::data, ImBufFloatBuffer::data, ImBuf::float_buffer, IMB_alpha_affects_rgb(), blender::threading::parallel_for(), ImBuf::x, rcti::xmax, rcti::xmin, ImBuf::y, rcti::ymax, and rcti::ymin.
Referenced by IMB_float_from_byte().
Definition at line 784 of file conversion.cc.
References ImBuf::byte_buffer, ImBuf::channels, ImBufByteBuffer::data, ImBufFloatBuffer::data, IndexRange::first(), ImBuf::float_buffer, hsv_to_rgb(), i, IMB_get_pixel_count(), blender::threading::parallel_for(), ptr, rgb_float_to_uchar(), rgb_to_hsv_v(), and rgb_uchar_to_float().
Referenced by blender::seq::input_preprocess().
| MINLINE void ushort_to_byte_dither_v4 | ( | uchar | b[4], |
| const ushort | us[4], | ||
| float | dither, | ||
| int | x, | ||
| int | y ) |
Definition at line 43 of file conversion.cc.
References b, dither_random_value(), ftochar(), MINLINE, unit_ushort_to_uchar(), USHORTTOFLOAT, x, and y.
Referenced by IMB_buffer_byte_from_float().
Definition at line 30 of file conversion.cc.
References b, MINLINE, and unit_ushort_to_uchar().
Referenced by IMB_buffer_byte_from_float().