Blender  V3.3
Macros
IMB_colormanagement.h File Reference
#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"
 

Functions

Generic Functions
void IMB_colormanagement_check_file_config (struct Main *bmain)
 
void IMB_colormanagement_validate_settings (const struct ColorManagedDisplaySettings *display_settings, struct ColorManagedViewSettings *view_settings)
 
const char * IMB_colormanagement_role_colorspace_name_get (int role)
 
void IMB_colormanagement_check_is_data (struct ImBuf *ibuf, const char *name)
 
void IMB_colormanagegent_copy_settings (struct ImBuf *ibuf_src, struct ImBuf *ibuf_dst)
 
void IMB_colormanagement_assign_float_colorspace (struct ImBuf *ibuf, const char *name)
 
void IMB_colormanagement_assign_rect_colorspace (struct ImBuf *ibuf, const char *name)
 
const char * IMB_colormanagement_get_float_colorspace (struct ImBuf *ibuf)
 
const char * IMB_colormanagement_get_rect_colorspace (struct ImBuf *ibuf)
 
bool IMB_colormanagement_space_is_data (struct ColorSpace *colorspace)
 
bool IMB_colormanagement_space_is_scene_linear (struct ColorSpace *colorspace)
 
bool IMB_colormanagement_space_is_srgb (struct ColorSpace *colorspace)
 
bool IMB_colormanagement_space_name_is_data (const char *name)
 
bool IMB_colormanagement_space_name_is_scene_linear (const char *name)
 
bool IMB_colormanagement_space_name_is_srgb (const char *name)
 
BLI_INLINE float IMB_colormanagement_get_luminance (const float rgb[3])
 
BLI_INLINE unsigned char IMB_colormanagement_get_luminance_byte (const unsigned char[3])
 
BLI_INLINE void IMB_colormanagement_xyz_to_scene_linear (float scene_linear[3], const float xyz[3])
 
BLI_INLINE void IMB_colormanagement_scene_linear_to_xyz (float xyz[3], const float scene_linear[3])
 
BLI_INLINE void IMB_colormanagement_rec709_to_scene_linear (float scene_linear[3], const float rec709[3])
 
BLI_INLINE void IMB_colormanagement_scene_linear_to_rec709 (float rec709[3], const float scene_linear[3])
 
BLI_INLINE void IMB_colormanagement_aces_to_scene_linear (float scene_linear[3], const float aces[3])
 
BLI_INLINE void IMB_colormanagement_scene_linear_to_aces (float aces[3], const float scene_linear[3])
 
const floatIMB_colormanagement_get_xyz_to_scene_linear (void)
 
Color Space Transformation Functions
void IMB_colormanagement_transform (float *buffer, int width, int height, int channels, const char *from_colorspace, const char *to_colorspace, bool predivide)
 
void IMB_colormanagement_transform_threaded (float *buffer, int width, int height, int channels, const char *from_colorspace, const char *to_colorspace, bool predivide)
 
void IMB_colormanagement_transform_byte (unsigned char *buffer, int width, int height, int channels, const char *from_colorspace, const char *to_colorspace)
 
void IMB_colormanagement_transform_byte_threaded (unsigned char *buffer, int width, int height, int channels, const char *from_colorspace, const char *to_colorspace)
 
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)
 
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)
 
void IMB_colormanagement_transform_v4 (float pixel[4], const char *from_colorspace, const char *to_colorspace)
 
void IMB_colormanagement_colorspace_to_scene_linear_v3 (float pixel[3], struct ColorSpace *colorspace)
 
void IMB_colormanagement_colorspace_to_scene_linear_v4 (float pixel[4], bool predivide, struct ColorSpace *colorspace)
 
void IMB_colormanagement_scene_linear_to_colorspace_v3 (float pixel[3], struct ColorSpace *colorspace)
 
void IMB_colormanagement_colorspace_to_scene_linear (float *buffer, int width, int height, int channels, struct ColorSpace *colorspace, bool predivide)
 
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)
 
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)
 
