Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
colorspace.h File Reference
#include "common.h"
+ Include dependency graph for colorspace.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static float4 matrix_dot (const float4 vector, const float4 matrix[3])
 
static float4 matrix_product (const float4 xyz, constant const float *const matrix)
 
static float3 matrix_dot_float4_rows (const float4 row0, const float4 row1, const float4 row2, const float3 xyz)
 
static float3 matrix_dot_float4 (const constant float4 *const matrix, const float3 xyz)
 
static float4 matrix_product_float4 (const float4 xyz, constant const float *const matrix)
 
static float4 Lab_2_LCH (float4 Lab)
 
static float4 LCH_2_Lab (float4 LCH)
 
static float4 lab_f (float4 x)
 
static float4 XYZ_to_Lab (float4 xyz)
 
static float4 lab_f_inv (float4 x)
 
static float4 Lab_to_XYZ (float4 Lab)
 
static float4 prophotorgb_to_XYZ (float4 rgb)
 
static float4 XYZ_to_prophotorgb (float4 XYZ)
 
static float4 Lab_to_prophotorgb (float4 Lab)
 
static float4 prophotorgb_to_Lab (float4 rgb)
 
static float4 RGB_2_HSL (const float4 RGB)
 
static float Hue_2_RGB (float v1, float v2, float vH)
 
static float4 HSL_2_RGB (const float4 HSL)
 
static float4 RGB_2_HSV (const float4 RGB)
 
static float4 HSV_2_RGB (const float4 HSV)
 
static float4 XYZ_to_sRGB (float4 XYZ)
 
static float4 sRGB_to_XYZ (float4 sRGB)
 
static float4 XYZ_to_JzAzBz (float4 XYZ_D65)
 
static float4 JzAzBz_2_XYZ (const float4 JzAzBz)
 
static float4 JzAzBz_to_JzCzhz (float4 JzAzBz)
 
static float4 XYZ_to_LMS (const float4 XYZ)
 
static float4 LMS_to_XYZ (const float4 LMS)
 
static float4 gradingRGB_to_LMS (const float4 RGB)
 
static float4 LMS_to_gradingRGB (const float4 LMS)
 
static float4 LMS_to_Yrg (const float4 LMS)
 
static float4 Yrg_to_LMS (const float4 Yrg)
 
static float4 Yrg_to_Ych (const float4 Yrg)
 
static float4 Ych_to_Yrg (const float4 Ych)
 
static float4 dt_xyY_to_uvY (const float4 xyY)
 
static float4 dt_uvY_to_xyY (const float4 uvY)
 
static float4 dt_XYZ_to_xyY (const float4 XYZ)
 
static float4 dt_xyY_to_XYZ (const float4 xyY)
 
static float4 convert_XYZ_to_bradford_LMS (const float4 XYZ)
 
static float4 convert_bradford_LMS_to_XYZ (const float4 LMS)
 
static float4 convert_XYZ_to_CAT16_LMS (const float4 XYZ)
 
static float4 convert_CAT16_LMS_to_XYZ (const float4 LMS)
 
static void bradford_adapt_D50 (float4 *lms_in, const float4 origin_illuminant, const float p, const int full)
 
static void CAT16_adapt_D50 (float4 *lms_in, const float4 origin_illuminant, const float D, const int full)
 
static void XYZ_adapt_D50 (float4 *lms_in, const float4 origin_illuminant)
 
static float4 gamut_check_Yrg (float4 Ych)
 
static float Y_to_dt_UCS_L_star (const float Y)
 
static float dt_UCS_L_star_to_Y (const float L_star)
 
static void xyY_to_dt_UCS_UV (const float4 xyY, float UV_star_prime[2])
 
static float4 xyY_to_dt_UCS_JCH (const float4 xyY, const float L_white)
 
static float4 dt_UCS_JCH_to_xyY (const float4 JCH, const float L_white)
 
static float4 dt_UCS_JCH_to_HSB (const float4 JCH)
 
static float4 dt_UCS_HSB_to_JCH (const float4 HSB)
 
static float4 dt_UCS_JCH_to_HCB (const float4 JCH)
 
static float4 dt_UCS_HCB_to_JCH (const float4 HCB)
 

Function Documentation

◆ bradford_adapt_D50()

static void bradford_adapt_D50 ( float4 *  lms_in,
const float4  origin_illuminant,
const float  p,
const int  full 
)
inlinestatic

Definition at line 697 of file colorspace.h.

References p.

