Blender
V3.3
|
#include "IMB_colormanagement.h"
#include "IMB_colormanagement_intern.h"
#include <math.h>
#include <string.h>
#include "DNA_color_types.h"
#include "DNA_image_types.h"
#include "DNA_movieclip_types.h"
#include "DNA_scene_types.h"
#include "DNA_space_types.h"
#include "IMB_filetype.h"
#include "IMB_filter.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "IMB_metadata.h"
#include "IMB_moviecache.h"
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_math_color.h"
#include "BLI_rect.h"
#include "BLI_string.h"
#include "BLI_threads.h"
#include "BKE_appdir.h"
#include "BKE_colortools.h"
#include "BKE_context.h"
#include "BKE_image.h"
#include "BKE_image_format.h"
#include "BKE_main.h"
#include "RNA_define.h"
#include "SEQ_iterator.h"
#include <ocio_capi.h>
Go to the source code of this file.
Classes | |
struct | ColormanageProcessor |
struct | global_gpu_state |
struct | global_color_picking_state |
struct | ColormanageCacheViewSettings |
struct | ColormanageCacheDisplaySettings |
struct | ColormanageCacheKey |
struct | ColormanageCacheData |
struct | ColormanageCache |
struct | DisplayBufferThread |
struct | DisplayBufferInitData |
struct | ProcessorTransformThread |
struct | ProcessorTransformInit |
struct | PartialThreadData |
Threaded Display Buffer Transform Routines | |
typedef struct DisplayBufferThread | DisplayBufferThread |
typedef struct DisplayBufferInitData | DisplayBufferInitData |
static void | display_buffer_init_handle (void *handle_v, int start_line, int tot_line, void *init_data_v) |
static void | display_buffer_apply_get_linear_buffer (DisplayBufferThread *handle, int height, float *linear_buffer, bool *is_straight_alpha) |
static void * | do_display_buffer_apply_thread (void *handle_v) |
static void | display_buffer_apply_threaded (ImBuf *ibuf, const float *buffer, unsigned char *byte_buffer, float *display_buffer, unsigned char *display_buffer_byte, ColormanageProcessor *cm_processor) |
static bool | is_ibuf_rect_in_display_space (ImBuf *ibuf, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings) |
static void | colormanage_display_buffer_process_ex (ImBuf *ibuf, float *display_buffer, unsigned char *display_buffer_byte, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings) |
static void | colormanage_display_buffer_process (ImBuf *ibuf, unsigned char *display_buffer, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings) |
Threaded Processor Transform Routines | |
typedef struct ProcessorTransformThread | ProcessorTransformThread |
typedef struct ProcessorTransformInit | ProcessorTransformInitData |
static void | processor_transform_init_handle (void *handle_v, int start_line, int tot_line, void *init_data_v) |
static void * | do_processor_transform_thread (void *handle_v) |
static void | processor_transform_apply_threaded (unsigned char *byte_buffer, float *float_buffer, const int width, const int height, const int channels, ColormanageProcessor *cm_processor, const bool predivide, const bool float_from_byte) |
Partial Display Buffer Update | |
typedef struct PartialThreadData | PartialThreadData |
static void | partial_buffer_update_rect (ImBuf *ibuf, unsigned char *display_buffer, const float *linear_buffer, const unsigned char *byte_buffer, int display_stride, int linear_stride, int linear_offset_x, int linear_offset_y, ColormanageProcessor *cm_processor, const int xmin, const int ymin, const int xmax, const int ymax) |
static void | partial_buffer_update_rect_thread_do (void *data_v, int scanline) |
static void | imb_partial_display_buffer_update_ex (ImBuf *ibuf, const float *linear_buffer, const unsigned char *byte_buffer, int stride, int offset_x, int offset_y, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, int xmin, int ymin, int xmax, int ymax, bool do_threads) |
void | IMB_partial_display_buffer_update (ImBuf *ibuf, const float *linear_buffer, const unsigned char *byte_buffer, int stride, int offset_x, int offset_y, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, int xmin, int ymin, int xmax, int ymax) |
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) |
void | IMB_partial_display_buffer_update_delayed (ImBuf *ibuf, int xmin, int ymin, int xmax, int ymax) |
Rendering Tables | |
static const float | blackbody_table_r [7][3] |
static const float | blackbody_table_g [7][3] |
static const float | blackbody_table_b [7][4] |
static float | cie_colour_match [81][3] |
static void | blackbody_temperature_to_rec709 (float rec709[3], float t) |
void | IMB_colormanagement_blackbody_temperature_to_rgb_table (float *r_table, const int width, const float min, const float max) |
static void | wavelength_to_xyz (float xyz[3], float lambda_nm) |
void | IMB_colormanagement_wavelength_to_rgb_table (float *r_table, const int width) |
#define DISPLAY_BUFFER_CHANNELS 4 |
Definition at line 53 of file colormanagement.c.
typedef struct ColormanageCache ColormanageCache |
typedef struct ColormanageCacheData ColormanageCacheData |
typedef struct ColormanageCacheDisplaySettings ColormanageCacheDisplaySettings |
typedef struct ColormanageCacheKey ColormanageCacheKey |
typedef struct ColormanageCacheViewSettings ColormanageCacheViewSettings |
All color management cache stuff is stored in two properties of image buffers:
display_buffer_flags
This is a bit field which used to mark calculated transformations for particular image buffer. Index inside of this array means index of a color managed display. Element with given index matches view transformations applied for a given display. So if bit B of array element B is set to 1, this means display buffer with display index of A and view transform of B was ever calculated for this imbuf.
In contrast with indices in global lists of displays and views this indices are 0-based, not 1-based. This is needed to save some bytes of memory.
colormanage_cache
This is a pointer to a structure which holds all data which is needed for color management cache to work.
It contains two parts:
Data field is used to store additional information about cached buffers which affects on whether cached buffer could be used. This data can't go to cache key because changes in this data shouldn't lead extra buffers adding to cache, it shall invalidate cached images.
Currently such a data contains only exposure and gamma, but would likely extended further.
data field is not null only for elements of cache, not used for original image buffers.
Color management cache is using generic MovieCache implementation to make it easier to deal with memory limitation.
Currently color management is using the same memory limitation pool as sequencer and clip editor are using which means color managed buffers would be removed from the cache as soon as new frames are loading for the movie clip and there's no space in cache.
Every image buffer has got own movie cache instance, which means keys for color managed buffers could be really simple and look up in this cache would be fast and independent from overall amount of color managed images.
typedef struct ColormanageProcessor ColormanageProcessor |
typedef struct DisplayBufferInitData DisplayBufferInitData |
typedef struct DisplayBufferThread DisplayBufferThread |
typedef struct PartialThreadData PartialThreadData |
typedef struct ProcessorTransformInit ProcessorTransformInitData |
typedef struct ProcessorTransformThread ProcessorTransformThread |
Definition at line 4179 of file colormanagement.c.
References usdtokens::b(), blackbody_table_b, blackbody_table_g, blackbody_table_r, usdtokens::g(), r, and t.
Referenced by IMB_colormanagement_blackbody_temperature_to_rgb_table().
Definition at line 765 of file colormanagement.c.
References ImBuf::colormanage_cache, colormanage_cachedata_get(), colormanage_moviecache_get(), ImBuf::display_buffer_flags, IMB_moviecache_free(), MEM_freeN, MEM_SAFE_FREE, and NULL.
Referenced by IMB_freeImBuf().
|
static |
Definition at line 339 of file colormanagement.c.
References BLI_assert, CurveMapping::changed_timestamp, colormanage_cache_get_ibuf(), colormanage_cachedata_get(), colormanage_settings_to_key(), ColormanageCacheViewSettings::curve_mapping, ColormanageCacheData::curve_mapping, ColormanageCacheData::curve_mapping_timestamp, ColormanageCacheDisplaySettings::display, ImBuf::display_buffer_flags, ColormanageCacheViewSettings::dither, ColormanageCacheData::dither, ColormanageCacheViewSettings::exposure, ColormanageCacheData::exposure, ColormanageCacheViewSettings::flag, ColormanageCacheData::flag, ColormanageCacheViewSettings::gamma, ColormanageCacheData::gamma, IMB_freeImBuf(), ColormanageCacheViewSettings::look, ColormanageCacheData::look, NULL, ImBuf::rect, ColormanageCacheViewSettings::view, ImBuf::x, and ImBuf::y.
Referenced by IMB_display_buffer_acquire(), and imb_partial_display_buffer_update_ex().
|
static |
Definition at line 317 of file colormanagement.c.
References colormanage_moviecache_get(), IMB_moviecache_get(), and NULL.
Referenced by colormanage_cache_get().
Definition at line 436 of file colormanagement.c.
References IMB_freeImBuf().
Referenced by IMB_display_buffer_release().
|
static |
Definition at line 392 of file colormanagement.c.
References CurveMapping::changed_timestamp, colormanage_cachedata_set(), colormanage_moviecache_ensure(), colormanage_settings_to_key(), ColormanageCacheViewSettings::curve_mapping, ColormanageCacheData::curve_mapping, ColormanageCacheData::curve_mapping_timestamp, ColormanageCacheDisplaySettings::display, ImBuf::display_buffer_flags, ColormanageCacheViewSettings::dither, ColormanageCacheData::dither, ColormanageCacheViewSettings::exposure, ColormanageCacheData::exposure, ColormanageCacheViewSettings::flag, ColormanageCacheData::flag, ImBuf::flags, ColormanageCacheViewSettings::gamma, ColormanageCacheData::gamma, IB_rect, IMB_allocImBuf(), IMB_moviecache_put(), ColormanageCacheViewSettings::look, ColormanageCacheData::look, ImBuf::mall, MEM_callocN, ImBuf::planes, ImBuf::rect, ColormanageCacheViewSettings::view, ImBuf::x, and ImBuf::y.
Referenced by IMB_display_buffer_acquire().
|
static |
Definition at line 229 of file colormanagement.c.
References ImBuf::colormanage_cache, ColormanageCache::data, and NULL.
Referenced by colormanage_cache_free(), and colormanage_cache_get().
|
static |
Definition at line 275 of file colormanagement.c.
References ImBuf::colormanage_cache, data, ColormanageCache::data, and MEM_callocN.
Referenced by colormanage_cache_put().
|
static |
Definition at line 1172 of file colormanagement.c.
References BLI_strncpy(), colormanage_colorspace_get_named(), ColorManagedColorspaceSettings::name, and void.
Referenced by IMB_colormanagement_check_file_config(), and seq_callback().
|
static |
Definition at line 1080 of file colormanagement.c.
References BLI_strncpy(), colormanage_display_get_named(), ColorManagedDisplaySettings::display_device, and ColorManagedDisplay::name.
Referenced by IMB_colormanagement_check_file_config().
|
static |
Definition at line 1106 of file colormanagement.c.
References BLI_strncpy(), colormanage_display_get_named(), colormanage_look_get_named(), colormanage_view_get_default(), colormanage_view_get_named(), ColorManagedDisplaySettings::display_device, ColorManagedViewSettings::exposure, ListBase::first, ColorManagedViewSettings::gamma, global_looks, if(), ColorManagedViewSettings::look, ColorManagedView::name, ColorManagedLook::name, NULL, view, and ColorManagedViewSettings::view_transform.
Referenced by IMB_colormanagement_check_file_config().
ColorSpace* colormanage_colorspace_add | ( | const char * | name, |
const char * | description, | ||
bool | is_invertible, | ||
bool | is_data | ||
) |
Definition at line 3074 of file colormanagement.c.
References BLI_addtail(), BLI_insertlinkbefore(), BLI_strcasecmp(), BLI_strncpy(), colormanage_description_strip(), counter, ColorSpace::description, ListBase::first, global_colorspaces, global_tot_colorspace, ColorSpace::index, ColorSpace::is_data, ColorSpace::is_invertible, MEM_callocN, ColorSpace::name, and ColorSpace::next.
Referenced by colormanage_load_config().
ColorSpace* colormanage_colorspace_get_indexed | ( | int | index | ) |
Definition at line 3146 of file colormanagement.c.
References BLI_findlink(), and global_colorspaces.
Referenced by IMB_colormanagement_colorspace_get_indexed_name().
ColorSpace* colormanage_colorspace_get_named | ( | const char * | name | ) |
Definition at line 3120 of file colormanagement.c.
References ColorSpace::aliases, ListBase::first, global_colorspaces, ColorSpace::name, ColorSpace::next, NULL, ColorSpace::num_aliases, and STREQ.
Referenced by colormanage_check_colorspace_settings(), colormanage_colorspace_get_roled(), colormanage_imbuf_make_linear(), colormanage_imbuf_set_default_spaces(), display_transform_get_colorspace(), IMB_colormanagement_assign_float_colorspace(), IMB_colormanagement_assign_rect_colorspace(), IMB_colormanagement_check_is_data(), IMB_colormanagement_colorspace_from_ibuf_ftype(), IMB_colormanagement_colorspace_get_named_index(), IMB_colormanagement_colorspace_processor_new(), IMB_colormanagement_imbuf_for_write(), IMB_colormanagement_space_name_is_data(), IMB_colormanagement_space_name_is_scene_linear(), IMB_colormanagement_space_name_is_srgb(), imb_handle_alpha(), and imb_load_photoshop().
ColorSpace* colormanage_colorspace_get_roled | ( | int | role | ) |
Definition at line 3139 of file colormanagement.c.
References colormanage_colorspace_get_named(), and IMB_colormanagement_role_colorspace_name_get().
Referenced by IMB_saveiff().
|
static |
Definition at line 749 of file colormanagement.c.
References ColorManagedLook::is_noop, STREQ, and ColorManagedLook::view.
Referenced by colormanage_use_look(), and IMB_colormanagement_look_items_add().
|
static |
Definition at line 3054 of file colormanagement.c.
References ELEM.
Referenced by colormanage_colorspace_add().
ColorManagedDisplay* colormanage_display_add | ( | const char * | name | ) |
Definition at line 2836 of file colormanagement.c.
References BLI_addtail(), BLI_strncpy(), global_displays, ColorManagedDisplay::index, ListBase::last, MEM_callocN, and ColorManagedDisplay::name.
Referenced by colormanage_load_config().
|
static |
Definition at line 1796 of file colormanagement.c.
References colormanage_display_buffer_process_ex(), and NULL.
Referenced by IMB_display_buffer_acquire().
|
static |
Definition at line 1761 of file colormanagement.c.
References display_buffer_apply_threaded(), IMB_colormanagement_display_processor_new(), IMB_colormanagement_processor_free(), is_ibuf_rect_in_display_space(), NULL, ImBuf::rect, ImBuf::rect_colorspace, and ImBuf::rect_float.
Referenced by colormanage_display_buffer_process(), and colormanagement_imbuf_make_display_space().
ColorManagedDisplay* colormanage_display_get_default | ( | void | ) |
Definition at line 2825 of file colormanagement.c.
References colormanage_display_get_default_name(), colormanage_display_get_named(), and NULL.
Referenced by IMB_colormanagement_check_file_config(), and IMB_colormanagement_display_get_default_name().
const char* colormanage_display_get_default_name | ( | void | ) |
Definition at line 2813 of file colormanagement.c.
References OCIO_configGetDefaultDisplay(), OCIO_configRelease(), and OCIO_getCurrentConfig().
Referenced by colormanage_display_get_default(), and IMB_colormanagement_display_get_none_name().
ColorManagedDisplay* colormanage_display_get_indexed | ( | int | index | ) |
Definition at line 2871 of file colormanagement.c.
References BLI_findlink(), and global_displays.
Referenced by IMB_colormanagement_display_get_indexed_name().
ColorManagedDisplay* colormanage_display_get_named | ( | const char * | name | ) |
Definition at line 2858 of file colormanagement.c.
References ListBase::first, global_displays, ColorManagedDisplay::name, ColorManagedDisplay::next, NULL, and STREQ.
Referenced by colormanage_check_display_settings(), colormanage_check_view_settings(), colormanage_display_get_default(), colormanage_view_get_named_for_display(), IMB_colormanagement_display_get_named(), IMB_colormanagement_display_get_named_index(), IMB_colormanagement_display_get_none_name(), IMB_colormanagement_init_default_view_settings(), IMB_colormanagement_validate_settings(), IMB_colormanagement_view_get_default_name(), and IMB_colormanagement_view_items_add().
|
static |
Definition at line 300 of file colormanagement.c.
References ColormanageCacheDisplaySettings::display, ColorManagedDisplaySettings::display_device, and IMB_colormanagement_display_get_named_index().
Referenced by IMB_display_buffer_acquire(), and imb_partial_display_buffer_update_ex().
|
static |
Definition at line 1380 of file colormanagement.c.
References ColorSpace::cached, ColorSpace::info, ColorSpace::is_scene_linear, ColorSpace::is_srgb, ColorSpace::name, OCIO_colorSpaceIsBuiltin(), OCIO_colorSpaceRelease(), OCIO_configGetColorSpace(), OCIO_configRelease(), and OCIO_getCurrentConfig().
Referenced by IMB_colormanagement_space_is_scene_linear(), and IMB_colormanagement_space_is_srgb().
Definition at line 590 of file colormanagement.c.
References ColorSpace::aliases, BLI_freelistN(), BLI_listbase_clear(), ListBase::first, ColorSpace::from_scene_linear, ColorManagedDisplay::from_scene_linear, global_colorspaces, global_displays, global_looks, global_tot_colorspace, global_tot_display, global_tot_looks, global_tot_view, global_views, MEM_freeN, MEM_SAFE_FREE, ColorSpace::next, ColorManagedDisplay::next, OCIO_cpuProcessorRelease(), OCIO_exit(), ColorSpace::to_scene_linear, ColorManagedDisplay::to_scene_linear, and ColorManagedDisplay::views.
Referenced by colormanagement_exit(), and colormanagement_init().
Definition at line 247 of file colormanagement.c.
References Freestyle::a, and usdtokens::b().
Referenced by colormanage_moviecache_ensure().
|
static |
Definition at line 238 of file colormanagement.c.
References ColormanageCacheKey::display, and ColormanageCacheKey::view.
Referenced by colormanage_moviecache_ensure().
Definition at line 1047 of file colormanagement.c.
References ImBuf::channels, colormanage_colorspace_get_named(), ImBuf::colormanage_flag, global_role_scene_linear, IMB_alpha_affects_rgb(), IMB_COLORMANAGE_IS_DATA, IMB_colormanagement_transform(), imb_freerectImBuf(), ColorSpace::is_data, ImBuf::rect, ImBuf::rect_float, ImBuf::x, and ImBuf::y.
Referenced by imb_handle_alpha().
Definition at line 1042 of file colormanagement.c.
References colormanage_colorspace_get_named(), global_role_default_byte, and ImBuf::rect_colorspace.
Referenced by IMB_initImBuf().
|
static |
Definition at line 474 of file colormanagement.c.
References ColorSpace::aliases, BLI_addtail(), BLI_genericNodeN(), BLI_strncpy(), colormanage_colorspace_add(), colormanage_display_add(), colormanage_look_add(), colormanage_role_color_space_name_get(), colormanage_view_add(), colormanage_view_get_named(), 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, global_tot_display, imbuf_aces_to_scene_linear, imbuf_luma_coefficients, imbuf_rec709_to_scene_linear, imbuf_scene_linear_to_aces, imbuf_scene_linear_to_rec709, imbuf_scene_linear_to_xyz, imbuf_xyz_to_scene_linear, invert_m3_m3(), MAX_COLORSPACE_NAME, MEM_callocN, mul_m3_m3m3(), MovieCache::name, NULL, ColorSpace::num_aliases, OCIO_ACES_TO_XYZ, OCIO_colorSpaceGetAlias(), OCIO_colorSpaceGetDescription(), OCIO_colorSpaceGetNumAliases(), OCIO_colorSpaceIsData(), OCIO_colorSpaceIsInvertible(), OCIO_colorSpaceRelease(), OCIO_configGetColorSpace(), OCIO_configGetColorSpaceNameByIndex(), OCIO_configGetDefaultLumaCoefs(), OCIO_configGetDisplay(), OCIO_configGetLook(), OCIO_configGetLookNameByIndex(), OCIO_configGetNumColorSpaces(), OCIO_configGetNumDisplays(), OCIO_configGetNumLooks(), OCIO_configGetNumViews(), OCIO_configGetView(), OCIO_configGetXYZtoSceneLinear(), OCIO_lookGetProcessSpace(), OCIO_lookRelease(), OCIO_ROLE_COLOR_PICKING, OCIO_ROLE_DATA, OCIO_ROLE_DEFAULT_BYTE, OCIO_ROLE_DEFAULT_FLOAT, OCIO_ROLE_DEFAULT_SEQUENCER, OCIO_ROLE_SCENE_LINEAR, OCIO_ROLE_TEXTURE_PAINT, OCIO_XYZ_TO_REC709, view, and ColorManagedDisplay::views.
Referenced by colormanagement_init().
ColorManagedLook* colormanage_look_add | ( | const char * | name, |
const char * | process_space, | ||
bool | is_noop | ||
) |
Definition at line 3210 of file colormanagement.c.
References BLI_addtail(), BLI_strncpy(), global_looks, global_tot_looks, ColorManagedLook::index, ColorManagedLook::is_noop, MEM_callocN, ColorManagedLook::name, ColorManagedLook::process_space, ColorManagedLook::ui_name, and ColorManagedLook::view.
Referenced by colormanage_load_config().
ColorManagedLook* colormanage_look_get_indexed | ( | int | index | ) |
Definition at line 3249 of file colormanagement.c.
References BLI_findlink(), and global_looks.
Referenced by IMB_colormanagement_look_get_indexed_name().
ColorManagedLook* colormanage_look_get_named | ( | const char * | name | ) |
Definition at line 3236 of file colormanagement.c.
References ListBase::first, global_looks, ColorManagedLook::name, ColorManagedLook::next, NULL, and STREQ.
Referenced by colormanage_check_view_settings(), colormanage_use_look(), IMB_colormanagement_look_get_named_index(), and is_ibuf_rect_in_display_space().
|
static |
Definition at line 255 of file colormanagement.c.
References ImBuf::colormanage_cache, colormanage_hashcmp(), colormanage_hashhash(), IMB_moviecache_create(), MEM_callocN, and ColormanageCache::moviecache.
Referenced by colormanage_cache_put().
|
static |
Definition at line 220 of file colormanagement.c.
References ImBuf::colormanage_cache, ColormanageCache::moviecache, and NULL.
Referenced by colormanage_cache_free(), and colormanage_cache_get_ibuf().
|
static |
Definition at line 449 of file colormanagement.c.
References BLI_strncpy(), MAX_COLORSPACE_NAME, MovieCache::name, OCIO_colorSpaceGetName(), OCIO_colorSpaceRelease(), and OCIO_configGetColorSpace().
Referenced by colormanage_load_config().
|
static |
Definition at line 309 of file colormanagement.c.
References ColormanageCacheDisplaySettings::display, ColormanageCacheKey::display, ColormanageCacheViewSettings::view, and ColormanageCacheKey::view.
Referenced by colormanage_cache_get(), and colormanage_cache_put().
|
static |
Definition at line 759 of file colormanagement.c.
References colormanage_compatible_look(), colormanage_look_get_named(), and ColorManagedLook::is_noop.
Referenced by create_display_buffer_processor(), and IMB_colormanagement_setup_glsl_draw_from_space().
ColorManagedView* colormanage_view_add | ( | const char * | name | ) |
Definition at line 2959 of file colormanagement.c.
References BLI_addtail(), BLI_strncpy(), global_tot_view, global_views, MEM_callocN, and view.
Referenced by colormanage_load_config().
ColorManagedView* colormanage_view_get_default | ( | const ColorManagedDisplay * | display | ) |
Definition at line 2948 of file colormanagement.c.
References colormanage_view_get_default_name(), colormanage_view_get_named(), and NULL.
Referenced by colormanage_check_view_settings(), IMB_colormanagement_init_default_view_settings(), IMB_colormanagement_validate_settings(), and IMB_colormanagement_view_get_default_name().
const char* colormanage_view_get_default_name | ( | const ColorManagedDisplay * | display | ) |
Definition at line 2936 of file colormanagement.c.
References ColorManagedDisplay::name, OCIO_configGetDefaultView(), OCIO_configRelease(), and OCIO_getCurrentConfig().
Referenced by colormanage_view_get_default(), display_from_scene_linear_processor(), display_to_scene_linear_processor(), and IMB_colormanagement_display_get_default_view_transform_name().
ColorManagedView* colormanage_view_get_indexed | ( | int | index | ) |
Definition at line 2988 of file colormanagement.c.
References BLI_findlink(), and global_views.
Referenced by IMB_colormanagement_view_get_indexed_name().
ColorManagedView* colormanage_view_get_named | ( | const char * | name | ) |
Definition at line 2975 of file colormanagement.c.
References ListBase::first, global_views, NULL, STREQ, and view.
Referenced by colormanage_check_view_settings(), colormanage_load_config(), colormanage_view_get_default(), and IMB_colormanagement_view_get_named_index().
ColorManagedView* colormanage_view_get_named_for_display | ( | const char * | display_name, |
const char * | name | ||
) |
Definition at line 2994 of file colormanagement.c.
References colormanage_display_get_named(), LISTBASE_FOREACH, NULL, STRCASEEQ, view, and ColorManagedDisplay::views.
Referenced by IMB_colormanagement_init_default_view_settings().
|
static |
Definition at line 284 of file colormanagement.c.
References ColormanageCacheViewSettings::curve_mapping, ColorManagedViewSettings::curve_mapping, ImBuf::dither, ColormanageCacheViewSettings::dither, ColormanageCacheViewSettings::exposure, ColorManagedViewSettings::exposure, ColormanageCacheViewSettings::flag, ColorManagedViewSettings::flag, ColormanageCacheViewSettings::gamma, ColorManagedViewSettings::gamma, IMB_colormanagement_look_get_named_index(), IMB_colormanagement_view_get_named_index(), ColormanageCacheViewSettings::look, ColorManagedViewSettings::look, view, ColormanageCacheViewSettings::view, and ColorManagedViewSettings::view_transform.
Referenced by IMB_display_buffer_acquire(), and imb_partial_display_buffer_update_ex().
Definition at line 717 of file colormanagement.c.
References BKE_curvemapping_free(), colormanage_free_config(), global_color_picking_state::cpu_processor_from, global_color_picking_state::cpu_processor_to, global_gpu_state::curve_mapping, global_gpu_state::curve_mapping_settings, OCIO_CurveMappingSettings::lut, MEM_freeN, OCIO_cpuProcessorRelease(), and OCIO_gpuCacheFree().
Referenced by IMB_exit().
|
static |
Definition at line 2450 of file colormanagement.c.
References colormanage_display_buffer_process_ex(), imb_addrectImBuf(), ImBuf::rect, and ImBuf::rect_float.
Referenced by IMB_colormanagement_imbuf_for_write(), and IMB_colormanagement_imbuf_make_display_space().
Definition at line 650 of file colormanagement.c.
References BCM_CONFIG_FILE, BKE_appdir_folder_id(), BLENDER_DATAFILES, BLI_getenv(), BLI_init_srgb_conversion(), BLI_join_dirfile(), colormanage_free_config(), colormanage_load_config(), FILE_MAX, global_tot_display, global_tot_view, NULL, OCIO_configCreateFallback(), OCIO_configCreateFromEnv(), OCIO_configCreateFromFile(), OCIO_configRelease(), OCIO_init(), and OCIO_setCurrentConfig().
Referenced by IMB_init().
|
static |
Definition at line 1945 of file colormanagement.c.
References channels(), height, IMB_colormanagement_colorspace_processor_new(), IMB_colormanagement_processor_apply(), IMB_colormanagement_processor_apply_byte(), IMB_colormanagement_processor_free(), NULL, processor_transform_apply_threaded(), STREQ, and width.
Referenced by IMB_colormanagement_transform(), IMB_colormanagement_transform_byte(), IMB_colormanagement_transform_byte_threaded(), and IMB_colormanagement_transform_threaded().
|
static |
Definition at line 3304 of file colormanagement.c.
References EnumPropertyItem::description, EnumPropertyItem::icon, EnumPropertyItem::identifier, EnumPropertyItem::name, RNA_enum_item_add(), EnumPropertyItem::value, and view.
Referenced by IMB_colormanagement_view_items_add().
|
static |
Definition at line 903 of file colormanagement.c.
References BLI_mutex_lock(), BLI_mutex_unlock(), create_colorspace_transform_processor(), ColorSpace::from_scene_linear, global_role_scene_linear, ColorSpace::name, NULL, OCIO_processorGetCPUProcessor(), OCIO_processorRelease(), and processor_lock.
Referenced by IMB_colormanagement_scene_linear_to_colorspace_v3().
void colorspace_set_default_role | ( | char * | colorspace, |
int | size, | ||
int | role | ||
) |
Definition at line 1031 of file colormanagement.c.
References BLI_strncpy(), IMB_colormanagement_role_colorspace_name_get(), and size().
Referenced by imb_bmp_decode(), imb_load_dds(), imb_load_dpx_cineon(), imb_load_filepath_thumbnail_openexr(), imb_load_jp2_stream(), imb_load_jpeg(), imb_load_openexr(), imb_load_photoshop(), imb_loadhdr(), imb_loadiris(), imb_loadpng(), imb_loadtarga(), imb_loadtiff(), imb_loadwebp(), IMB_open_anim(), and imb_thumbnail_jpeg().
|
static |
Definition at line 880 of file colormanagement.c.
References BLI_mutex_lock(), BLI_mutex_unlock(), create_colorspace_transform_processor(), global_role_scene_linear, ColorSpace::name, NULL, OCIO_processorGetCPUProcessor(), OCIO_processorRelease(), processor_lock, and ColorSpace::to_scene_linear.
Referenced by IMB_colormanagement_colorspace_to_scene_linear(), IMB_colormanagement_colorspace_to_scene_linear_v3(), IMB_colormanagement_colorspace_to_scene_linear_v4(), and IMB_colormanagement_imbuf_to_float_texture().
|
static |
Definition at line 867 of file colormanagement.c.
References OCIO_configGetProcessorWithNames(), OCIO_configRelease(), and OCIO_getCurrentConfig().
Referenced by colorspace_from_scene_linear_cpu_processor(), colorspace_to_scene_linear_cpu_processor(), IMB_colormanagement_color_picking_to_scene_linear_v3(), IMB_colormanagement_colorspace_processor_new(), and IMB_colormanagement_scene_linear_to_color_picking_v3().
|
static |
Definition at line 834 of file colormanagement.c.
References colormanage_use_look(), max_ff(), NULL, OCIO_configRelease(), OCIO_createDisplayProcessor(), OCIO_getCurrentConfig(), OCIO_processorGetCPUProcessor(), OCIO_processorRelease(), and powf.
Referenced by IMB_colormanagement_display_processor_new().
|
static |
Definition at line 1017 of file colormanagement.c.
References BKE_curvemap_evaluateF(), BKE_curvemapping_evaluate_premulRGBF(), channels(), and CurveMapping::cm.
Referenced by IMB_colormanagement_processor_apply(), and IMB_colormanagement_processor_apply_pixel().
|
static |
Definition at line 3959 of file colormanagement.c.
References BKE_curvemapping_init(), BKE_curvemapping_premultiply(), BKE_curvemapping_table_RGBA(), OCIO_CurveMappingSettings::black, CurveMapping::black, OCIO_CurveMappingSettings::bwmul, CurveMapping::bwmul, OCIO_CurveMappingSettings::cache_id, CurveMapping::changed_timestamp, CurveMapping::cm, CM_TABLE, copy_v3_v3(), CUMA_EXTEND_EXTRAPOLATE, CurveMap::ext_in, OCIO_CurveMappingSettings::ext_in_x, OCIO_CurveMappingSettings::ext_in_y, CurveMap::ext_out, OCIO_CurveMappingSettings::ext_out_x, OCIO_CurveMappingSettings::ext_out_y, OCIO_CurveMappingSettings::first_x, OCIO_CurveMappingSettings::first_y, CurveMapping::flag, OCIO_CurveMappingSettings::last_x, OCIO_CurveMappingSettings::last_y, OCIO_CurveMappingSettings::lut, OCIO_CurveMappingSettings::lut_size, OCIO_CurveMappingSettings::mintable, CurveMap::mintable, OCIO_CurveMappingSettings::range, CurveMap::range, CurveMap::table, OCIO_CurveMappingSettings::use_extend_extrapolate, CurveMapPoint::x, and CurveMapPoint::y.
Referenced by update_glsl_curve_mapping().
|
static |
Definition at line 1527 of file colormanagement.c.
References BLI_assert_msg, DisplayBufferThread::buffer, DisplayBufferThread::byte_buffer, DisplayBufferThread::byte_colorspace, DisplayBufferThread::channels, channels(), DisplayBufferThread::cm_processor, DisplayBufferThread::float_colorspace, global_role_scene_linear, height, IMB_colormanagement_transform(), DisplayBufferThread::is_data, ColormanageProcessor::is_data_result, DisplayBufferThread::predivide, rgb_uchar_to_float(), rgba_uchar_to_float(), width, and DisplayBufferThread::width.
Referenced by do_display_buffer_apply_thread().
|
static |
Definition at line 1699 of file colormanagement.c.
References buffer, display_buffer_init_handle(), do_display_buffer_apply_thread(), ImBuf::float_colorspace, global_role_default_byte, IMB_processor_apply_threaded(), init_data(), ColorSpace::name, NULL, ImBuf::rect_colorspace, and ImBuf::y.
Referenced by colormanage_display_buffer_process_ex().
|
static |
Definition at line 1477 of file colormanagement.c.
References DisplayBufferThread::buffer, DisplayBufferThread::byte_buffer, DisplayBufferThread::byte_colorspace, ImBuf::channels, DisplayBufferThread::channels, channels(), DisplayBufferThread::cm_processor, ImBuf::colormanage_flag, DisplayBufferThread::display_buffer, DisplayBufferThread::display_buffer_byte, DISPLAY_BUFFER_CHANNELS, ImBuf::dither, DisplayBufferThread::dither, DisplayBufferThread::float_colorspace, IMB_alpha_affects_rgb(), IMB_COLORMANAGE_IS_DATA, init_data(), DisplayBufferThread::is_data, offset, DisplayBufferThread::predivide, DisplayBufferThread::start_line, DisplayBufferThread::tot_line, DisplayBufferThread::width, and ImBuf::x.
Referenced by display_buffer_apply_threaded().
|
static |
Definition at line 926 of file colormanagement.c.
References BLI_mutex_lock(), BLI_mutex_unlock(), colormanage_view_get_default_name(), ColorManagedDisplay::from_scene_linear, global_role_scene_linear, ColorManagedDisplay::name, NULL, OCIO_configRelease(), OCIO_createDisplayProcessor(), OCIO_getCurrentConfig(), OCIO_processorGetCPUProcessor(), OCIO_processorRelease(), and processor_lock.
Referenced by IMB_colormanagement_scene_linear_to_display_v3().
|
static |
Definition at line 957 of file colormanagement.c.
References BLI_mutex_lock(), BLI_mutex_unlock(), colormanage_view_get_default_name(), global_role_scene_linear, ColorManagedDisplay::name, NULL, OCIO_configRelease(), OCIO_createDisplayProcessor(), OCIO_getCurrentConfig(), OCIO_processorGetCPUProcessor(), OCIO_processorRelease(), processor_lock, and ColorManagedDisplay::to_scene_linear.
Referenced by IMB_colormanagement_display_to_scene_linear_v3().
|
static |
Definition at line 821 of file colormanagement.c.
References colormanage_colorspace_get_named(), get_display_colorspace_name(), and NULL.
Referenced by IMB_colormanagement_display_processor_new(), and IMB_colormanagement_imbuf_for_write().
Definition at line 1606 of file colormanagement.c.
References DisplayBufferThread::byte_buffer, DisplayBufferThread::channels, channels(), DisplayBufferThread::cm_processor, DisplayBufferThread::display_buffer, display_buffer_apply_get_linear_buffer(), DisplayBufferThread::display_buffer_byte, DisplayBufferThread::dither, height, IB_PROFILE_SRGB, IMB_buffer_byte_from_byte(), IMB_buffer_byte_from_float(), IMB_buffer_float_from_byte(), IMB_colormanagement_processor_apply(), DisplayBufferThread::is_data, MEM_freeN, MEM_mallocN, NULL, DisplayBufferThread::predivide, straight_to_premul_v4(), DisplayBufferThread::tot_line, width, and DisplayBufferThread::width.
Referenced by display_buffer_apply_threaded().
Definition at line 1871 of file colormanagement.c.
References ProcessorTransformThread::byte_buffer, ProcessorTransformThread::channels, channels(), ProcessorTransformThread::cm_processor, ProcessorTransformThread::float_buffer, ProcessorTransformThread::float_from_byte, height, IB_PROFILE_SRGB, IMB_buffer_float_from_byte(), IMB_colormanagement_processor_apply(), IMB_colormanagement_processor_apply_byte(), IMB_premultiply_rect_float(), NULL, ProcessorTransformThread::predivide, ProcessorTransformThread::tot_line, width, and ProcessorTransformThread::width.
Referenced by processor_transform_apply_threaded().
|
static |
Definition at line 805 of file colormanagement.c.
References ColorManagedDisplaySettings::display_device, OCIO_configGetDisplayColorSpaceName(), OCIO_configRelease(), OCIO_getCurrentConfig(), view, and ColorManagedViewSettings::view_transform.
Referenced by display_transform_get_colorspace(), and is_ibuf_rect_in_display_space().
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().
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, |
const int | width, | ||
const float | min, | ||
const 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 | ( | ColorManagedColorspaceSettings * | colorspace_settings, |
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 ColorSpace * | colorspace | ) |
Definition at line 3178 of file colormanagement.c.
References ColorSpace::name.
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 | ( | 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.
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, | ||
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.
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 | ( | 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.
ColormanageProcessor* IMB_colormanagement_display_processor_new | ( | const ColorManagedViewSettings * | view_settings, |
const ColorManagedDisplaySettings * | display_settings | ||
) |
Definition at line 3768 of file colormanagement.c.
References BKE_curvemapping_copy(), BKE_curvemapping_premultiply(), COLORMANAGE_VIEW_USE_CURVES, ColormanageProcessor::cpu_processor, create_display_buffer_processor(), ColormanageProcessor::curve_mapping, ColorManagedViewSettings::curve_mapping, ColorManagedDisplaySettings::display_device, display_transform_get_colorspace(), ColorManagedViewSettings::exposure, ColorManagedViewSettings::flag, ColorManagedViewSettings::gamma, global_role_scene_linear, IMB_colormanagement_init_default_view_settings(), ColorSpace::is_data, ColormanageProcessor::is_data_result, ColorManagedViewSettings::look, MEM_callocN, and ColorManagedViewSettings::view_transform.
Referenced by colormanage_display_buffer_process_ex(), IMB_colormanagement_pixel_to_display_space_v3(), IMB_colormanagement_pixel_to_display_space_v4(), IMB_display_buffer_transform_apply(), and imb_partial_display_buffer_update_ex().
void IMB_colormanagement_display_settings_from_ctx | ( | const bContext * | C, |
ColorManagedViewSettings ** | r_view_settings, | ||
ColorManagedDisplaySettings ** | r_display_settings | ||
) |
Definition at line 787 of file colormanagement.c.
References C, CTX_data_scene(), CTX_wm_space_image(), Scene::display_settings, Image::flag, IMA_VIEW_AS_RENDER, SpaceImage::image, NULL, scene, and Scene::view_settings.
Referenced by IMB_colormanagement_setup_glsl_draw_from_space_ctx(), and IMB_display_buffer_acquire_ctx().
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 | ( | 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().
const char* IMB_colormanagement_get_rect_colorspace | ( | 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().
ImBuf* IMB_colormanagement_imbuf_for_write | ( | ImBuf * | ibuf, |
bool | save_as_render, | ||
bool | allocate_result, | ||
const ImageFormatData * | image_format | ||
) |
Definition at line 2502 of file colormanagement.c.
References BKE_image_format_is_byte(), BKE_imtype_requires_linear_float(), BLI_assert, ImBuf::channels, color, colormanage_colorspace_get_named(), colormanagement_imbuf_make_display_space(), ImageFormatData::display_settings, display_transform_get_colorspace(), ImBuf::float_colorspace, global_role_default_byte, global_role_scene_linear, IB_DISPLAY_BUFFER_INVALID, IB_RECT_INVALID, IMB_alpha_under_color_byte(), IMB_alpha_under_color_float(), IMB_colormanagement_transform(), IMB_colormanagement_transform_byte_threaded(), IMB_float_from_rect(), imb_freerectImBuf(), IMB_rect_from_float(), imbuf_ensure_editable(), ImageFormatData::imtype, ImageFormatData::linear_colorspace_settings, ColorManagedColorspaceSettings::name, ColorSpace::name, ImageFormatData::planes, R_IMF_PLANES_RGBA, ImBuf::rect, ImBuf::rect_colorspace, ImBuf::rect_float, STREQ, ImBuf::userflags, ImageFormatData::view_settings, ImBuf::x, and ImBuf::y.
void IMB_colormanagement_imbuf_make_display_space | ( | ImBuf * | ibuf, |
const ColorManagedViewSettings * | view_settings, | ||
const ColorManagedDisplaySettings * | display_settings | ||
) |
Definition at line 2464 of file colormanagement.c.
References colormanagement_imbuf_make_display_space().
void IMB_colormanagement_imbuf_to_byte_texture | ( | unsigned char * | out_buffer, |
const int | offset_x, | ||
const int | offset_y, | ||
const int | width, | ||
const int | height, | ||
const struct ImBuf * | ibuf, | ||
const 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, |
const int | offset_x, | ||
const int | offset_y, | ||
const int | width, | ||
const int | height, | ||
const struct ImBuf * | ibuf, | ||
const 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 | ( | ColorManagedViewSettings * | view_settings, |
const ColorManagedDisplaySettings * | display_settings | ||
) |
Definition at line 987 of file colormanagement.c.
References BLI_strncpy(), colormanage_display_get_named(), colormanage_view_get_default(), colormanage_view_get_named_for_display(), ColorManagedViewSettings::curve_mapping, ColorManagedDisplaySettings::display_device, ColorManagedViewSettings::exposure, ColorManagedViewSettings::flag, ColorManagedViewSettings::gamma, ColorManagedViewSettings::look, ColorManagedView::name, NULL, and ColorManagedViewSettings::view_transform.
Referenced by IMB_colormanagement_display_processor_new(), IMB_colormanagement_setup_glsl_draw_from_space(), and IMB_display_buffer_acquire().
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 ColorManagedViewSettings * | view_settings, | ||
const ColorManagedDisplaySettings * | display_settings | ||
) |
Definition at line 2435 of file colormanagement.c.
References copy_v3_v3(), IMB_colormanagement_display_processor_new(), IMB_colormanagement_processor_apply_v3(), IMB_colormanagement_processor_free(), and result.
void IMB_colormanagement_pixel_to_display_space_v4 | ( | float | result[4], |
const float | pixel[4], | ||
const ColorManagedViewSettings * | view_settings, | ||
const ColorManagedDisplaySettings * | display_settings | ||
) |
Definition at line 2420 of file colormanagement.c.
References copy_v4_v4(), IMB_colormanagement_display_processor_new(), IMB_colormanagement_processor_apply_v4(), IMB_colormanagement_processor_free(), and result.
void IMB_colormanagement_processor_apply | ( | 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 | ( | 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 | ( | 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 | ( | 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 | ( | 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 | ( | 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().
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().
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().
bool IMB_colormanagement_setup_glsl_draw | ( | const ColorManagedViewSettings * | view_settings, |
const ColorManagedDisplaySettings * | display_settings, | ||
float | dither, | ||
bool | predivide | ||
) |
Definition at line 4105 of file colormanagement.c.
References IMB_colormanagement_setup_glsl_draw_from_space(), and NULL.
Definition at line 4128 of file colormanagement.c.
References C, IMB_colormanagement_setup_glsl_draw_from_space_ctx(), and NULL.
bool IMB_colormanagement_setup_glsl_draw_from_space | ( | const ColorManagedViewSettings * | view_settings, |
const ColorManagedDisplaySettings * | display_settings, | ||
struct ColorSpace * | from_colorspace, | ||
float | dither, | ||
bool | predivide, | ||
bool | do_overlay_merge | ||
) |
Definition at line 4048 of file colormanagement.c.
References colormanage_use_look(), ColorManagedDisplaySettings::display_device, ColorManagedViewSettings::exposure, ColorManagedViewSettings::gamma, global_role_scene_linear, global_gpu_state::gpu_shader_bound, IMB_colormanagement_init_default_view_settings(), input, ColorManagedViewSettings::look, max_ff(), ColorSpace::name, OCIO_configRelease(), OCIO_getCurrentConfig(), OCIO_gpuDisplayShaderBind(), powf, update_glsl_curve_mapping(), view, and ColorManagedViewSettings::view_transform.
Referenced by IMB_colormanagement_setup_glsl_draw(), and IMB_colormanagement_setup_glsl_draw_from_space_ctx().
bool IMB_colormanagement_setup_glsl_draw_from_space_ctx | ( | const bContext * | C, |
struct ColorSpace * | from_colorspace, | ||
float | dither, | ||
bool | predivide | ||
) |
Definition at line 4114 of file colormanagement.c.
References C, IMB_colormanagement_display_settings_from_ctx(), and IMB_colormanagement_setup_glsl_draw_from_space().
Referenced by IMB_colormanagement_setup_glsl_draw_ctx().
bool IMB_colormanagement_space_is_data | ( | ColorSpace * | colorspace | ) |
Definition at line 1375 of file colormanagement.c.
Referenced by IMB_colormanagement_imbuf_to_byte_texture().
bool IMB_colormanagement_space_is_scene_linear | ( | ColorSpace * | colorspace | ) |
Definition at line 1399 of file colormanagement.c.
Referenced by IMB_colormanagement_imbuf_to_byte_texture(), and IMB_colormanagement_space_name_is_scene_linear().
bool IMB_colormanagement_space_is_srgb | ( | 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().
bool IMB_colormanagement_support_glsl_draw | ( | const ColorManagedViewSettings * | UNUSEDview_settings | ) |
Definition at line 4043 of file colormanagement.c.
References OCIO_supportGPUShader().
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 ColorManagedDisplaySettings * | display_settings, |
ColorManagedViewSettings * | view_settings | ||
) |
Definition at line 1249 of file colormanagement.c.
References BLI_strncpy(), colormanage_display_get_named(), colormanage_view_get_default(), LinkData::data, ColorManagedDisplaySettings::display_device, ListBase::first, ColorManagedView::name, LinkData::next, NULL, STREQ, view, ColorManagedViewSettings::view_transform, and ColorManagedDisplay::views.
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 | ( | 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().
unsigned char* IMB_display_buffer_acquire | ( | ImBuf * | ibuf, |
const ColorManagedViewSettings * | view_settings, | ||
const ColorManagedDisplaySettings * | display_settings, | ||
void ** | cache_handle | ||
) |
Definition at line 2653 of file colormanagement.c.
References BLI_rcti_init(), BLI_thread_lock(), BLI_thread_unlock(), ImBuf::channels, colormanage_cache_get(), colormanage_cache_put(), colormanage_display_buffer_process(), colormanage_display_settings_to_cache(), colormanage_view_settings_to_cache(), DISPLAY_BUFFER_CHANNELS, ImBuf::display_buffer_flags, global_tot_display, IB_DISPLAY_BUFFER_INVALID, IMB_colormanagement_init_default_view_settings(), IMB_partial_display_buffer_update_threaded(), ImBuf::invalid_rect, is_ibuf_rect_in_display_space(), LOCK_COLORMANAGE, MEM_callocN, NULL, ImBuf::rect, ImBuf::rect_colorspace, ImBuf::rect_float, ImBuf::userflags, ImBuf::x, rcti::xmax, rcti::xmin, ImBuf::y, rcti::ymax, and rcti::ymin.
Referenced by IMB_display_buffer_acquire_ctx().
unsigned char* IMB_display_buffer_acquire_ctx | ( | const bContext * | C, |
ImBuf * | ibuf, | ||
void ** | cache_handle | ||
) |
Definition at line 2750 of file colormanagement.c.
References C, IMB_colormanagement_display_settings_from_ctx(), and IMB_display_buffer_acquire().
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 ColorManagedViewSettings * | view_settings, | ||
const ColorManagedDisplaySettings * | display_settings, | ||
bool | predivide | ||
) |
Definition at line 2760 of file colormanagement.c.
References buffer, channels(), height, IB_PROFILE_SRGB, IMB_buffer_byte_from_float(), IMB_colormanagement_display_processor_new(), IMB_colormanagement_processor_apply(), IMB_colormanagement_processor_free(), MEM_freeN, MEM_mallocN, and width.
void IMB_partial_display_buffer_update | ( | ImBuf * | ibuf, |
const float * | linear_buffer, | ||
const unsigned char * | byte_buffer, | ||
int | stride, | ||
int | offset_x, | ||
int | offset_y, | ||
const ColorManagedViewSettings * | view_settings, | ||
const ColorManagedDisplaySettings * | display_settings, | ||
int | xmin, | ||
int | ymin, | ||
int | xmax, | ||
int | ymax | ||
) |
Definition at line 3690 of file colormanagement.c.
References imb_partial_display_buffer_update_ex(), and stride.
void IMB_partial_display_buffer_update_delayed | ( | 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().
|
static |
Definition at line 3580 of file colormanagement.c.
References BLI_thread_lock(), BLI_thread_unlock(), colormanage_cache_get(), colormanage_display_settings_to_cache(), colormanage_view_settings_to_cache(), data, ColormanageCacheDisplaySettings::display, ImBuf::display_buffer_flags, global_tot_display, IB_DISPLAY_BUFFER_INVALID, IMB_colormanagement_display_processor_new(), IMB_colormanagement_processor_free(), IMB_display_buffer_release(), IMB_processor_apply_threaded_scanlines(), is_ibuf_rect_in_display_space(), LOCK_COLORMANAGE, NULL, partial_buffer_update_rect(), partial_buffer_update_rect_thread_do(), stride, ImBuf::userflags, ColormanageCacheViewSettings::view, and ImBuf::x.
Referenced by IMB_partial_display_buffer_update(), and IMB_partial_display_buffer_update_threaded().
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().
|
static |
Definition at line 2472 of file colormanagement.c.
References IB_rect, IB_rectfloat, IMB_dupImBuf(), IMB_metadata_copy(), ImBuf::mall, MEM_dupallocN, ImBuf::rect, and ImBuf::rect_float.
Referenced by IMB_colormanagement_imbuf_for_write().
|
static |
Definition at line 1740 of file colormanagement.c.
References colormanage_look_get_named(), COLORMANAGE_VIEW_USE_CURVES, ColorManagedViewSettings::exposure, ColorManagedViewSettings::flag, ColorManagedViewSettings::gamma, get_display_colorspace_name(), ColorManagedViewSettings::look, ColorSpace::name, NULL, ColorManagedLook::process_space, ImBuf::rect_colorspace, and STREQ.
Referenced by colormanage_display_buffer_process_ex(), IMB_display_buffer_acquire(), and imb_partial_display_buffer_update_ex().
|
static |
Definition at line 3398 of file colormanagement.c.
References BLI_assert_msg, ImBuf::channels, channels(), ImBuf::colormanage_flag, copy_v3_v3(), copy_v4_v4(), ImBuf::dither, height, IB_PROFILE_SRGB, IMB_buffer_byte_from_float(), IMB_buffer_float_from_byte(), IMB_COLORMANAGE_IS_DATA, IMB_colormanagement_colorspace_to_scene_linear_v3(), IMB_colormanagement_processor_apply_pixel(), MEM_callocN, MEM_freeN, NULL, premul_to_straight_v4_v4(), ImBuf::rect_colorspace, rgb_float_to_uchar(), rgba_float_to_uchar(), rgba_uchar_to_float(), straight_to_premul_v4(), unit_float_to_uchar_clamp(), width, x, and y.
Referenced by imb_partial_display_buffer_update_ex(), and partial_buffer_update_rect_thread_do().
Definition at line 3560 of file colormanagement.c.
References data, and partial_buffer_update_rect().
Referenced by imb_partial_display_buffer_update_ex().
|
static |
Definition at line 1910 of file colormanagement.c.
References channels(), do_processor_transform_thread(), height, IMB_processor_apply_threaded(), init_data(), processor_transform_init_handle(), and width.
Referenced by colormanagement_transform_ex(), and IMB_colormanagement_transform_from_byte_threaded().
|
static |
Definition at line 1834 of file colormanagement.c.
References ProcessorTransformThread::byte_buffer, ProcessorTransformThread::channels, channels(), ProcessorTransformThread::cm_processor, ProcessorTransformThread::float_buffer, ProcessorTransformThread::float_from_byte, init_data(), NULL, offset, ProcessorTransformThread::predivide, ProcessorTransformThread::start_line, ProcessorTransformThread::tot_line, width, and ProcessorTransformThread::width.
Referenced by processor_transform_apply_threaded().
Definition at line 1193 of file colormanagement.c.
References colormanage_check_colorspace_settings(), Strip::colorspace_settings, and Sequence::strip.
Referenced by IMB_colormanagement_check_file_config().
|
static |
Definition at line 3992 of file colormanagement.c.
References BKE_curvemapping_copy(), BKE_curvemapping_free(), CurveMapping::changed_timestamp, COLORMANAGE_VIEW_USE_CURVES, global_gpu_state::curve_mapping, ColorManagedViewSettings::curve_mapping, global_gpu_state::curve_mapping_settings, global_gpu_state::curve_mapping_timestamp, curve_mapping_to_ocio_settings(), ColorManagedViewSettings::flag, OCIO_CurveMappingSettings::lut, MEM_freeN, NULL, global_gpu_state::orig_curve_mapping, and global_gpu_state::use_curve_mapping.
Referenced by IMB_colormanagement_setup_glsl_draw_from_space().
Definition at line 4272 of file colormanagement.c.
References Freestyle::c, cie_colour_match, and float().
Referenced by IMB_colormanagement_wavelength_to_rgb_table().
|
static |
Definition at line 4170 of file colormanagement.c.
Referenced by blackbody_temperature_to_rec709().
|
static |
Definition at line 4161 of file colormanagement.c.
Referenced by blackbody_temperature_to_rec709().
|
static |
Definition at line 4153 of file colormanagement.c.
Referenced by blackbody_temperature_to_rec709().
|
static |
CIE color matching functions xBar
, yBar
, and zBar
for wavelengths from 380 through 780 nanometers, every 5 nanometers.
For a wavelength lambda in this range:
Definition at line 4243 of file colormanagement.c.
Referenced by wavelength_to_xyz().
|
static |
Definition at line 64 of file colormanagement.c.
Referenced by colormanage_colorspace_add(), colormanage_colorspace_get_indexed(), colormanage_colorspace_get_named(), colormanage_free_config(), and IMB_colormanagement_colorspace_items_add().
Definition at line 65 of file colormanagement.c.
Referenced by colormanage_display_add(), colormanage_display_get_indexed(), colormanage_display_get_named(), colormanage_free_config(), and IMB_colormanagement_display_items_add().
|
static |
Definition at line 67 of file colormanagement.c.
Referenced by colormanage_check_view_settings(), colormanage_free_config(), colormanage_look_add(), colormanage_look_get_indexed(), colormanage_look_get_named(), and IMB_colormanagement_look_items_add().
|
static |
Definition at line 58 of file colormanagement.c.
Referenced by colormanage_load_config(), IMB_colormanagement_color_picking_to_scene_linear_v3(), IMB_colormanagement_role_colorspace_name_get(), and IMB_colormanagement_scene_linear_to_color_picking_v3().
|
static |
Definition at line 56 of file colormanagement.c.
Referenced by colormanage_load_config(), and IMB_colormanagement_role_colorspace_name_get().
|
static |
Definition at line 60 of file colormanagement.c.
Referenced by colormanage_imbuf_set_default_spaces(), colormanage_load_config(), display_buffer_apply_threaded(), IMB_colormanagement_imbuf_for_write(), and IMB_colormanagement_role_colorspace_name_get().
|
static |
Definition at line 61 of file colormanagement.c.
Referenced by colormanage_load_config(), and IMB_colormanagement_role_colorspace_name_get().
|
static |
Definition at line 62 of file colormanagement.c.
Referenced by colormanage_load_config(), IMB_colormanagement_check_file_config(), and IMB_colormanagement_role_colorspace_name_get().
|
static |
Definition at line 57 of file colormanagement.c.
Referenced by colormanage_imbuf_make_linear(), colormanage_load_config(), colorspace_from_scene_linear_cpu_processor(), colorspace_to_scene_linear_cpu_processor(), display_buffer_apply_get_linear_buffer(), display_from_scene_linear_processor(), display_to_scene_linear_processor(), IMB_colormanagement_color_picking_to_scene_linear_v3(), IMB_colormanagement_display_processor_new(), IMB_colormanagement_imbuf_for_write(), IMB_colormanagement_role_colorspace_name_get(), IMB_colormanagement_scene_linear_to_color_picking_v3(), and IMB_colormanagement_setup_glsl_draw_from_space().
|
static |
Definition at line 59 of file colormanagement.c.
Referenced by colormanage_load_config(), and IMB_colormanagement_role_colorspace_name_get().
|
static |
Definition at line 69 of file colormanagement.c.
Referenced by colormanage_colorspace_add(), and colormanage_free_config().
|
static |
Definition at line 70 of file colormanagement.c.
Referenced by colormanage_free_config(), colormanage_load_config(), colormanagement_init(), IMB_display_buffer_acquire(), and imb_partial_display_buffer_update_ex().
|
static |
Definition at line 72 of file colormanagement.c.
Referenced by colormanage_free_config(), and colormanage_look_add().
|
static |
Definition at line 71 of file colormanagement.c.
Referenced by colormanage_free_config(), colormanage_view_add(), and colormanagement_init().
Definition at line 66 of file colormanagement.c.
Referenced by colormanage_free_config(), colormanage_view_add(), colormanage_view_get_indexed(), and colormanage_view_get_named().
float imbuf_aces_to_scene_linear[3][3] = {{0.0f}} |
Definition at line 81 of file colormanagement.c.
Referenced by colormanage_load_config(), and IMB_colormanagement_aces_to_scene_linear().
float imbuf_luma_coefficients[3] = {0.0f} |
Definition at line 75 of file colormanagement.c.
Referenced by colormanage_load_config(), IMB_colormanagement_get_luminance(), and IMB_colormanagement_get_luminance_byte().
float imbuf_rec709_to_scene_linear[3][3] = {{0.0f}} |
Definition at line 79 of file colormanagement.c.
Referenced by colormanage_load_config(), IMB_colormanagement_rec709_to_scene_linear(), and IMB_colormanagement_srgb_to_scene_linear_v3().
float imbuf_scene_linear_to_aces[3][3] = {{0.0f}} |
Definition at line 80 of file colormanagement.c.
Referenced by colormanage_load_config(), and IMB_colormanagement_scene_linear_to_aces().
float imbuf_scene_linear_to_rec709[3][3] = {{0.0f}} |
Definition at line 78 of file colormanagement.c.
Referenced by colormanage_load_config(), IMB_colormanagement_scene_linear_to_rec709(), and IMB_colormanagement_scene_linear_to_srgb_v3().
float imbuf_scene_linear_to_xyz[3][3] = {{0.0f}} |
Definition at line 76 of file colormanagement.c.
Referenced by colormanage_load_config(), and IMB_colormanagement_scene_linear_to_xyz().
float imbuf_xyz_to_scene_linear[3][3] = {{0.0f}} |
Definition at line 77 of file colormanagement.c.
Referenced by colormanage_load_config(), IMB_colormanagement_get_xyz_to_scene_linear(), and IMB_colormanagement_xyz_to_scene_linear().
|
static |
Definition at line 88 of file colormanagement.c.
Referenced by colorspace_from_scene_linear_cpu_processor(), colorspace_to_scene_linear_cpu_processor(), display_from_scene_linear_processor(), display_to_scene_linear_processor(), IMB_colormanagement_color_picking_to_scene_linear_v3(), and IMB_colormanagement_scene_linear_to_color_picking_v3().