void IMB_colormanagement_scene_linear_to_color_picking_v3 (float color_picking[3], const float scene_linear[3])
 
void IMB_colormanagement_color_picking_to_scene_linear_v3 (float scene_linear[3], const float color_picking[3])
 
BLI_INLINE void IMB_colormanagement_scene_linear_to_srgb_v3 (float srgb[3], const float scene_linear[3])
 
BLI_INLINE void IMB_colormanagement_srgb_to_scene_linear_v3 (float scene_linear[3], const float srgb[3])
 
void IMB_colormanagement_scene_linear_to_display_v3 (float pixel[3], struct ColorManagedDisplay *display)
 
void IMB_colormanagement_display_to_scene_linear_v3 (float pixel[3], struct ColorManagedDisplay *display)
 
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)
 
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_imbuf_make_display_space (struct ImBuf *ibuf, const struct ColorManagedViewSettings *view_settings, const struct ColorManagedDisplaySettings *display_settings)
 
struct ImBufIMB_colormanagement_imbuf_for_write (struct ImBuf *ibuf, bool save_as_render, bool allocate_result, const struct ImageFormatData *image_format)
 
Public Display Buffers Interfaces
void IMB_colormanagement_display_settings_from_ctx (const struct bContext *C, struct ColorManagedViewSettings **r_view_settings, struct ColorManagedDisplaySettings **r_display_settings)
 
unsigned char * IMB_display_buffer_acquire (struct ImBuf *ibuf, const struct ColorManagedViewSettings *view_settings, const struct ColorManagedDisplaySettings *display_settings, void **cache_handle)
 
unsigned char * IMB_display_buffer_acquire_ctx (const struct bContext *C, struct ImBuf *ibuf, void **cache_handle)
 
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)
 
void IMB_display_buffer_release (void *cache_handle)
 
Display Functions
int IMB_colormanagement_display_get_named_index (const char *name)
 
const char * IMB_colormanagement_display_get_indexed_name (int index)
 
const char * IMB_colormanagement_display_get_default_name (void)
 
struct ColorManagedDisplayIMB_colormanagement_display_get_named (const char *name)
 
const char * IMB_colormanagement_display_get_none_name (void)
 
const char * IMB_colormanagement_display_get_default_view_transform_name (struct ColorManagedDisplay *display)
 
View Functions
int IMB_colormanagement_view_get_named_index (const char *name)
 
const char * IMB_colormanagement_view_get_indexed_name (int index)
 
Look Functions
int IMB_colormanagement_look_get_named_index (const char *name)
 
const char * IMB_colormanagement_look_get_indexed_name (int index)
 
Color Space Functions
int IMB_colormanagement_colorspace_get_named_index (const char *name)
 
const char * IMB_colormanagement_colorspace_get_indexed_name (int index)
 
const char * IMB_colormanagement_colorspace_get_name (const struct ColorSpace *colorspace)
 
const char * IMB_colormanagement_view_get_default_name (const char *display_name)
 
void IMB_colormanagement_colorspace_from_ibuf_ftype (struct ColorManagedColorspaceSettings *colorspace_settings, struct ImBuf *ibuf)
 
RNA Helper Functions
void IMB_colormanagement_display_items_add (struct EnumPropertyItem **items, int *totitem)
 
void IMB_colormanagement_view_items_add (struct EnumPropertyItem **items, int *totitem, const char *display_name)
 
void IMB_colormanagement_look_items_add (struct EnumPropertyItem **items, int *totitem, const char *view_name)
 
void IMB_colormanagement_colorspace_items_add (struct EnumPropertyItem **items, int *totitem)
 
Tile-based Buffer Management
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)
 
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 (struct ImBuf *ibuf, int xmin, int ymin, int xmax, int ymax)
 
Pixel Processor Functions
struct ColormanageProcessorIMB_colormanagement_display_processor_new (const struct ColorManagedViewSettings *view_settings, const struct ColorManagedDisplaySettings *display_settings)
 