Referenced by extract_color_checker(), loop_switch(), switch(), and WB_coeffs_to_illuminant_xy().

◆ CAT16_adapt_D50()

static void CAT16_adapt_D50 ( float4 *  lms_in,
const float4  origin_illuminant,
const float  D,
const int  full 
)
inlinestatic

Definition at line 722 of file colorspace.h.

Referenced by extract_color_checker(), loop_switch(), and switch().

◆ convert_bradford_LMS_to_XYZ()

static float4 convert_bradford_LMS_to_XYZ ( const float4  LMS)
inlinestatic

Definition at line 667 of file colorspace.h.

References Bradford_LMS_to_XYZ, LMS, and matrix_dot().

Referenced by loop_switch(), switch(), and WB_coeffs_to_illuminant_xy().

◆ convert_CAT16_LMS_to_XYZ()

static float4 convert_CAT16_LMS_to_XYZ ( const float4  LMS)
inlinestatic

Definition at line 687 of file colorspace.h.

References CAT16_LMS_to_XYZ, LMS, and matrix_dot().

Referenced by loop_switch(), and switch().

◆ convert_XYZ_to_bradford_LMS()

static float4 convert_XYZ_to_bradford_LMS ( const float4  XYZ)
inlinestatic

Definition at line 657 of file colorspace.h.

References matrix_dot(), XYZ, and XYZ_to_Bradford_LMS.

Referenced by loop_switch(), switch(), and WB_coeffs_to_illuminant_xy().

◆ convert_XYZ_to_CAT16_LMS()

static float4 convert_XYZ_to_CAT16_LMS ( const float4  XYZ)
inlinestatic

Definition at line 677 of file colorspace.h.

References matrix_dot(), XYZ, and XYZ_to_CAT16_LMS.

Referenced by loop_switch(), and switch().

◆ dt_UCS_HCB_to_JCH()

static float4 dt_UCS_HCB_to_JCH ( const float4  HCB)
inlinestatic

Definition at line 921 of file colorspace.h.

◆ dt_UCS_HSB_to_JCH()

static float4 dt_UCS_HSB_to_JCH ( const float4  HSB)
inlinestatic

Definition at line 901 of file colorspace.h.

◆ dt_UCS_JCH_to_HCB()

static float4 dt_UCS_JCH_to_HCB ( const float4  JCH)
inlinestatic

Definition at line 911 of file colorspace.h.

◆ dt_UCS_JCH_to_HSB()

static float4 dt_UCS_JCH_to_HSB ( const float4  JCH)
inlinestatic

Definition at line 891 of file colorspace.h.

Referenced by dt_colorrings_profile_rgb_to_dt_ucs_hsb().

◆ dt_UCS_JCH_to_xyY()

static float4 dt_UCS_JCH_to_xyY ( const float4  JCH,
const float  L_white 
)
inlinestatic

Definition at line 849 of file colorspace.h.

References dt_UCS_L_star_to_Y(), M, and xyY.

◆ dt_UCS_L_star_to_Y()

static float dt_UCS_L_star_to_Y ( const float  L_star)
inlinestatic

Definition at line 796 of file colorspace.h.

Referenced by dt_UCS_JCH_to_xyY().

◆ dt_uvY_to_xyY()

static float4 dt_uvY_to_xyY ( const float4  uvY)
inlinestatic

Definition at line 618 of file colorspace.h.

References uvY, and xyY.

◆ dt_xyY_to_uvY()

static float4 dt_xyY_to_uvY ( const float4  xyY)
inlinestatic

Definition at line 600 of file colorspace.h.

References uvY, and xyY.

◆ dt_xyY_to_XYZ()

static float4 dt_xyY_to_XYZ ( const float4  xyY)
inlinestatic

Definition at line 645 of file colorspace.h.

References xyY, and XYZ.

Referenced by _create_vectorscope_image(), and _process_vectorscope().

◆ dt_XYZ_to_xyY()

static float4 dt_XYZ_to_xyY ( const float4  XYZ)
inlinestatic

◆ gamut_check_Yrg()

static float4 gamut_check_Yrg ( float4  Ych)
inlinestatic

Definition at line 748 of file colorspace.h.

References Ych_to_Yrg().

◆ gradingRGB_to_LMS()

static float4 gradingRGB_to_LMS ( const float4  RGB)
inlinestatic

Definition at line 509 of file colorspace.h.

References matrix_dot(), and RGB.

Referenced by Yrg_to_LMS().

