Blender  V3.3
Macros | Functions
colormanagement_inline.c File Reference
#include "BLI_math_vector.h"
#include "IMB_colormanagement_intern.h"

Go to the source code of this file.

Macros

#define __IMB_COLORMANAGEMENT_INLINE_C__
 

Functions

float IMB_colormanagement_get_luminance (const float rgb[3])
 
unsigned char IMB_colormanagement_get_luminance_byte (const unsigned char rgb[3])
 
void IMB_colormanagement_xyz_to_scene_linear (float scene_linear[3], const float xyz[3])
 
void IMB_colormanagement_scene_linear_to_xyz (float xyz[3], const float scene_linear[3])
 
void IMB_colormanagement_rec709_to_scene_linear (float scene_linear[3], const float rec709[3])
 
void IMB_colormanagement_scene_linear_to_rec709 (float rec709[3], const float scene_linear[3])
 
void IMB_colormanagement_scene_linear_to_srgb_v3 (float srgb[3], const float scene_linear[3])
 
void IMB_colormanagement_srgb_to_scene_linear_v3 (float scene_linear[3], const float srgb[3])
 
void IMB_colormanagement_aces_to_scene_linear (float scene_linear[3], const float aces[3])
 
void IMB_colormanagement_scene_linear_to_aces (float aces[3], const float scene_linear[3])
 

Macro Definition Documentation

◆ __IMB_COLORMANAGEMENT_INLINE_C__

#define __IMB_COLORMANAGEMENT_INLINE_C__

Definition at line 9 of file colormanagement_inline.c.

Function Documentation

◆ IMB_colormanagement_aces_to_scene_linear()

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

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

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

◆ IMB_colormanagement_rec709_to_scene_linear()

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

◆ IMB_colormanagement_scene_linear_to_aces()

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

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

◆ IMB_colormanagement_scene_linear_to_srgb_v3()

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

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

◆ IMB_colormanagement_srgb_to_scene_linear_v3()

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

◆ IMB_colormanagement_xyz_to_scene_linear()

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