struct ColormanageProcessorIMB_colormanagement_colorspace_processor_new (const char *from_colorspace, const char *to_colorspace)
 
void IMB_colormanagement_processor_apply_v4 (struct ColormanageProcessor *cm_processor, float pixel[4])
 
void IMB_colormanagement_processor_apply_v4_predivide (struct ColormanageProcessor *cm_processor, float pixel[4])
 
void IMB_colormanagement_processor_apply_v3 (struct ColormanageProcessor *cm_processor, float pixel[3])
 
void IMB_colormanagement_processor_apply_pixel (struct ColormanageProcessor *cm_processor, float *pixel, int channels)
 
void IMB_colormanagement_processor_apply (struct ColormanageProcessor *cm_processor, float *buffer, int width, int height, int channels, bool predivide)
 
void IMB_colormanagement_processor_apply_byte (struct ColormanageProcessor *cm_processor, unsigned char *buffer, int width, int height, int channels)
 
void IMB_colormanagement_processor_free (struct ColormanageProcessor *cm_processor)
 
OpenGL Drawing Routines Using GLSL for Color Space Transform
bool IMB_colormanagement_support_glsl_draw (const struct ColorManagedViewSettings *view_settings)
 
bool IMB_colormanagement_setup_glsl_draw (const struct ColorManagedViewSettings *view_settings, const struct ColorManagedDisplaySettings *display_settings, float dither, bool predivide)
 
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)
 
bool IMB_colormanagement_setup_glsl_draw_ctx (const struct bContext *C, float dither, bool predivide)
 
bool IMB_colormanagement_setup_glsl_draw_from_space_ctx (const struct bContext *C, struct ColorSpace *colorspace, float dither, bool predivide)
 
void IMB_colormanagement_finish_glsl_draw (void)
 
Rendering Tables
void IMB_colormanagement_blackbody_temperature_to_rgb_table (float *r_table, int width, float min, float max)
 
void IMB_colormanagement_wavelength_to_rgb_table (float *r_table, int width)
 

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)
 

Macro Definition Documentation

◆ BCM_CONFIG_FILE

#define BCM_CONFIG_FILE   "config.ocio"

Definition at line 17 of file IMB_colormanagement.h.

Enumeration Type Documentation

◆ anonymous enum

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.

Function Documentation

◆ IMB_colormanagegent_copy_settings()

void IMB_colormanagegent_copy_settings ( struct ImBuf ibuf_src,
struct ImBuf ibuf_dst 
)

◆ IMB_colormanagement_aces_to_scene_linear()

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().

◆ IMB_colormanagement_assign_float_colorspace()

void IMB_colormanagement_assign_float_colorspace ( struct ImBuf ibuf,
const char *  name 
)

◆ IMB_colormanagement_assign_rect_colorspace()

void IMB_colormanagement_assign_rect_colorspace ( struct ImBuf ibuf,
const char *  name 
)

◆ IMB_colormanagement_blackbody_temperature_to_rgb_table()

void IMB_colormanagement_blackbody_temperature_to_rgb_table ( float r_table,
int  width,
float  min,
float  max 
)

◆ IMB_colormanagement_check_file_config()

void IMB_colormanagement_check_file_config ( struct Main bmain)

◆ IMB_colormanagement_check_is_data()

void IMB_colormanagement_check_is_data ( struct ImBuf ibuf,
const char *  name 
)

◆ IMB_colormanagement_color_picking_to_scene_linear_v3()

void IMB_colormanagement_color_picking_to_scene_linear_v3 ( float  scene_linear[3],
const float  color_picking[3] 
)

◆ IMB_colormanagement_colorspace_from_ibuf_ftype()

void IMB_colormanagement_colorspace_from_ibuf_ftype ( struct ColorManagedColorspaceSettings colorspace_settings,
struct ImBuf ibuf 
)

◆ IMB_colormanagement_colorspace_get_indexed_name()

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.

◆ IMB_colormanagement_colorspace_get_name()

const char* IMB_colormanagement_colorspace_get_name ( const struct ColorSpace colorspace)

