001/*******************************************************************************
002 * This software is provided as a supplement to the authors' textbooks on digital
003 *  image processing published by Springer-Verlag in various languages and editions.
004 * Permission to use and distribute this software is granted under the BSD 2-Clause 
005 * "Simplified" License (see http://opensource.org/licenses/BSD-2-Clause). 
006 * Copyright (c) 2006-2016 Wilhelm Burger, Mark J. Burge. All rights reserved. 
007 * Visit http://imagingbook.com for additional details.
008 *******************************************************************************/
009
010package imagingbook.pub.color.image;
011
012public enum Illuminant {
013        E       (1/3.0, 1/3.0),                                         // 5400K, Equal energy
014        D50     (0.964296, 1.00000, 0.825100),          // 5000K
015        D55 (0.33411, 0.34877),                                 // 5500K
016        D65 (0.950456, 1.00000, 1.088754),              // 6500K, Television, sRGB color space
017        D75 (0.29968, 0.31740),                                 // 7500K
018        A       (0.45117, 0.40594),                                     // 2856K, Incandescent tungsten
019        B       (0.3498, 0.3527),                                       // 4874K, Obsolete, direct sunlight at noon 
020        C       (0.31039, 0.31905),                                     // 6774K, Obsolete, north sky daylight 
021        F2      (0.37928, 0.36723),                                     // 4200K, Cool White Fluorescent (CWF)
022        F7      (0.31565, 0.32951),                                     // 6500K,  Broad-Band Daylight Fluorescent 
023        F11     (0.38543, 0.37110);                                     // 4000K,  Narrow Band White Fluorescent 
024        
025        public final double X, Y, Z;
026
027        private Illuminant(double X, double Y, double Z) {
028                this.X = X; this.Y = Y; this.Z = Z;
029        }
030        
031        private Illuminant(double x, double y) {
032                Y = 1.0;
033                X = x * Y / y; 
034                Z = (1.0 - x - y) * Y / y;
035        }
036        
037        public float[] getXyzFloat() {
038                return new float[] {(float)X, (float)Y, (float)Z};
039        }
040        
041}