34 if (
var_R > 0.0031308 ){
var_R = 1.055 * ( pow(
var_R , ( 1.0 / 2.4 )) ) - 0.055; }
36 if (
var_G > 0.0031308 ){
var_G = 1.055 * ( pow(
var_G , ( 1.0 / 2.4 )) ) - 0.055; }
38 if (
var_B > 0.0031308 ){
var_B = 1.055 * ( pow(
var_B , ( 1.0 / 2.4 )) ) - 0.055; }
69 const double ref_X = 95.047;
70 const double ref_Y = 100.000;
71 const double ref_Z = 108.883;
95 if (
var_R > 0.04045 ){
var_R = pow(( (
var_R + 0.055 ) / 1.055 ) , 2.4); }
97 if (
var_G > 0.04045 ){
var_G = pow(( (
var_G + 0.055 ) / 1.055 ) , 2.4); }
99 if (
var_B > 0.04045 ){
var_B = pow(( (
var_B + 0.055 ) / 1.055 ) , 2.4); }
126 const double ref_X = 95.047;
127 const double ref_Y = 100.000;
128 const double ref_Z = 108.883;
135 else {
var_X = ( 7.787 *
var_X ) + ( 16. / 116. ); }
137 else {
var_Y = ( 7.787 *
var_Y ) + ( 16. / 116. ); }
139 else {
var_Z = ( 7.787 *
var_Z ) + ( 16. / 116. ); }
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
Vector3 convertCIELabToRGB(const Vector3 &cieLabIn, bool clampToStayInRGB=true)
Converts an CIELab value to RGB without regarding monitor or observation specific settings,...
Vector3 convertXYZToRGB(const Vector3 &xyzIn, bool clampToStayInRGB=true)
Small and bad converter from XYZ in range [0,0,0], [95.047, 100, 108.883] to RGB with r,...
Vector3 convertRGBToXYZ(const Vector3 &rgbIn, bool clampToObserver2IlluminantD65=false)
Small and bad converter from RGB to XYZ with r,g,b in [0,1], assuming observer = 2° and illuminant = ...
Vector3 convertCIELabToXYZ(const Vector3 &cieLabIn)
Small and bad converter from CIELab in range [0,-128,-128], [100, 128, 128] to XYZ in range [0,...
Vector3 scaleCIELabTo16BitUnsigned(Vector3 cieLabIn)
Scale a given cieLabIn value to 16 bit unsigned integer range as described in DICOM standard C....
Vector3 convertXYZToCIELab(const Vector3 &xyzIn)
Small and bad converter from XYZ to CIELab, assuming observer = 2° and illuminant = D65.
Vector3 convertRGBToCIELab(const Vector3 &rgbIn)
Converts an RGB value in [0,1] to CIELab without regarding monitor or observation specific settings,...
Vector3 unscaleCIELabTagValue(Vector3 cieLabScaledIn)
Unscale a given cieLabScalesIn value to [0,100], [-128,127], [-127,127] ranges as described in DICOM ...