◆ IMB_colormanagement_colorspace_get_named_index()

int IMB_colormanagement_colorspace_get_named_index ( const char *  name)

◆ IMB_colormanagement_colorspace_items_add()

void IMB_colormanagement_colorspace_items_add ( struct EnumPropertyItem **  items,
int *  totitem 
)

◆ IMB_colormanagement_colorspace_processor_new()

struct ColormanageProcessor* IMB_colormanagement_colorspace_processor_new ( const char *  from_colorspace,
const char *  to_colorspace 
)

◆ IMB_colormanagement_colorspace_to_scene_linear()

void IMB_colormanagement_colorspace_to_scene_linear ( float buffer,
int  width,
int  height,
int  channels,
struct ColorSpace colorspace,
bool  predivide 
)

◆ IMB_colormanagement_colorspace_to_scene_linear_v3()

void IMB_colormanagement_colorspace_to_scene_linear_v3 ( float  pixel[3],
struct ColorSpace colorspace 
)

◆ IMB_colormanagement_colorspace_to_scene_linear_v4()

void IMB_colormanagement_colorspace_to_scene_linear_v4 ( float  pixel[4],
bool  predivide,
struct ColorSpace colorspace 
)

◆ IMB_colormanagement_display_get_default_name()

const char* IMB_colormanagement_display_get_default_name ( void  )

◆ IMB_colormanagement_display_get_default_view_transform_name()

const char* IMB_colormanagement_display_get_default_view_transform_name ( struct ColorManagedDisplay display)

◆ IMB_colormanagement_display_get_indexed_name()

const char* IMB_colormanagement_display_get_indexed_name ( int  index)

◆ IMB_colormanagement_display_get_named()

struct ColorManagedDisplay* IMB_colormanagement_display_get_named ( const char *  name)

◆ IMB_colormanagement_display_get_named_index()

int IMB_colormanagement_display_get_named_index ( const char *  name)

◆ IMB_colormanagement_display_get_none_name()

const char* IMB_colormanagement_display_get_none_name ( void  )

◆ IMB_colormanagement_display_items_add()

void IMB_colormanagement_display_items_add ( struct EnumPropertyItem **  items,
int *  totitem 
)

◆ IMB_colormanagement_display_processor_new()

struct ColormanageProcessor* IMB_colormanagement_display_processor_new ( const struct ColorManagedViewSettings view_settings,
const struct ColorManagedDisplaySettings display_settings 
)

◆ IMB_colormanagement_display_settings_from_ctx()

void IMB_colormanagement_display_settings_from_ctx ( const struct bContext C,
struct ColorManagedViewSettings **  r_view_settings,
struct ColorManagedDisplaySettings **  r_display_settings 
)

◆ IMB_colormanagement_display_to_scene_linear_v3()

void IMB_colormanagement_display_to_scene_linear_v3 ( float  pixel[3],
struct ColorManagedDisplay display 
)

◆ IMB_colormanagement_finish_glsl_draw()

void IMB_colormanagement_finish_glsl_draw ( void  )

◆ IMB_colormanagement_get_float_colorspace()

const char* IMB_colormanagement_get_float_colorspace ( struct ImBuf ibuf)

◆ IMB_colormanagement_get_luminance()

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().

◆ IMB_colormanagement_get_luminance_byte()

BLI_INLINE unsigned char IMB_colormanagement_get_luminance_byte ( const unsigned char  rgb[3])

◆ IMB_colormanagement_get_rect_colorspace()

const char* IMB_colormanagement_get_rect_colorspace ( struct ImBuf ibuf)

◆ IMB_colormanagement_get_xyz_to_scene_linear()

const float* IMB_colormanagement_get_xyz_to_scene_linear ( void  )

Definition at line 1429 of file colormanagement.c.

References imbuf_xyz_to_scene_linear.

Referenced by get_XYZ_to_RGB_for_gpu().

◆ IMB_colormanagement_imbuf_for_write()

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().

◆ IMB_colormanagement_imbuf_make_display_space()