◆ HSL_2_RGB()

static float4 HSL_2_RGB ( const float4  HSL)
inlinestatic

Definition at line 241 of file colorspace.h.

References B, H, HSL, Hue_2_RGB(), L, R, and S.

◆ HSV_2_RGB()

static float4 HSV_2_RGB ( const float4  HSV)
inlinestatic

Definition at line 308 of file colorspace.h.

References HSV, i, p, RGB, t, and v.

◆ Hue_2_RGB()

static float Hue_2_RGB ( float  v1,
float  v2,
float  vH 
)
inlinestatic

Definition at line 229 of file colorspace.h.

Referenced by HSL_2_RGB().

◆ JzAzBz_2_XYZ()

static float4 JzAzBz_2_XYZ ( const float4  JzAzBz)
inlinestatic

Definition at line 414 of file colorspace.h.

References AI, c1, c2, c3, d, d0, g, IzAzBz, JzAzBz, LMS, MI, n_inv, p_inv, XYZ, and XYZ_D65.

◆ JzAzBz_to_JzCzhz()

static float4 JzAzBz_to_JzCzhz ( float4  JzAzBz)
inlinestatic

Definition at line 460 of file colorspace.h.

References JzAzBz, and M_PI_F.

◆ Lab_2_LCH()

static float4 Lab_2_LCH ( float4  Lab)
inlinestatic

Definition at line 73 of file colorspace.h.

References C, H, L, Lab, and M_PI_F.

◆ lab_f()

static float4 lab_f ( float4  x)
inlinestatic

Definition at line 96 of file colorspace.h.

References x.

Referenced by XYZ_to_Lab().

◆ lab_f_inv()

static float4 lab_f_inv ( float4  x)
inlinestatic

Definition at line 117 of file colorspace.h.

References x.

Referenced by Lab_to_XYZ().

◆ Lab_to_prophotorgb()

static float4 Lab_to_prophotorgb ( float4  Lab)
inlinestatic

Definition at line 175 of file colorspace.h.

References Lab, Lab_to_XYZ(), XYZ, and XYZ_to_prophotorgb().

◆ Lab_to_XYZ()

static float4 Lab_to_XYZ ( float4  Lab)
inlinestatic

Definition at line 125 of file colorspace.h.

References d50, f, Lab, and lab_f_inv().

Referenced by Lab_to_prophotorgb().

◆ LCH_2_Lab()

static float4 LCH_2_Lab ( float4  LCH)
inlinestatic

Definition at line 86 of file colorspace.h.

References L, LCH, and M_PI_F.

◆ LMS_to_gradingRGB()

static float4 LMS_to_gradingRGB ( const float4  LMS)
inlinestatic

Definition at line 519 of file colorspace.h.

References LMS, and matrix_dot().

Referenced by LMS_to_Yrg().

◆ LMS_to_XYZ()

static float4 LMS_to_XYZ ( const float4  LMS)
inlinestatic

Definition at line 491 of file colorspace.h.

References LMS, and matrix_dot().

◆ LMS_to_Yrg()

static float4 LMS_to_Yrg ( const float4  LMS)
inlinestatic

Definition at line 534 of file colorspace.h.

References LMS, LMS_to_gradingRGB(), and rgb.

◆ matrix_dot()

static float4 matrix_dot ( const float4  vector,
const float4  matrix[3] 
)
inlinestatic

◆ matrix_dot_float4()

static float3 matrix_dot_float4 ( const constant float4 *const  matrix,
const float3  xyz 
)
inlinestatic

Definition at line 58 of file colorspace.h.

References matrix, and matrix_dot_float4_rows().

◆ matrix_dot_float4_rows()

static float3 matrix_dot_float4_rows ( const float4  row0,
const float4  row1,
const float4  row2,
const float3  xyz 
)
inlinestatic

Definition at line 52 of file colorspace.h.

References row0, row1, and row2.

Referenced by matrix_dot_float4(), and matrix_product_float4().

◆ matrix_product()

static float4 matrix_product ( const float4  xyz,
constant const float *const  matrix 
)
inlinestatic

Definition at line 43 of file colorspace.h.

References B, matrix, and R.

Referenced by rgb_matrix_to_xyz().

◆ matrix_product_float4()

static float4 matrix_product_float4 ( const float4  xyz,
constant const float *const  matrix 
)
inlinestatic

Definition at line 64 of file colorspace.h.

References matrix, matrix_dot_float4_rows(), out, row0, row1, and row2.

