1 7 8 17 18 package java.awt.color; 19 20 import java.awt.image.LookupTable ; 21 import sun.awt.color.ProfileDeferralInfo; 22 23 69 70 71 72 public class ICC_ProfileRGB 73 extends ICC_Profile { 74 75 78 public static final int REDCOMPONENT = 0; 79 80 83 public static final int GREENCOMPONENT = 1; 84 85 88 public static final int BLUECOMPONENT = 2; 89 90 91 97 ICC_ProfileRGB(long ID) { 98 super(ID); 99 } 100 101 107 ICC_ProfileRGB(ProfileDeferralInfo pdi) { 108 super(pdi); 109 } 110 111 112 119 public float[] getMediaWhitePoint() { 120 return super.getMediaWhitePoint(); 121 } 122 123 124 137 public float[][] getMatrix() { 138 float[][] theMatrix = new float[3][3]; 139 float[] tmpMatrix; 140 141 tmpMatrix = getXYZTag(ICC_Profile.icSigRedColorantTag); 142 theMatrix[0][0] = tmpMatrix[0]; 143 theMatrix[1][0] = tmpMatrix[1]; 144 theMatrix[2][0] = tmpMatrix[2]; 145 tmpMatrix = getXYZTag(ICC_Profile.icSigGreenColorantTag); 146 theMatrix[0][1] = tmpMatrix[0]; 147 theMatrix[1][1] = tmpMatrix[1]; 148 theMatrix[2][1] = tmpMatrix[2]; 149 tmpMatrix = getXYZTag(ICC_Profile.icSigBlueColorantTag); 150 theMatrix[0][2] = tmpMatrix[0]; 151 theMatrix[1][2] = tmpMatrix[1]; 152 theMatrix[2][2] = tmpMatrix[2]; 153 return theMatrix; 154 } 155 156 180 public float getGamma(int component) { 181 float theGamma; 182 int theSignature; 183 184 switch (component) { 185 case REDCOMPONENT: 186 theSignature = ICC_Profile.icSigRedTRCTag; 187 break; 188 189 case GREENCOMPONENT: 190 theSignature = ICC_Profile.icSigGreenTRCTag; 191 break; 192 193 case BLUECOMPONENT: 194 theSignature = ICC_Profile.icSigBlueTRCTag; 195 break; 196 197 default: 198 throw new IllegalArgumentException ("Must be Red, Green, or Blue"); 199 } 200 201 theGamma = super.getGamma(theSignature); 202 203 return theGamma; 204 } 205 206 236 public short[] getTRC(int component) { 237 short[] theTRC; 238 int theSignature; 239 240 switch (component) { 241 case REDCOMPONENT: 242 theSignature = ICC_Profile.icSigRedTRCTag; 243 break; 244 245 case GREENCOMPONENT: 246 theSignature = ICC_Profile.icSigGreenTRCTag; 247 break; 248 249 case BLUECOMPONENT: 250 theSignature = ICC_Profile.icSigBlueTRCTag; 251 break; 252 253 default: 254 throw new IllegalArgumentException ("Must be Red, Green, or Blue"); 255 } 256 257 theTRC = super.getTRC(theSignature); 258 259 return theTRC; 260 } 261 262 } 263 264 | Popular Tags |