public CalRGBColor(PDFObject obj) throws IOException {
	// obj is a dictionary that has the following parts:
	// WhitePoint [a b c]
	// BlackPoint [a b c]
	// Gamma a
	super(CS_sRGB, 3);
        
        // find out what what is according to the CIE color space
        // note that this is not reflexive (i.e. passing this value
        // into toRGB does not get you (1.0, 1.0, 1.0) back)
        // cieWhite = cieCS.fromRGB(new float[] { 1.0f, 1.0f, 1.0f } );
      
        PDFObject ary= obj.getDictRef("WhitePoint");
	if (ary!=null) {
	    for(int i=0; i<3; i++) {
		white[i]= ary.getAt(i).getFloatValue();
	    }
	}
	ary= obj.getDictRef("BlackPoint");
	if (ary!=null) {
	    for(int i=0; i<3; i++) {
		black[i]= ary.getAt(i).getFloatValue();
	    }
	}
	ary= obj.getDictRef("Gamma");
	if (ary!=null) {
	    for (int i=0; i<3; i++) {
		gamma[i]= ary.getAt(i).getFloatValue();
	    }
	}
	ary= obj.getDictRef("Matrix");
	if (ary!=null) {
	    for (int i=0; i<9; i++) {
		matrix[i]= ary.getAt(i).getFloatValue();
	    }
	}
        
        // create a scale matrix relative to the 50 CIE color space.
        // see http://www.brucelindbloom.com/Eqn_RGB_XYZ_Matrix.html
        // we use the Von Kries cone response domain
        float[] cieWhite = rgbCS.toCIEXYZ(new float[] { 1f, 1f, 1f });
     
        float[] sourceWhite = matrixMult(white, vonKriesM, 3);
        float[] destWhite = matrixMult(cieWhite,  vonKriesM, 3);
        
        scale = new float[] { destWhite[0] / sourceWhite[0], 0, 0,
                              0, destWhite[1] / sourceWhite[1], 0,
                              0, 0, destWhite[2] / sourceWhite[2] };
        scale = matrixMult(vonKriesM, scale, 3);
        scale = matrixMult(scale, vonKriesMinv, 3);
    
        max = matrixMult(white, scale, 3);
        max = ciexyzToSRGB(max);
    }