public final class RGBColorSpace extends ColorSpace
RGBColorSpace
class is an implementation of ColorSpace
and represents an RGB color space.
This class is thread-safe and therefore suitable for concurrent use without external synchronization.
Modifier and Type | Field and Description |
---|---|
static RGBColorSpace |
SRGB
An
RGBColorSpace for the sRGB color space. |
Modifier and Type | Method and Description |
---|---|
int |
convertRGBToLinear(int rGB)
Converts the RGB-component values of
rGB from non-linear to linear representations. |
int |
convertRGBToNonLinear(int rGB)
Converts the RGB-component values of
rGB from linear to non-linear representations. |
Color |
convertRGBToXYZ(Color color)
Converts
color from the RGB color space to the XYZ color space. |
Color |
convertXYZToRGB(Color color)
Converts
color from the XYZ color space to the RGB color space. |
float |
getBreakPoint()
Returns the break point.
|
float |
getBW()
Returns the BW component of the matrix that converts from RGB color space to XYZ color space.
|
float |
getBX()
Returns the BX component of the matrix that converts from RGB color space to XYZ color space.
|
float |
getBY()
Returns the BY component of the matrix that converts from RGB color space to XYZ color space.
|
float |
getBZ()
Returns the BZ component of the matrix that converts from RGB color space to XYZ color space.
|
float |
getGamma()
Returns the gamma value.
|
float |
getGW()
Returns the GW component of the matrix that converts from RGB color space to XYZ color space.
|
float |
getGX()
Returns the GX component of the matrix that converts from RGB color space to XYZ color space.
|
float |
getGY()
Returns the GY component of the matrix that converts from RGB color space to XYZ color space.
|
float |
getGZ()
Returns the GZ component of the matrix that converts from RGB color space to XYZ color space.
|
float |
getRW()
Returns the RW component of the matrix that converts from RGB color space to XYZ color space.
|
float |
getRX()
Returns the RX component of the matrix that converts from RGB color space to XYZ color space.
|
float |
getRY()
Returns the RY component of the matrix that converts from RGB color space to XYZ color space.
|
float |
getRZ()
Returns the RZ component of the matrix that converts from RGB color space to XYZ color space.
|
float |
getSegmentOffset()
Returns the segment offset.
|
float |
getSlope()
Returns the slope.
|
float |
getSlopeMatch()
Returns the slope match.
|
float |
getXB()
Returns the XB component of the matrix that converts from XYZ color space to RGB color space.
|
float |
getXG()
Returns the XG component of the matrix that converts from XYZ color space to RGB color space.
|
float |
getXR()
Returns the XR component of the matrix that converts from XYZ color space to RGB color space.
|
float |
getXW()
Returns the XW component of the matrix that converts from XYZ color space to RGB color space.
|
float |
getYB()
Returns the YB component of the matrix that converts from XYZ color space to RGB color space.
|
float |
getYG()
Returns the YG component of the matrix that converts from XYZ color space to RGB color space.
|
float |
getYR()
Returns the YR component of the matrix that converts from XYZ color space to RGB color space.
|
float |
getYW()
Returns the YW component of the matrix that converts from XYZ color space to RGB color space.
|
float |
getZB()
Returns the ZB component of the matrix that converts from XYZ color space to RGB color space.
|
float |
getZG()
Returns the ZG component of the matrix that converts from XYZ color space to RGB color space.
|
float |
getZR()
Returns the ZR component of the matrix that converts from XYZ color space to RGB color space.
|
float |
getZW()
Returns the ZW component of the matrix that converts from XYZ color space to RGB color space.
|
float |
redoGammaCorrection(float value)
Call this method to redo Gamma Correction on
value . |
float |
undoGammaCorrection(float value)
Call this method to undo Gamma Correction on
value . |
public static final RGBColorSpace SRGB
RGBColorSpace
for the sRGB color space.public Color convertRGBToXYZ(Color color)
color
from the RGB color space to the XYZ color space.
Returns a Color
in the XYZ color space.
If color
is null
, a NullPointerException
will be thrown.
color
- the Color
to convertColor
in the XYZ color spacejava.lang.NullPointerException
- thrown if, and only if, color
is null
public Color convertXYZToRGB(Color color)
color
from the XYZ color space to the RGB color space.
Returns a Color
in the RGB color space.
If color
is null
, a NullPointerException
will be thrown.
color
- the Color
to convertColor
in the RGB color spacejava.lang.NullPointerException
- thrown if, and only if, color
is null
public float getBW()
public float getBX()
public float getBY()
public float getBZ()
public float getBreakPoint()
public float getGW()
public float getGX()
public float getGY()
public float getGZ()
public float getGamma()
public float getRW()
public float getRX()
public float getRY()
public float getRZ()
public float getSegmentOffset()
public float getSlope()
public float getSlopeMatch()
public float getXB()
public float getXG()
public float getXR()
public float getXW()
public float getYB()
public float getYG()
public float getYR()
public float getYW()
public float getZB()
public float getZG()
public float getZR()
public float getZW()
public float redoGammaCorrection(float value)
value
.
Returns value
with Gamma Correction.
redoGammaCorrection
in class ColorSpace
value
- a float
valuevalue
with Gamma Correctionpublic float undoGammaCorrection(float value)
value
.
Returns value
without Gamma Correction.
undoGammaCorrection
in class ColorSpace
value
- a float
valuevalue
without Gamma Correctionpublic int convertRGBToLinear(int rGB)
rGB
from non-linear to linear representations.
Returns a linear representation of rGB
rGB
- the RGB-component values to convertrGB
public int convertRGBToNonLinear(int rGB)
rGB
from linear to non-linear representations.
Returns a non-linear representation of rGB
rGB
- the RGB-component values to convertrGB