Blender
V3.3
|
#include "BLI_compiler_compat.h"
#include "BLI_sys_types.h"
#include "intern/colormanagement_inline.c"
Go to the source code of this file.
Macros | |
#define | BCM_CONFIG_FILE "config.ocio" |
View Transform | |
enum | { COLOR_ROLE_SCENE_LINEAR = 0 , COLOR_ROLE_COLOR_PICKING , COLOR_ROLE_TEXTURE_PAINTING , COLOR_ROLE_DEFAULT_SEQUENCER , COLOR_ROLE_DEFAULT_BYTE , COLOR_ROLE_DEFAULT_FLOAT , COLOR_ROLE_DATA } |
void | IMB_colormanagement_init_default_view_settings (struct ColorManagedViewSettings *view_settings, const struct ColorManagedDisplaySettings *display_settings) |
#define BCM_CONFIG_FILE "config.ocio" |
Definition at line 17 of file IMB_colormanagement.h.
anonymous enum |
Enumerator | |
---|---|
COLOR_ROLE_SCENE_LINEAR | |
COLOR_ROLE_COLOR_PICKING | |
COLOR_ROLE_TEXTURE_PAINTING | |
COLOR_ROLE_DEFAULT_SEQUENCER | |
COLOR_ROLE_DEFAULT_BYTE | |
COLOR_ROLE_DEFAULT_FLOAT | |
COLOR_ROLE_DATA |
Definition at line 505 of file IMB_colormanagement.h.
Definition at line 1312 of file colormanagement.c.
References ImBuf::flags, IB_alphamode_channel_packed, IB_alphamode_ignore, IB_alphamode_premul, IMB_colormanagement_assign_float_colorspace(), IMB_colormanagement_assign_rect_colorspace(), IMB_colormanagement_get_float_colorspace(), and IMB_colormanagement_get_rect_colorspace().
Referenced by BKE_tracking_stabilize_frame().
BLI_INLINE void IMB_colormanagement_aces_to_scene_linear | ( | float | scene_linear[3], |
const float | aces[3] | ||
) |
Definition at line 62 of file colormanagement_inline.c.
References imbuf_aces_to_scene_linear, and mul_v3_m3v3().
Referenced by Color_from_aces_to_scene_linear().
Definition at line 1329 of file colormanagement.c.
References colormanage_colorspace_get_named(), ImBuf::colormanage_flag, ImBuf::float_colorspace, IMB_COLORMANAGE_IS_DATA, and ColorSpace::is_data.
Referenced by IMB_colormanagegent_copy_settings(), prepare_effect_imbufs(), seq_disk_cache_read_file(), seq_imbuf_assign_spaces(), and SEQ_render_imbuf_from_sequencer_space().
Definition at line 1343 of file colormanagement.c.
References colormanage_colorspace_get_named(), ImBuf::colormanage_flag, IMB_COLORMANAGE_IS_DATA, ColorSpace::is_data, and ImBuf::rect_colorspace.
Referenced by add_ibuf_size(), image_get_render_result(), IMB_colormanagegent_copy_settings(), seq_disk_cache_read_file(), and seq_imbuf_assign_spaces().
void IMB_colormanagement_blackbody_temperature_to_rgb_table | ( | float * | r_table, |
int | width, | ||
float | min, | ||
float | max | ||
) |
Definition at line 4211 of file colormanagement.c.
References blackbody_temperature_to_rec709(), clamp_v3(), copy_v3_v3(), float(), IMB_colormanagement_rec709_to_scene_linear(), max, min, usdtokens::rgb(), and width.
Referenced by blender::nodes::node_shader_blackbody_cc::node_shader_gpu_blackbody(), and blender::nodes::node_shader_volume_principled_cc::node_shader_gpu_volume_principled().
Definition at line 1201 of file colormanagement.c.
References BLI_strncpy(), colormanage_check_colorspace_settings(), colormanage_check_display_settings(), colormanage_check_view_settings(), colormanage_display_get_default(), MovieClip::colorspace_settings, Scene::display_settings, Scene::ed, ListBase::first, global_role_default_sequencer, MovieClip::id, Scene::id, image(), Main::images, MAX_COLORSPACE_NAME, Main::movieclips, ColorManagedColorspaceSettings::name, ID::next, NULL, scene, Main::scenes, seq_callback(), SEQ_for_each_callback(), Editing::seqbase, Scene::sequencer_colorspace_settings, and Scene::view_settings.
Referenced by copybuffer_append(), setup_app_data(), WM_lib_reload(), wm_lib_relocate_exec_do(), and wm_link_append_exec().
Definition at line 1300 of file colormanagement.c.
References colormanage_colorspace_get_named(), ImBuf::colormanage_flag, IMB_COLORMANAGE_IS_DATA, and ColorSpace::is_data.
Referenced by add_ibuf_size().
void IMB_colormanagement_color_picking_to_scene_linear_v3 | ( | float | scene_linear[3], |
const float | color_picking[3] | ||
) |
Definition at line 2372 of file colormanagement.c.
References BLI_mutex_lock(), BLI_mutex_unlock(), copy_v3_v3(), global_color_picking_state::cpu_processor_from, create_colorspace_transform_processor(), global_color_picking_state::failed, global_role_color_picking, global_role_scene_linear, NULL, OCIO_cpuProcessorApplyRGB(), OCIO_processorGetCPUProcessor(), OCIO_processorRelease(), and processor_lock.
Referenced by ui_perceptual_to_scene_linear_space().
void IMB_colormanagement_colorspace_from_ibuf_ftype | ( | struct ColorManagedColorspaceSettings * | colorspace_settings, |
struct ImBuf * | ibuf | ||
) |
Definition at line 3183 of file colormanagement.c.
References BLI_strncpy(), colormanage_colorspace_get_named(), IMB_colormanagement_role_colorspace_name_get(), IMB_file_type_from_ibuf(), ColorSpace::is_data, ColorManagedColorspaceSettings::name, NULL, and type.
const char* IMB_colormanagement_colorspace_get_indexed_name | ( | int | index | ) |
Definition at line 3165 of file colormanagement.c.
References colormanage_colorspace_get_indexed(), and ColorSpace::name.
const char* IMB_colormanagement_colorspace_get_name | ( | const struct ColorSpace * | colorspace | ) |
Referenced by image_colorspace_from_imbuf().
int IMB_colormanagement_colorspace_get_named_index | ( | const char * | name | ) |
Definition at line 3152 of file colormanagement.c.
References colormanage_colorspace_get_named(), and ColorSpace::index.
Referenced by blender::compositor::ConvertColorSpaceOperation::init_execution().
void IMB_colormanagement_colorspace_items_add | ( | struct EnumPropertyItem ** | items, |
int * | totitem | ||
) |
Definition at line 3360 of file colormanagement.c.
References ColorSpace::description, EnumPropertyItem::description, ListBase::first, global_colorspaces, EnumPropertyItem::icon, EnumPropertyItem::identifier, ColorSpace::index, ColorSpace::is_invertible, ColorSpace::name, EnumPropertyItem::name, ColorSpace::next, RNA_enum_item_add(), and EnumPropertyItem::value.
struct ColormanageProcessor* IMB_colormanagement_colorspace_processor_new | ( | const char * | from_colorspace, |
const char * | to_colorspace | ||
) |
Definition at line 3808 of file colormanagement.c.
References colormanage_colorspace_get_named(), ColormanageProcessor::cpu_processor, create_colorspace_transform_processor(), ColorSpace::is_data, ColormanageProcessor::is_data_result, MEM_callocN, NULL, OCIO_processorGetCPUProcessor(), and OCIO_processorRelease().
Referenced by colormanagement_transform_ex(), IMB_colormanagement_transform_from_byte_threaded(), IMB_colormanagement_transform_v4(), blender::ed::sculpt_paint::paint::image::PaintingKernel< ImageBuffer >::init_brush_color(), and blender::compositor::ConvertColorSpaceOperation::init_execution().
void IMB_colormanagement_colorspace_to_scene_linear | ( | float * | buffer, |
int | width, | ||
int | height, | ||
int | channels, | ||
struct ColorSpace * | colorspace, | ||
bool | predivide | ||
) |
Definition at line 2169 of file colormanagement.c.
References buffer, channels(), colorspace_to_scene_linear_cpu_processor(), height, NULL, OCIO_cpuProcessorApply(), OCIO_cpuProcessorApply_predivide(), OCIO_createOCIO_PackedImageDesc(), OCIO_PackedImageDescRelease(), and width.
Referenced by blender::compositor::colorspace_to_scene_linear(), and IMB_float_from_rect_ex().
void IMB_colormanagement_colorspace_to_scene_linear_v3 | ( | float | pixel[3], |
struct ColorSpace * | colorspace | ||
) |
Convert pixel from specified by descriptor color space to scene linear used by performance-critical areas such as renderer and baker.
Definition at line 2111 of file colormanagement.c.
References colorspace_to_scene_linear_cpu_processor(), NULL, and OCIO_cpuProcessorApplyRGB().
Referenced by BKE_brush_sample_tex_3d(), ED_space_clip_color_sample(), ED_space_image_color_sample(), ED_space_node_color_sample(), multitex_nodes_intern(), paint_get_tex_pixel_col(), partial_buffer_update_rect(), tonemapmodifier_apply(), tonemapmodifier_apply_threaded_photoreceptor(), and tonemapmodifier_apply_threaded_simple().
void IMB_colormanagement_colorspace_to_scene_linear_v4 | ( | float | pixel[4], |
bool | predivide, | ||
struct ColorSpace * | colorspace | ||
) |
Definition at line 2145 of file colormanagement.c.
References colorspace_to_scene_linear_cpu_processor(), NULL, OCIO_cpuProcessorApplyRGBA(), and OCIO_cpuProcessorApplyRGBA_predivide().
Referenced by image_sample_pixel_color_ubyte(), IMB_sampleImageAtLocation(), blender::ed::space_node::sample_apply(), blender::compositor::sample_image_at_location(), and sequencer_sample_apply().
const char* IMB_colormanagement_display_get_default_name | ( | void | ) |
Definition at line 2903 of file colormanagement.c.
References colormanage_display_get_default(), and ColorManagedDisplay::name.
Referenced by BKE_color_managed_display_settings_init(), and UI_block_begin().
const char* IMB_colormanagement_display_get_default_view_transform_name | ( | struct ColorManagedDisplay * | display | ) |
Definition at line 2924 of file colormanagement.c.
References colormanage_view_get_default_name().
Referenced by BKE_color_managed_view_settings_init_render(), and seq_add_set_view_transform().
const char* IMB_colormanagement_display_get_indexed_name | ( | int | index | ) |
Definition at line 2890 of file colormanagement.c.
References colormanage_display_get_indexed(), ColorManagedDisplay::name, and NULL.
struct ColorManagedDisplay* IMB_colormanagement_display_get_named | ( | const char * | name | ) |
Used by performance-critical pixel processing areas, such as color widgets.
Definition at line 2910 of file colormanagement.c.
References colormanage_display_get_named().
Referenced by BKE_color_managed_view_settings_init_render(), BKE_image_stamp_buf(), brush_painter_imbuf_new(), brush_painter_imbuf_update(), do_text_effect(), eyedropper_color_sample_fl(), eyedropper_gpencil_init(), eyedropper_init(), seq_add_set_view_transform(), and ui_block_cm_display_get().
int IMB_colormanagement_display_get_named_index | ( | const char * | name | ) |
Definition at line 2877 of file colormanagement.c.
References colormanage_display_get_named(), and ColorManagedDisplay::index.
Referenced by colormanage_display_settings_to_cache().
const char* IMB_colormanagement_display_get_none_name | ( | void | ) |
Definition at line 2915 of file colormanagement.c.
References colormanage_display_get_default_name(), colormanage_display_get_named(), and NULL.
Referenced by BKE_scene_disable_color_management().
void IMB_colormanagement_display_items_add | ( | struct EnumPropertyItem ** | items, |
int * | totitem | ||
) |
Definition at line 3287 of file colormanagement.c.
References EnumPropertyItem::description, ListBase::first, global_displays, EnumPropertyItem::icon, EnumPropertyItem::identifier, ColorManagedDisplay::index, ColorManagedDisplay::name, EnumPropertyItem::name, ColorManagedDisplay::next, RNA_enum_item_add(), and EnumPropertyItem::value.
struct ColormanageProcessor* IMB_colormanagement_display_processor_new | ( | const struct ColorManagedViewSettings * | view_settings, |
const struct ColorManagedDisplaySettings * | display_settings | ||
) |
void IMB_colormanagement_display_settings_from_ctx | ( | const struct bContext * | C, |
struct ColorManagedViewSettings ** | r_view_settings, | ||
struct ColorManagedDisplaySettings ** | r_display_settings | ||
) |
Referenced by ED_draw_imbuf_ctx_clipping().
void IMB_colormanagement_display_to_scene_linear_v3 | ( | float | pixel[3], |
struct ColorManagedDisplay * | display | ||
) |
Same as IMB_colormanagement_scene_linear_to_display_v3, but converts color in opposite direction.
Definition at line 2411 of file colormanagement.c.
References display_to_scene_linear_processor(), NULL, and OCIO_cpuProcessorApplyRGB().
Referenced by blf_draw_buffer__start(), buf_rectfill_area(), eyedropper_color_sample_fl(), eyedropper_init(), and paint_brush_color_get().
Finish GLSL-based display space conversion.
Definition at line 4133 of file colormanagement.c.
References global_gpu_state::gpu_shader_bound, and OCIO_gpuDisplayShaderUnbind().
Referenced by draw_display_buffer(), ED_draw_imbuf_clipping(), gpu_viewport_draw_colormanaged(), and sequencer_draw_display_buffer().
const char* IMB_colormanagement_get_float_colorspace | ( | struct ImBuf * | ibuf | ) |
Definition at line 1357 of file colormanagement.c.
References COLOR_ROLE_SCENE_LINEAR, ImBuf::float_colorspace, IMB_colormanagement_role_colorspace_name_get(), and ColorSpace::name.
Referenced by blender::ed::sculpt_paint::paint::image::ImageBufferFloat4::get_colorspace_name(), IMB_colormanagegent_copy_settings(), seq_disk_cache_add_header_entry(), seq_imbuf_to_sequencer_space(), and write_internal_bake_pixels().
BLI_INLINE float IMB_colormanagement_get_luminance | ( | const float | rgb[3] | ) |
Convert a float RGB triplet to the correct luminance weighted average.
Gray-scale, or Luma is a distillation of RGB data values down to a weighted average based on the luminance positions of the red, green, and blue primaries. Given that the internal reference space may be arbitrarily set, any effort to glean the luminance coefficients must be aware of the reference space primaries.
See http://wiki.blender.org/index.php/User:Nazg-gul/ColorManagement#Luminance
Definition at line 14 of file colormanagement_inline.c.
References dot_v3v3(), imbuf_luma_coefficients, and usdtokens::rgb().
Referenced by BKE_histogram_update_sample_line(), blender::compositor::calc_area_luminance(), blender::compositor::CalculateMeanOperation::calculate_mean(), do_projectpaint_soften(), do_projectpaint_soften_f(), blender::compositor::SMAAEdgeDetectionOperation::execute_pixel(), blender::compositor::PhotoreceptorTonemapOperation::execute_pixel(), blender::compositor::ColorCorrectionOperation::execute_pixel_sampled(), blender::compositor::ConvertColorToBWOperation::execute_pixel_sampled(), blender::compositor::GlareThresholdOperation::execute_pixel_sampled(), blender::compositor::LuminanceMatteOperation::execute_pixel_sampled(), blender::color::get_luminance(), IMB_color_to_bw(), imb_savepng(), blender::compositor::CalculateStandardDeviationOperation::initialize_tile_data(), blender::compositor::TonemapOperation::initialize_tile_data(), make_waveform_view_from_ibuf_float(), paint_2d_lift_soften(), RE_texture_evaluate(), rgbtobw_valuefn(), scopes_update_cb(), blender::compositor::CalculateMeanOperation::set_setting(), tonemapmodifier_apply(), tonemapmodifier_apply_threaded_photoreceptor(), ui_draw_but_CURVE(), blender::compositor::ConvertColorToBWOperation::update_memory_buffer_partial(), blender::compositor::GlareThresholdOperation::update_memory_buffer_partial(), blender::compositor::LuminanceMatteOperation::update_memory_buffer_partial(), blender::compositor::SMAAEdgeDetectionOperation::update_memory_buffer_partial(), blender::compositor::PhotoreceptorTonemapOperation::update_memory_buffer_partial(), and blender::compositor::ColorCorrectionOperation::update_memory_buffer_row().
BLI_INLINE unsigned char IMB_colormanagement_get_luminance_byte | ( | const unsigned char | rgb[3] | ) |
Byte equivalent of IMB_colormanagement_get_luminance().
Definition at line 19 of file colormanagement_inline.c.
References dot_v3v3(), imbuf_luma_coefficients, usdtokens::rgb(), rgb_uchar_to_float(), and unit_float_to_uchar_clamp().
Referenced by BKE_histogram_update_sample_line(), blender::color::get_luminance(), IMB_color_to_bw(), and make_waveform_view_from_ibuf_byte().
const char* IMB_colormanagement_get_rect_colorspace | ( | struct ImBuf * | ibuf | ) |
Definition at line 1366 of file colormanagement.c.
References COLOR_ROLE_DEFAULT_BYTE, IMB_colormanagement_role_colorspace_name_get(), ColorSpace::name, and ImBuf::rect_colorspace.
Referenced by blender::ed::sculpt_paint::paint::image::ImageBufferByte4::get_colorspace_name(), IMB_colormanagegent_copy_settings(), seq_disk_cache_add_header_entry(), seq_imbuf_to_sequencer_space(), write_external_bake_pixels(), and write_internal_bake_pixels().
Definition at line 1429 of file colormanagement.c.
References imbuf_xyz_to_scene_linear.
Referenced by get_XYZ_to_RGB_for_gpu().
struct ImBuf* IMB_colormanagement_imbuf_for_write | ( | struct ImBuf * | ibuf, |
bool | save_as_render, | ||
bool | allocate_result, | ||
const struct ImageFormatData * | image_format | ||
) |
Prepare image buffer to be saved on disk, applying color management if needed color management would be applied if image is saving as render result and if file format is not expecting float buffer to be in linear space (currently JPEG2000 and TIFF are such formats – they're storing image as float but file itself stores applied color space).
Both byte and float buffers would contain applied color space, and result's float_colorspace would be set to display color space. This should be checked in image format write callback and if float_colorspace is not NULL, no color space transformation should be applied on this buffer.
Referenced by BKE_image_render_write(), blender::compositor::OutputStereoOperation::deinit_execution(), blender::compositor::OutputSingleLayerOperation::deinit_execution(), image_save_single(), and RE_WriteRenderViewsMovie().
void IMB_colormanagement_imbuf_make_display_space | ( | struct ImBuf * | ibuf, |
const struct ColorManagedViewSettings * | view_settings, | ||
const struct ColorManagedDisplaySettings * | display_settings | ||
) |
Referenced by sequencer_get_scope(), and sequencer_make_scope().
void IMB_colormanagement_imbuf_to_byte_texture | ( | unsigned char * | out_buffer, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height, | ||
const struct ImBuf * | ibuf, | ||
bool | store_premultiplied | ||
) |
Definition at line 2208 of file colormanagement.c.
References BLI_assert, height, if(), IMB_alpha_affects_rgb(), IMB_colormanagement_space_is_data(), IMB_colormanagement_space_is_scene_linear(), IMB_colormanagement_space_is_srgb(), NULL, usdtokens::out(), ImBuf::rect, ImBuf::rect_colorspace, ImBuf::rect_float, width, x, ImBuf::x, and y.
Referenced by gpu_texture_update_from_ibuf(), and imb_gpu_get_data().
void IMB_colormanagement_imbuf_to_float_texture | ( | float * | out_buffer, |
int | offset_x, | ||
int | offset_y, | ||
int | width, | ||
int | height, | ||
const struct ImBuf * | ibuf, | ||
bool | store_premultiplied | ||
) |
Definition at line 2253 of file colormanagement.c.
References ImBuf::channels, colorspace_to_scene_linear_cpu_processor(), copy_v4_v4(), height, if(), IMB_alpha_affects_rgb(), mul_v3_fl(), NULL, OCIO_cpuProcessorApplyRGB(), usdtokens::out(), premul_to_straight_v4_v4(), ImBuf::rect, ImBuf::rect_colorspace, ImBuf::rect_float, rgba_uchar_to_float(), srgb_to_linearrgb_v3_v3(), width, x, ImBuf::x, and y.
Referenced by gpu_texture_update_from_ibuf(), and imb_gpu_get_data().
void IMB_colormanagement_init_default_view_settings | ( | struct ColorManagedViewSettings * | view_settings, |
const struct ColorManagedDisplaySettings * | display_settings | ||
) |
Referenced by BKE_color_managed_view_settings_init_default(), and wm_main_playanim_intern().
const char* IMB_colormanagement_look_get_indexed_name | ( | int | index | ) |
Definition at line 3268 of file colormanagement.c.
References colormanage_look_get_indexed(), ColorManagedLook::name, and NULL.
int IMB_colormanagement_look_get_named_index | ( | const char * | name | ) |
Definition at line 3255 of file colormanagement.c.
References colormanage_look_get_named(), and ColorManagedLook::index.
Referenced by colormanage_view_settings_to_cache().
void IMB_colormanagement_look_items_add | ( | struct EnumPropertyItem ** | items, |
int * | totitem, | ||
const char * | view_name | ||
) |
Definition at line 3337 of file colormanagement.c.
References colormanage_compatible_look(), EnumPropertyItem::description, ListBase::first, global_looks, EnumPropertyItem::icon, EnumPropertyItem::identifier, ColorManagedLook::index, ColorManagedLook::name, EnumPropertyItem::name, ColorManagedLook::next, RNA_enum_item_add(), ColorManagedLook::ui_name, and EnumPropertyItem::value.
void IMB_colormanagement_pixel_to_display_space_v3 | ( | float | result[3], |
const float | pixel[3], | ||
const struct ColorManagedViewSettings * | view_settings, | ||
const struct ColorManagedDisplaySettings * | display_settings | ||
) |
void IMB_colormanagement_pixel_to_display_space_v4 | ( | float | result[4], |
const float | pixel[4], | ||
const struct ColorManagedViewSettings * | view_settings, | ||
const struct ColorManagedDisplaySettings * | display_settings | ||
) |
Referenced by ED_image_draw_info().
void IMB_colormanagement_processor_apply | ( | struct ColormanageProcessor * | cm_processor, |
float * | buffer, | ||
int | width, | ||
int | height, | ||
int | channels, | ||
bool | predivide | ||
) |
Definition at line 3884 of file colormanagement.c.
References buffer, channels(), ColormanageProcessor::cpu_processor, ColormanageProcessor::curve_mapping, curve_mapping_apply_pixel(), height, OCIO_cpuProcessorApply(), OCIO_cpuProcessorApply_predivide(), OCIO_createOCIO_PackedImageDesc(), OCIO_PackedImageDescRelease(), width, x, and y.
Referenced by blender::compositor::MemoryBuffer::apply_processor(), colormanagement_transform_ex(), do_display_buffer_apply_thread(), do_processor_transform_thread(), and IMB_display_buffer_transform_apply().
void IMB_colormanagement_processor_apply_byte | ( | struct ColormanageProcessor * | cm_processor, |
unsigned char * | buffer, | ||
int | width, | ||
int | height, | ||
int | channels | ||
) |
Definition at line 3927 of file colormanagement.c.
References BLI_assert, buffer, channels(), height, IMB_colormanagement_processor_apply_v4(), offset, rgba_float_to_uchar(), rgba_uchar_to_float(), width, x, and y.
Referenced by colormanagement_transform_ex(), and do_processor_transform_thread().
void IMB_colormanagement_processor_apply_pixel | ( | struct ColormanageProcessor * | cm_processor, |
float * | pixel, | ||
int | channels | ||
) |
Definition at line 3863 of file colormanagement.c.
References BLI_assert, channels(), ColormanageProcessor::curve_mapping, curve_mapping_apply_pixel(), IMB_colormanagement_processor_apply_v3(), and IMB_colormanagement_processor_apply_v4_predivide().
Referenced by blender::compositor::ConvertColorSpaceOperation::execute_pixel_sampled(), and partial_buffer_update_rect().
void IMB_colormanagement_processor_apply_v3 | ( | struct ColormanageProcessor * | cm_processor, |
float | pixel[3] | ||
) |
Definition at line 3852 of file colormanagement.c.
References BKE_curvemapping_evaluate_premulRGBF(), ColormanageProcessor::cpu_processor, ColormanageProcessor::curve_mapping, and OCIO_cpuProcessorApplyRGB().
Referenced by BKE_histogram_update_sample_line(), IMB_colormanagement_pixel_to_display_space_v3(), IMB_colormanagement_processor_apply_pixel(), and scopes_update_cb().
void IMB_colormanagement_processor_apply_v4 | ( | struct ColormanageProcessor * | cm_processor, |
float | pixel[4] | ||
) |
Definition at line 3829 of file colormanagement.c.
References BKE_curvemapping_evaluate_premulRGBF(), ColormanageProcessor::cpu_processor, ColormanageProcessor::curve_mapping, and OCIO_cpuProcessorApplyRGBA().
Referenced by BKE_histogram_update_sample_line(), blender::compositor::PreviewOperation::execute_region(), IMB_colormanagement_pixel_to_display_space_v4(), IMB_colormanagement_processor_apply_byte(), IMB_colormanagement_transform_v4(), blender::ed::sculpt_paint::paint::image::PaintingKernel< ImageBuffer >::init_brush_color(), scopes_update_cb(), and blender::compositor::PreviewOperation::update_memory_buffer_partial().
void IMB_colormanagement_processor_apply_v4_predivide | ( | struct ColormanageProcessor * | cm_processor, |
float | pixel[4] | ||
) |
Definition at line 3840 of file colormanagement.c.
References BKE_curvemapping_evaluate_premulRGBF(), ColormanageProcessor::cpu_processor, ColormanageProcessor::curve_mapping, and OCIO_cpuProcessorApplyRGBA_predivide().
Referenced by IMB_colormanagement_processor_apply_pixel().
void IMB_colormanagement_processor_free | ( | struct ColormanageProcessor * | cm_processor | ) |
Definition at line 3945 of file colormanagement.c.
References BKE_curvemapping_free(), ColormanageProcessor::cpu_processor, ColormanageProcessor::curve_mapping, MEM_freeN, and OCIO_cpuProcessorRelease().
Referenced by BKE_histogram_update_sample_line(), BKE_scopes_update(), colormanage_display_buffer_process_ex(), colormanagement_transform_ex(), blender::compositor::ConvertColorSpaceOperation::deinit_execution(), blender::compositor::PreviewOperation::execute_region(), IMB_colormanagement_pixel_to_display_space_v3(), IMB_colormanagement_pixel_to_display_space_v4(), IMB_colormanagement_transform_from_byte_threaded(), IMB_colormanagement_transform_v4(), IMB_display_buffer_transform_apply(), imb_partial_display_buffer_update_ex(), blender::ed::sculpt_paint::paint::image::PaintingKernel< ImageBuffer >::init_brush_color(), and blender::compositor::PreviewOperation::update_memory_buffer_partial().
BLI_INLINE void IMB_colormanagement_rec709_to_scene_linear | ( | float | scene_linear[3], |
const float | rec709[3] | ||
) |
Definition at line 40 of file colormanagement_inline.c.
References imbuf_rec709_to_scene_linear, and mul_v3_m3v3().
Referenced by Color_from_rec709_linear_to_scene_linear(), and IMB_colormanagement_blackbody_temperature_to_rgb_table().
const char* IMB_colormanagement_role_colorspace_name_get | ( | int | role | ) |
Definition at line 1274 of file colormanagement.c.
References BLI_assert, COLOR_ROLE_COLOR_PICKING, COLOR_ROLE_DATA, COLOR_ROLE_DEFAULT_BYTE, COLOR_ROLE_DEFAULT_FLOAT, COLOR_ROLE_DEFAULT_SEQUENCER, COLOR_ROLE_SCENE_LINEAR, COLOR_ROLE_TEXTURE_PAINTING, global_role_color_picking, global_role_data, global_role_default_byte, global_role_default_float, global_role_default_sequencer, global_role_scene_linear, global_role_texture_painting, and NULL.
Referenced by add_ibuf_size(), BKE_image_add_generated(), BKE_image_format_color_management_copy_from_scene(), BKE_image_format_init_for_write(), BKE_image_save_options_init(), BKE_image_save_options_update(), colormanage_colorspace_get_roled(), colorspace_set_default_role(), image_colorspace_from_imbuf(), image_exr_from_scene_linear_to_output(), image_get_render_result(), image_node_colorspace(), IMB_colormanagement_colorspace_from_ibuf_ftype(), IMB_colormanagement_get_float_colorspace(), IMB_colormanagement_get_rect_colorspace(), IMB_rect_from_float(), blender::ed::sculpt_paint::paint::image::PaintingKernel< ImageBuffer >::init_brush_color(), blender::nodes::node_composite_convert_color_space_cc::node_composit_init_convert_colorspace(), render_result_exr_file_cache_read(), render_result_new_from_exr(), scene_init_data(), seq_add_set_view_transform(), SEQ_render_imbuf_from_sequencer_space(), SEQ_render_pixel_from_sequencer_space_v4(), wm_main_playanim_intern(), write_external_bake_pixels(), and write_internal_bake_pixels().
BLI_INLINE void IMB_colormanagement_scene_linear_to_aces | ( | float | aces[3], |
const float | scene_linear[3] | ||
) |
Definition at line 67 of file colormanagement_inline.c.
References imbuf_scene_linear_to_aces, and mul_v3_m3v3().
Referenced by Color_from_scene_linear_to_aces().
void IMB_colormanagement_scene_linear_to_color_picking_v3 | ( | float | color_picking[3], |
const float | scene_linear[3] | ||
) |
Conversion between color picking role. Typically we would expect such a requirements:
Definition at line 2342 of file colormanagement.c.
References BLI_mutex_lock(), BLI_mutex_unlock(), copy_v3_v3(), global_color_picking_state::cpu_processor_to, create_colorspace_transform_processor(), global_color_picking_state::failed, global_role_color_picking, global_role_scene_linear, NULL, OCIO_cpuProcessorApplyRGB(), OCIO_processorGetCPUProcessor(), OCIO_processorRelease(), and processor_lock.
Referenced by ui_scene_linear_to_perceptual_space().
void IMB_colormanagement_scene_linear_to_colorspace_v3 | ( | float | pixel[3], |
struct ColorSpace * | colorspace | ||
) |
Same as IMB_colormanagement_colorspace_to_scene_linear_v4, but converts colors in opposite direction.
Definition at line 2128 of file colormanagement.c.
References colorspace_from_scene_linear_cpu_processor(), NULL, and OCIO_cpuProcessorApplyRGB().
Referenced by tonemapmodifier_apply_threaded_photoreceptor(), and tonemapmodifier_apply_threaded_simple().
void IMB_colormanagement_scene_linear_to_display_v3 | ( | float | pixel[3], |
struct ColorManagedDisplay * | display | ||
) |
Convert pixel from scene linear to display space using default view used by performance-critical areas such as color-related widgets where we want to reduce amount of per-widget allocations.
Definition at line 2402 of file colormanagement.c.
References display_from_scene_linear_processor(), NULL, and OCIO_cpuProcessorApplyRGB().
Referenced by brush_painter_imbuf_new(), brush_painter_imbuf_update(), eyedropper_color_set(), eyedropper_gpencil_color_set(), ui_block_cm_to_display_space_v3(), ui_draw_but_COLORBAND(), and ui_draw_colorband_handle().
BLI_INLINE void IMB_colormanagement_scene_linear_to_rec709 | ( | float | rec709[3], |
const float | scene_linear[3] | ||
) |
Definition at line 45 of file colormanagement_inline.c.
References imbuf_scene_linear_to_rec709, and mul_v3_m3v3().
Referenced by Color_from_scene_linear_to_rec709_linear().
BLI_INLINE void IMB_colormanagement_scene_linear_to_srgb_v3 | ( | float | srgb[3], |
const float | scene_linear[3] | ||
) |
Conversion between sRGB, for rare cases like hex color or copy/pasting between UI theme and scene linear colors.
Definition at line 50 of file colormanagement_inline.c.
References imbuf_scene_linear_to_rec709, linearrgb_to_srgb_v3_v3(), and mul_v3_m3v3().
Referenced by Color_from_scene_linear_to_srgb(), drop_color_invoke(), paint_brush_color_get(), sculpt_sample_color_invoke(), ui_block_colorpicker(), ui_do_but_COLOR(), and ui_update_color_picker_buts_rgb().
BLI_INLINE void IMB_colormanagement_scene_linear_to_xyz | ( | float | xyz[3], |
const float | scene_linear[3] | ||
) |
Definition at line 35 of file colormanagement_inline.c.
References imbuf_scene_linear_to_xyz, and mul_v3_m3v3().
Referenced by Color_from_scene_linear_to_xyz_d65().
bool IMB_colormanagement_setup_glsl_draw | ( | const struct ColorManagedViewSettings * | view_settings, |
const struct ColorManagedDisplaySettings * | display_settings, | ||
float | dither, | ||
bool | predivide | ||
) |
Configures GLSL shader for conversion from scene linear to display space.
Referenced by ED_draw_imbuf_clipping(), and ocio_transform_ibuf().
bool IMB_colormanagement_setup_glsl_draw_ctx | ( | const struct bContext * | C, |
float | dither, | ||
bool | predivide | ||
) |
Same as setup_glsl_draw, but color management settings are guessing from a given context.
Referenced by sequencer_OCIO_transform_ibuf().
bool IMB_colormanagement_setup_glsl_draw_from_space | ( | const struct ColorManagedViewSettings * | view_settings, |
const struct ColorManagedDisplaySettings * | display_settings, | ||
struct ColorSpace * | colorspace, | ||
float | dither, | ||
bool | predivide, | ||
bool | do_overlay_merge | ||
) |
Configures GLSL shader for conversion from specified to display color space
Will create appropriate OCIO processor and setup GLSL shader, so further 2D texture usage will use this conversion.
When there's no need to apply transform on 2D textures, use IMB_colormanagement_finish_glsl_draw().
This is low-level function, use ED_draw_imbuf_ctx if you only need to display given image buffer
Referenced by ED_draw_imbuf_clipping(), gpu_viewport_draw_colormanaged(), and ocio_transform_ibuf().
bool IMB_colormanagement_setup_glsl_draw_from_space_ctx | ( | const struct bContext * | C, |
struct ColorSpace * | colorspace, | ||
float | dither, | ||
bool | predivide | ||
) |
Same as setup_glsl_draw_from_space
, but color management settings are guessing from a given context.
Referenced by sequencer_OCIO_transform_ibuf().
bool IMB_colormanagement_space_is_data | ( | struct ColorSpace * | colorspace | ) |
Definition at line 1375 of file colormanagement.c.
References ColorSpace::is_data.
Referenced by gpu_texture_update_from_ibuf(), IMB_colormanagement_imbuf_to_byte_texture(), imb_gpu_get_data(), and imb_gpu_get_format().
bool IMB_colormanagement_space_is_scene_linear | ( | struct ColorSpace * | colorspace | ) |
Definition at line 1399 of file colormanagement.c.
References colormanage_ensure_srgb_scene_linear_info(), ColorSpace::info, and ColorSpace::is_scene_linear.
Referenced by gpu_texture_update_from_ibuf(), IMB_colormanagement_imbuf_to_byte_texture(), IMB_colormanagement_space_name_is_scene_linear(), imb_gpu_get_data(), and imb_gpu_get_format().
bool IMB_colormanagement_space_is_srgb | ( | struct ColorSpace * | colorspace | ) |
Definition at line 1405 of file colormanagement.c.
References colormanage_ensure_srgb_scene_linear_info(), ColorSpace::info, and ColorSpace::is_srgb.
Referenced by gpu_texture_update_from_ibuf(), IMB_colormanagement_imbuf_to_byte_texture(), IMB_colormanagement_space_name_is_srgb(), imb_gpu_get_data(), and imb_gpu_get_format().
bool IMB_colormanagement_space_name_is_data | ( | const char * | name | ) |
Definition at line 1411 of file colormanagement.c.
References colormanage_colorspace_get_named(), and ColorSpace::is_data.
Referenced by add_ibuf_size(), BKE_image_save_options_init(), BKE_image_save_options_update(), blender::nodes::node_geo_image_texture_cc::ImageFieldsFunction::call(), blender::io::usd::get_node_tex_image_color_space(), imb_handle_alpha(), blender::ed::space_node::node_buts_image_user(), blender::nodes::node_shader_tex_environment_cc::node_shader_gpu_tex_environment(), blender::nodes::node_shader_tex_image_cc::node_shader_gpu_tex_image(), and uiTemplateImage().
bool IMB_colormanagement_space_name_is_scene_linear | ( | const char * | name | ) |
Definition at line 1417 of file colormanagement.c.
References colormanage_colorspace_get_named(), and IMB_colormanagement_space_is_scene_linear().
Referenced by BKE_image_save_options_update(), and image_exr_from_scene_linear_to_output().
bool IMB_colormanagement_space_name_is_srgb | ( | const char * | name | ) |
Definition at line 1423 of file colormanagement.c.
References colormanage_colorspace_get_named(), and IMB_colormanagement_space_is_srgb().
Referenced by blender::io::usd::get_node_tex_image_color_space().
BLI_INLINE void IMB_colormanagement_srgb_to_scene_linear_v3 | ( | float | scene_linear[3], |
const float | srgb[3] | ||
) |
Definition at line 56 of file colormanagement_inline.c.
References imbuf_rec709_to_scene_linear, mul_m3_v3(), and srgb_to_linearrgb_v3_v3().
Referenced by Color_from_srgb_to_scene_linear(), do_paint_brush_task_cb_ex(), drop_color_invoke(), sculpt_color_filter_modal(), sculpt_expand_cache_initial_config_set(), ui_colorpicker_hex_rna_cb(), ui_do_but_COLOR(), and vpaint_get_current_col().
bool IMB_colormanagement_support_glsl_draw | ( | const struct ColorManagedViewSettings * | view_settings | ) |
Test if GLSL drawing is supported for combination of graphics card and this configuration.
Referenced by screen_render_invoke().
void IMB_colormanagement_transform | ( | float * | buffer, |
int | width, | ||
int | height, | ||
int | channels, | ||
const char * | from_colorspace, | ||
const char * | to_colorspace, | ||
bool | predivide | ||
) |
Convert the whole buffer from specified by name color space to another.
Definition at line 1987 of file colormanagement.c.
References buffer, channels(), colormanagement_transform_ex(), height, NULL, and width.
Referenced by colormanage_imbuf_make_linear(), display_buffer_apply_get_linear_buffer(), image_exr_from_scene_linear_to_output(), IMB_colormanagement_imbuf_for_write(), IMB_colormanagement_transform_from_byte(), IMB_rect_from_float(), render_result_new_from_exr(), write_external_bake_pixels(), and write_internal_bake_pixels().
void IMB_colormanagement_transform_byte | ( | unsigned char * | buffer, |
int | width, | ||
int | height, | ||
int | channels, | ||
const char * | from_colorspace, | ||
const char * | to_colorspace | ||
) |
Similar to IMB_colormanagement_transform_threaded, but operates on byte buffer.
Definition at line 2011 of file colormanagement.c.
References buffer, channels(), colormanagement_transform_ex(), height, NULL, and width.
void IMB_colormanagement_transform_byte_threaded | ( | unsigned char * | buffer, |
int | width, | ||
int | height, | ||
int | channels, | ||
const char * | from_colorspace, | ||
const char * | to_colorspace | ||
) |
Definition at line 2021 of file colormanagement.c.
References buffer, channels(), colormanagement_transform_ex(), height, NULL, and width.
Referenced by IMB_colormanagement_imbuf_for_write(), and seq_imbuf_to_sequencer_space().
void IMB_colormanagement_transform_from_byte | ( | float * | float_buffer, |
unsigned char * | byte_buffer, | ||
int | width, | ||
int | height, | ||
int | channels, | ||
const char * | from_colorspace, | ||
const char * | to_colorspace | ||
) |
Similar to IMB_colormanagement_transform_byte_threaded, but gets float buffer from display one.
Definition at line 2032 of file colormanagement.c.
References channels(), height, IB_PROFILE_SRGB, IMB_buffer_float_from_byte(), IMB_colormanagement_transform(), and width.
void IMB_colormanagement_transform_from_byte_threaded | ( | float * | float_buffer, |
unsigned char * | byte_buffer, | ||
int | width, | ||
int | height, | ||
int | channels, | ||
const char * | from_colorspace, | ||
const char * | to_colorspace | ||
) |
Definition at line 2052 of file colormanagement.c.
References channels(), height, IB_PROFILE_SRGB, IMB_buffer_float_from_byte(), IMB_colormanagement_colorspace_processor_new(), IMB_colormanagement_processor_free(), IMB_premultiply_rect_float(), NULL, processor_transform_apply_threaded(), STREQ, and width.
Referenced by seq_imbuf_to_sequencer_space().
void IMB_colormanagement_transform_threaded | ( | float * | buffer, |
int | width, | ||
int | height, | ||
int | channels, | ||
const char * | from_colorspace, | ||
const char * | to_colorspace, | ||
bool | predivide | ||
) |
Convert the whole buffer from specified by name color space to another will do threaded conversion.
Definition at line 1999 of file colormanagement.c.
References buffer, channels(), colormanagement_transform_ex(), height, NULL, and width.
Referenced by seq_imbuf_to_sequencer_space(), and SEQ_render_imbuf_from_sequencer_space().
void IMB_colormanagement_transform_v4 | ( | float | pixel[4], |
const char * | from_colorspace, | ||
const char * | to_colorspace | ||
) |
Definition at line 2087 of file colormanagement.c.
References IMB_colormanagement_colorspace_processor_new(), IMB_colormanagement_processor_apply_v4(), IMB_colormanagement_processor_free(), and STREQ.
Referenced by SEQ_render_pixel_from_sequencer_space_v4().
void IMB_colormanagement_validate_settings | ( | const struct ColorManagedDisplaySettings * | display_settings, |
struct ColorManagedViewSettings * | view_settings | ||
) |
Referenced by BKE_color_managed_view_settings_init_render().
const char* IMB_colormanagement_view_get_default_name | ( | const char * | display_name | ) |
Definition at line 3032 of file colormanagement.c.
References colormanage_display_get_named(), colormanage_view_get_default(), NULL, and view.
Referenced by BKE_scene_disable_color_management().
const char* IMB_colormanagement_view_get_indexed_name | ( | int | index | ) |
Definition at line 3021 of file colormanagement.c.
References colormanage_view_get_indexed(), NULL, and view.
int IMB_colormanagement_view_get_named_index | ( | const char * | name | ) |
Definition at line 3010 of file colormanagement.c.
References colormanage_view_get_named(), and view.
Referenced by colormanage_view_settings_to_cache().
void IMB_colormanagement_view_items_add | ( | struct EnumPropertyItem ** | items, |
int * | totitem, | ||
const char * | display_name | ||
) |
Definition at line 3319 of file colormanagement.c.
References colormanage_display_get_named(), colormanagement_view_item_add(), LinkData::data, ListBase::first, LinkData::next, view, and ColorManagedDisplay::views.
Definition at line 4291 of file colormanagement.c.
References clamp_v3(), copy_v3_v3(), float(), IMB_colormanagement_xyz_to_scene_linear(), usdtokens::rgb(), wavelength_to_xyz(), and width.
Referenced by blender::nodes::node_shader_wavelength_cc::node_shader_gpu_wavelength().
BLI_INLINE void IMB_colormanagement_xyz_to_scene_linear | ( | float | scene_linear[3], |
const float | xyz[3] | ||
) |
Conversion between scene linear and other color spaces.
Definition at line 30 of file colormanagement_inline.c.
References imbuf_xyz_to_scene_linear, and mul_v3_m3v3().
Referenced by Color_from_xyz_d65_to_scene_linear(), and IMB_colormanagement_wavelength_to_rgb_table().
unsigned char* IMB_display_buffer_acquire | ( | struct ImBuf * | ibuf, |
const struct ColorManagedViewSettings * | view_settings, | ||
const struct ColorManagedDisplaySettings * | display_settings, | ||
void ** | cache_handle | ||
) |
Acquire display buffer for given image buffer using specified view and display settings.
Referenced by BKE_scopes_update(), draw_plane_marker_image(), ED_draw_imbuf_clipping(), and ocio_transform_ibuf().
unsigned char* IMB_display_buffer_acquire_ctx | ( | const struct bContext * | C, |
struct ImBuf * | ibuf, | ||
void ** | cache_handle | ||
) |
Same as IMB_display_buffer_acquire but gets view and display settings from context.
Referenced by sequencer_OCIO_transform_ibuf().
Definition at line 2796 of file colormanagement.c.
References BLI_thread_lock(), BLI_thread_unlock(), colormanage_cache_handle_release(), and LOCK_COLORMANAGE.
Referenced by BKE_scopes_update(), draw_display_buffer(), draw_plane_marker_image(), ED_draw_imbuf_clipping(), imb_partial_display_buffer_update_ex(), and sequencer_draw_display_buffer().
void IMB_display_buffer_transform_apply | ( | unsigned char * | display_buffer, |
float * | linear_buffer, | ||
int | width, | ||
int | height, | ||
int | channels, | ||
const struct ColorManagedViewSettings * | view_settings, | ||
const struct ColorManagedDisplaySettings * | display_settings, | ||
bool | predivide | ||
) |
Referenced by render_result_rect_get_pixels().
void IMB_partial_display_buffer_update | ( | struct ImBuf * | ibuf, |
const float * | linear_buffer, | ||
const unsigned char * | byte_buffer, | ||
int | stride, | ||
int | offset_x, | ||
int | offset_y, | ||
const struct ColorManagedViewSettings * | view_settings, | ||
const struct ColorManagedDisplaySettings * | display_settings, | ||
int | xmin, | ||
int | ymin, | ||
int | xmax, | ||
int | ymax | ||
) |
Referenced by image_buffer_rect_update().
void IMB_partial_display_buffer_update_delayed | ( | struct ImBuf * | ibuf, |
int | xmin, | ||
int | ymin, | ||
int | xmax, | ||
int | ymax | ||
) |
Definition at line 3750 of file colormanagement.c.
References BLI_rcti_init(), BLI_rcti_union(), ImBuf::invalid_rect, rcti::xmax, and rcti::xmin.
Referenced by imapaint_image_update().
void IMB_partial_display_buffer_update_threaded | ( | struct ImBuf * | ibuf, |
const float * | linear_buffer, | ||
const unsigned char * | byte_buffer, | ||
int | stride, | ||
int | offset_x, | ||
int | offset_y, | ||
const struct ColorManagedViewSettings * | view_settings, | ||
const struct ColorManagedDisplaySettings * | display_settings, | ||
int | xmin, | ||
int | ymin, | ||
int | xmax, | ||
int | ymax | ||
) |
Definition at line 3718 of file colormanagement.c.
References height, imb_partial_display_buffer_update_ex(), stride, and width.
Referenced by IMB_display_buffer_acquire().