Package com.sun.pdfview.colorspace
Class CalRGBColor
- java.lang.Object
-
- java.awt.color.ColorSpace
-
- com.sun.pdfview.colorspace.CalRGBColor
-
- All Implemented Interfaces:
java.io.Serializable
public class CalRGBColor extends java.awt.color.ColorSpace
A ColorSpace for calibrated RGB- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) float[]
black
(package private) static java.awt.color.ColorSpace
cieCS
(package private) float[]
gamma
(package private) float[]
matrix
(package private) float[]
max
(package private) static java.awt.color.ColorSpace
rgbCS
(package private) float[]
scale
private static float[]
vonKriesM
private static float[]
vonKriesMinv
(package private) float[]
white
private static float[]
xyzToRGB
private static float[]
xyzToSRGB
-
Fields inherited from class java.awt.color.ColorSpace
CS_CIEXYZ, CS_GRAY, CS_LINEAR_RGB, CS_PYCC, CS_sRGB, TYPE_2CLR, TYPE_3CLR, TYPE_4CLR, TYPE_5CLR, TYPE_6CLR, TYPE_7CLR, TYPE_8CLR, TYPE_9CLR, TYPE_ACLR, TYPE_BCLR, TYPE_CCLR, TYPE_CMY, TYPE_CMYK, TYPE_DCLR, TYPE_ECLR, TYPE_FCLR, TYPE_GRAY, TYPE_HLS, TYPE_HSV, TYPE_Lab, TYPE_Luv, TYPE_RGB, TYPE_XYZ, TYPE_YCbCr, TYPE_Yxy
-
-
Constructor Summary
Constructors Constructor Description CalRGBColor(PDFObject obj)
Create a new Calibrated RGB color space object, given the description in a PDF dictionary.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private float[]
ciexyzToSRGB(float[] xyz)
Convert from CIEXYZ, with scale and gamma calculated to sRGBfloat[]
fromCIEXYZ(float[] colorvalue)
convert from CIEXYZ to Calibrated RGB.float[]
fromRGB(float[] rgbvalue)
convert from RGB to Calibrated RGB.int
getNumComponents()
get the number of components (3)int
getType()
get the type of this color space (TYPE_RGB)(package private) float[]
matrixMult(float[] a, float[] b, int len)
Slowly multiply two matricesfloat[]
toCIEXYZ(float[] colorvalue)
convert from Calibrated RGB to CIEXYZ.float[]
toRGB(float[] comp)
convert from Calibrated RGB to standard RGB
-
-
-
Field Detail
-
vonKriesM
private static final float[] vonKriesM
-
vonKriesMinv
private static final float[] vonKriesMinv
-
xyzToSRGB
private static final float[] xyzToSRGB
-
xyzToRGB
private static final float[] xyzToRGB
-
scale
float[] scale
-
max
float[] max
-
white
float[] white
-
black
float[] black
-
matrix
float[] matrix
-
gamma
float[] gamma
-
rgbCS
static java.awt.color.ColorSpace rgbCS
-
cieCS
static java.awt.color.ColorSpace cieCS
-
-
Constructor Detail
-
CalRGBColor
public CalRGBColor(PDFObject obj) throws java.io.IOException
Create a new Calibrated RGB color space object, given the description in a PDF dictionary.- Parameters:
obj
- a dictionary that contains an array of 3 Numbers for "WhitePoint" and "BlackPoint", a Number for "Gamma", and an array of 9 Numbers for "Matrix".- Throws:
java.io.IOException
-
-
Method Detail
-
getNumComponents
public int getNumComponents()
get the number of components (3)- Overrides:
getNumComponents
in classjava.awt.color.ColorSpace
-
toRGB
public float[] toRGB(float[] comp)
convert from Calibrated RGB to standard RGB- Specified by:
toRGB
in classjava.awt.color.ColorSpace
- Parameters:
comp
- the Calibrated RGB values (0-1)- Returns:
- the RGB values (0-1)
-
ciexyzToSRGB
private float[] ciexyzToSRGB(float[] xyz)
Convert from CIEXYZ, with scale and gamma calculated to sRGB
-
fromRGB
public float[] fromRGB(float[] rgbvalue)
convert from RGB to Calibrated RGB. NOT IMPLEMENTED- Specified by:
fromRGB
in classjava.awt.color.ColorSpace
-
fromCIEXYZ
public float[] fromCIEXYZ(float[] colorvalue)
convert from CIEXYZ to Calibrated RGB. NOT IMPLEMENTED- Specified by:
fromCIEXYZ
in classjava.awt.color.ColorSpace
-
getType
public int getType()
get the type of this color space (TYPE_RGB)- Overrides:
getType
in classjava.awt.color.ColorSpace
-
toCIEXYZ
public float[] toCIEXYZ(float[] colorvalue)
convert from Calibrated RGB to CIEXYZ. NOT IMPLEMENTED- Specified by:
toCIEXYZ
in classjava.awt.color.ColorSpace
-
matrixMult
float[] matrixMult(float[] a, float[] b, int len)
Slowly multiply two matrices- Parameters:
a
- the first matrixb
- the second matrixlen
- the size of each row. All matrix lengths must be a multiple of len.
-
-