package model.color; import util.Matrix; public class ColorConst { public final static int NUM_CHAN = 3; private Matrix matrix = new Matrix(); // public final static double [][] RGB_TRISTIM = { // {0.607, 0.174, 0.2000}, // {0.299, 0.587, 0.114}, // {0.00, 0.066, 1.116}}; public final static double [][] RGB_TRISTIM = { {0.431, 0.342, 0.178}, {0.222, 0.707, 0.071}, {0.020, 0.130, 0.939}}; public final static double [][] TRISTIM_CONES = { {0.61209, 2.14231, -0.02966}, {-0.969775, 2.955775, 0.305425}, {0, 0, 1.41183}}; // public final static double [][] CONES_COLOR_OPP = { // {0.85, 1.50, 0.01}, // {1.66, -2.43, 0}, // {-0.34, -0.26, 0.71}}; // fudge matrix to wipe out R_G and B_Y responses // on achromatic images public final static double [][] CONES_COLOR_OPP = { {0.85, 1.50, 0.01}, {1.66, -2.23, 0.37}, {0.34, 0.06, -0.71}}; // {0.85, 1.50, 0.01}, // {2.12, -2.43, 0}, // {-0.27, -0.19, 0.71}}; // image position constants public final static int R = 0; public final static int G = 1; public final static int B = 2; // tristimulus positions public final static int X = 0; public final static int Y = 1; public final static int Z = 2; // cone positions public final static int L = 0; public final static int M = 1; public final static int S = 2; // color opponent change position constants public final static int BL_WH = 0; public final static int R_G = 1; public final static int B_Y = 2; // methods to further the computations public double [][] getRGB_CONE(){ double [][] temp = matrix.mMult(RGB_TRISTIM,TRISTIM_CONES); return temp; } public double [][] getTRISTIM_COLOR_OPP(){ double [][] temp = matrix.mMult(TRISTIM_CONES, CONES_COLOR_OPP); return temp; } public double [][] getRGB_COLOR_OPP(){ double [][] temp = matrix.mMult(getRGB_CONE(), CONES_COLOR_OPP); return temp; } public final static int ACHROMATIC = 0; public final static int RED_GREEN = 1; public final static int BLUE_YELLOW = 0; public final static String OPPONENT_CHANNELS [] = {"Achromatic","Red-Green","Blue-Yellow"}; }