void IMB_colormanagement_imbuf_make_display_space ( struct ImBuf ibuf,
const struct ColorManagedViewSettings view_settings,
const struct ColorManagedDisplaySettings display_settings 
)

◆ IMB_colormanagement_imbuf_to_byte_texture()

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 
)

◆ IMB_colormanagement_imbuf_to_float_texture()

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 
)

◆ IMB_colormanagement_init_default_view_settings()

void IMB_colormanagement_init_default_view_settings ( struct ColorManagedViewSettings view_settings,
const struct ColorManagedDisplaySettings display_settings 
)

◆ IMB_colormanagement_look_get_indexed_name()

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.

◆ IMB_colormanagement_look_get_named_index()

int IMB_colormanagement_look_get_named_index ( const char *  name)

◆ IMB_colormanagement_look_items_add()

void IMB_colormanagement_look_items_add ( struct EnumPropertyItem **  items,
int *  totitem,
const char *  view_name 
)

◆ IMB_colormanagement_pixel_to_display_space_v3()

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 
)

◆ IMB_colormanagement_pixel_to_display_space_v4()

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().

◆ IMB_colormanagement_processor_apply()

void IMB_colormanagement_processor_apply ( struct ColormanageProcessor cm_processor,
float buffer,
int  width,
int  height,
int  channels,
bool  predivide 
)

◆ IMB_colormanagement_processor_apply_byte()

void IMB_colormanagement_processor_apply_byte ( struct ColormanageProcessor cm_processor,
unsigned char *  buffer,
int  width,
int  height,
int  channels 
)

◆ IMB_colormanagement_processor_apply_pixel()

void IMB_colormanagement_processor_apply_pixel ( struct ColormanageProcessor cm_processor,
float pixel,
int  channels 
)

◆ IMB_colormanagement_processor_apply_v3()

void IMB_colormanagement_processor_apply_v3 ( struct ColormanageProcessor cm_processor,
float  pixel[3] 
)

◆ IMB_colormanagement_processor_apply_v4()

void IMB_colormanagement_processor_apply_v4 ( struct ColormanageProcessor cm_processor,
float  pixel[4] 
)

◆ IMB_colormanagement_processor_apply_v4_predivide()

void IMB_colormanagement_processor_apply_v4_predivide ( struct ColormanageProcessor cm_processor,
float  pixel[4] 
)

◆ IMB_colormanagement_processor_free()

void IMB_colormanagement_processor_free ( struct ColormanageProcessor cm_processor)

◆ IMB_colormanagement_rec709_to_scene_linear()

BLI_INLINE void IMB_colormanagement_rec709_to_scene_linear ( float  scene_linear[3],
const float  rec709[3] 
)

◆ IMB_colormanagement_role_colorspace_name_get()

const char* IMB_colormanagement_role_colorspace_name_get ( int  role)

◆ IMB_colormanagement_scene_linear_to_aces()

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().

◆ IMB_colormanagement_scene_linear_to_color_picking_v3()

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:

  • It is approximately perceptually linear, so that the HSV numbers and the HSV cube/circle have an intuitive distribution.
  • It has the same gamut as the scene linear color space.
  • Color picking values 0..1 map to scene linear values in the 0..1 range, so that picked albedo values are energy conserving.

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().

◆ IMB_colormanagement_scene_linear_to_colorspace_v3()

void IMB_colormanagement_scene_linear_to_colorspace_v3 ( float  pixel[3],
struct ColorSpace colorspace 
)

◆ IMB_colormanagement_scene_linear_to_display_v3()

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().

◆ IMB_colormanagement_scene_linear_to_rec709()

BLI_INLINE void IMB_colormanagement_scene_linear_to_rec709 ( float  rec709[3],
const float  scene_linear[3] 
)

◆ IMB_colormanagement_scene_linear_to_srgb_v3()

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().

◆ IMB_colormanagement_scene_linear_to_xyz()