◆ prophotorgb_to_Lab()

static float4 prophotorgb_to_Lab ( float4  rgb)
inlinestatic

Definition at line 181 of file colorspace.h.

References prophotorgb_to_XYZ(), rgb, XYZ, and XYZ_to_Lab().

◆ prophotorgb_to_XYZ()

static float4 prophotorgb_to_XYZ ( float4  rgb)
inlinestatic

Definition at line 135 of file colorspace.h.

References rgb, and XYZ.

Referenced by prophotorgb_to_Lab().

◆ RGB_2_HSL()

static float4 RGB_2_HSL ( const float4  RGB)
inlinestatic

Definition at line 187 of file colorspace.h.

References B, H, L, R, RGB, and S.

◆ RGB_2_HSV()

static float4 RGB_2_HSV ( const float4  RGB)
inlinestatic

Definition at line 271 of file colorspace.h.

References delta, HSV, and RGB.

◆ sRGB_to_XYZ()

static float4 sRGB_to_XYZ ( float4  sRGB)
inlinestatic

Definition at line 367 of file colorspace.h.

References sRGB, and XYZ.

◆ xyY_to_dt_UCS_JCH()

static float4 xyY_to_dt_UCS_JCH ( const float4  xyY,
const float  L_white 
)
inlinestatic

Definition at line 823 of file colorspace.h.

References xyY, xyY_to_dt_UCS_UV(), and Y_to_dt_UCS_L_star().

Referenced by dt_colorrings_profile_rgb_to_dt_ucs_jch().

◆ xyY_to_dt_UCS_UV()

static void xyY_to_dt_UCS_UV ( const float4  xyY,
float  UV_star_prime[2] 
)
inlinestatic

Definition at line 802 of file colorspace.h.

References xyY.

Referenced by commit_params(), and xyY_to_dt_UCS_JCH().

◆ XYZ_adapt_D50()

static void XYZ_adapt_D50 ( float4 *  lms_in,
const float4  origin_illuminant 
)
inlinestatic

Definition at line 737 of file colorspace.h.

Referenced by extract_color_checker(), loop_switch(), and switch().

◆ XYZ_to_JzAzBz()

static float4 XYZ_to_JzAzBz ( float4  XYZ_D65)
inlinestatic

Definition at line 380 of file colorspace.h.

References A, M, and XYZ_D65.

◆ XYZ_to_Lab()

static float4 XYZ_to_Lab ( float4  xyz)
inlinestatic

Definition at line 104 of file colorspace.h.

References d50, and lab_f().

Referenced by prophotorgb_to_Lab().

◆ XYZ_to_LMS()

static float4 XYZ_to_LMS ( const float4  XYZ)
inlinestatic

Definition at line 480 of file colorspace.h.

References matrix_dot(), and XYZ.

◆ XYZ_to_prophotorgb()

static float4 XYZ_to_prophotorgb ( float4  XYZ)
inlinestatic

Definition at line 155 of file colorspace.h.

References rgb, and XYZ.

Referenced by Lab_to_prophotorgb().

◆ XYZ_to_sRGB()

static float4 XYZ_to_sRGB ( float4  XYZ)
inlinestatic

Definition at line 353 of file colorspace.h.

References sRGB, and XYZ.

◆ Y_to_dt_UCS_L_star()

static float Y_to_dt_UCS_L_star ( const float  Y)
inlinestatic

The following is darktable Uniform Color Space 2022 © Aurélien Pierre https://eng.aurelienpierre.com/2022/02/color-saturation-control-for-the-21th-century/

Use this space for color-grading in a perceptual framework. The CAM terms have been removed for performance.

Definition at line 789 of file colorspace.h.

Referenced by dt_colorrings_graph_white(), process(), process_cl(), and xyY_to_dt_UCS_JCH().

◆ Ych_to_Yrg()

static float4 Ych_to_Yrg ( const float4  Ych)
inlinestatic

Definition at line 589 of file colorspace.h.

References g, and r.

Referenced by gamut_check_Yrg().

◆ Yrg_to_LMS()

static float4 Yrg_to_LMS ( const float4  Yrg)
inlinestatic

Definition at line 550 of file colorspace.h.

References g, gradingRGB_to_LMS(), r, and rgb.

◆ Yrg_to_Ych()

static float4 Yrg_to_Ych ( const float4  Yrg)
inlinestatic

Definition at line 574 of file colorspace.h.

References g, and r.