// Title: CIE LAB Visible Gamut // Authors: Michael Horvath, Christoph Lipka // Website: http://isometricland.net // Created: 2017-03-21 // Updated: 2017-03-21 // This file is licensed under the terms of the CC-GNU LGPL. // http://www.gnu.org/licenses/lgpl-2.1.html // Illuminant = D65 // Observer = 2° (1931) // +kfi0 +kff15 +kc #version 3.7; #declare cie_ScaleAmount = 200; #declare cie_RotateAmount = 30; #declare cie_TransAmount = <-1/2,-1/2,-1/2>; #declare cie_AxesScale = 8/8; #declare cie_cam_distance = 17; #declare cie_cam_planesize = 1.7; #declare cie_cam_aspectratio = image_width/image_height; #declare cie_paint_triangles = false; #include "cie_color_conversion_formulas.inc" #include "cie_mesh_generation.inc" #include "cie_basic_scene_settings.inc" #declare cie_fOutR = function(L,A,B) {cie_funcLAB2RGBa1(L,A,B)/50 + 0.5} // /10 + 0.5 #declare cie_fOutG = function(L,A,B) {cie_funcLAB2RGBa2(L,A,B)/50 + 0.5} // /10 + 0.5 #declare cie_fOutB = function(L,A,B) {cie_funcLAB2RGBa3(L,A,B)/50 + 0.5} // /10 + 0.5 #declare cie_fInpL = function(x,y,z) {y*1} //y*100 #declare cie_fInpA = function(x,y,z) {x*256-128} //x*256-128 #declare cie_fInpB = function(x,y,z) {z*256-128} //z*256-128 #declare cie_pigmentR = pigment { function {cie_fOutR(cie_fInpL(x,y,z),cie_fInpA(x,y,z),cie_fInpB(x,y,z))} color_map { [0 color rgb <-50*3,0,0>] [1 color rgb <+50*3,0,0>] } } #declare cie_pigmentG = pigment { function {cie_fOutG(cie_fInpL(x,y,z),cie_fInpA(x,y,z),cie_fInpB(x,y,z))} color_map { [0 color rgb <0,-50*3,0>] [1 color rgb <0,+50*3,0>] } } #declare cie_pigmentB = pigment { function {cie_fOutB(cie_fInpL(x,y,z),cie_fInpA(x,y,z),cie_fInpB(x,y,z))} color_map { [0 color rgb <0,0,-50*3>] [1 color rgb <0,0,+50*3>] } } #declare cie_pigmentRGB = pigment { average pigment_map { [1 cie_pigmentR] [1 cie_pigmentG] [1 cie_pigmentB] } } union { polygon { 4, <0, 0,>, <1, 0,>, <1, 1,>, <0, 1,> pigment {image_map {png "cie_axis_a_b_cube_sans.png"}} scale 440/320 translate -y * ((440-320)/2 * 440/320)/440 translate -x * ((440-320)/2 * 440/320)/440 rotate +x * 90 scale cie_AxesScale translate -y * 0.00001 } polygon { 4, <0, 0,>, <1, 0,>, <1, 1,>, <0, 1,> pigment {image_map {png "cie_axis_L_cube_sans.png"}} scale 440/320 translate -y * ((440-320)/2 * 440/320)/440 translate -x * ((440-320)/2 * 440/320)/440 scale cie_AxesScale translate -z * 0.00001 } union { // cie_calc_visible_gamut_XYZ(2, cie_D65_table) // cie_print_XYZ_coordinates_to_log() #include "cie_xyz_data.inc" // cie_plot_gridlines(2) // cie_plot_polkadots(2) // cie_plot_flatmesh(2) cie_plot_smoothmesh(2) translate <1/2,0,1/2> #if (cie_paint_triangles = false) pigment {cie_pigmentRGB} finish {cie_isoFinish} #end } object { cie_boxShape // pigment {cie_pigmentGradY} pigment {color rgbt 7/8} finish {cie_boxFinish} } object { cie_axesShape } translate cie_TransAmount scale cie_ScaleAmount rotate +y * cie_RotateAmount rotate +y * clock * 360 }