BLI_INLINE void IMB_colormanagement_scene_linear_to_xyz ( float  xyz[3],
const float  scene_linear[3] 
)

◆ IMB_colormanagement_setup_glsl_draw()

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().

◆ IMB_colormanagement_setup_glsl_draw_ctx()

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().

◆ IMB_colormanagement_setup_glsl_draw_from_space()

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 
)
Note
Same as IMB_colormanagement_setup_glsl_draw, but display space conversion happens from a specified space.

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().

◆ IMB_colormanagement_setup_glsl_draw_from_space_ctx()

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().

◆ IMB_colormanagement_space_is_data()

bool IMB_colormanagement_space_is_data ( struct ColorSpace colorspace)

◆ IMB_colormanagement_space_is_scene_linear()

bool IMB_colormanagement_space_is_scene_linear ( struct ColorSpace colorspace)

◆ IMB_colormanagement_space_is_srgb()

bool IMB_colormanagement_space_is_srgb ( struct ColorSpace colorspace)

◆ IMB_colormanagement_space_name_is_data()

bool IMB_colormanagement_space_name_is_data ( const char *  name)

◆ IMB_colormanagement_space_name_is_scene_linear()

bool IMB_colormanagement_space_name_is_scene_linear ( const char *  name)

◆ IMB_colormanagement_space_name_is_srgb()

bool IMB_colormanagement_space_name_is_srgb ( const char *  name)

◆ IMB_colormanagement_srgb_to_scene_linear_v3()

BLI_INLINE void IMB_colormanagement_srgb_to_scene_linear_v3 ( float  scene_linear[3],
const float  srgb[3] 
)

◆ IMB_colormanagement_support_glsl_draw()

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().

◆ IMB_colormanagement_transform()

void IMB_colormanagement_transform ( float buffer,
int  width,
int  height,
int  channels,
const char *  from_colorspace,
const char *  to_colorspace,
bool  predivide 
)

◆ IMB_colormanagement_transform_byte()

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.

◆ IMB_colormanagement_transform_byte_threaded()

void IMB_colormanagement_transform_byte_threaded ( unsigned char *  buffer,
int  width,
int  height,
int  channels,
const char *  from_colorspace,
const char *  to_colorspace 
)

◆ IMB_colormanagement_transform_from_byte()

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.

◆ IMB_colormanagement_transform_from_byte_threaded()

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 
)

◆ IMB_colormanagement_transform_threaded()

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().

◆ IMB_colormanagement_transform_v4()

void IMB_colormanagement_transform_v4 ( float  pixel[4],
const char *  from_colorspace,
const char *  to_colorspace 
)

◆ IMB_colormanagement_validate_settings()

void IMB_colormanagement_validate_settings ( const struct ColorManagedDisplaySettings display_settings,
struct ColorManagedViewSettings view_settings 
)

◆ IMB_colormanagement_view_get_default_name()

const char* IMB_colormanagement_view_get_default_name ( const char *  display_name)

◆ IMB_colormanagement_view_get_indexed_name()

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.

◆ IMB_colormanagement_view_get_named_index()

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().

◆ IMB_colormanagement_view_items_add()

void IMB_colormanagement_view_items_add ( struct EnumPropertyItem **  items,
int *  totitem,
const char *  display_name 
)

◆ IMB_colormanagement_wavelength_to_rgb_table()

void IMB_colormanagement_wavelength_to_rgb_table ( float r_table,
int  width 
)

◆ IMB_colormanagement_xyz_to_scene_linear()

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().

◆ IMB_display_buffer_acquire()

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().

◆ IMB_display_buffer_acquire_ctx()

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().

◆ IMB_display_buffer_release()

void IMB_display_buffer_release ( void cache_handle)

◆ IMB_display_buffer_transform_apply()

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 
)

◆ IMB_partial_display_buffer_update()

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 
)

◆ IMB_partial_display_buffer_update_delayed()

void IMB_partial_display_buffer_update_delayed ( struct ImBuf ibuf,
int  xmin,
int  ymin,
int  xmax,
int  ymax 
)

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