ColorSpace.Rgb
public
static
class
ColorSpace.Rgb
extends ColorSpace
java.lang.Object  
↳  android.graphics.ColorSpace  
↳  android.graphics.ColorSpace.Rgb 
An RGB color space is an additive color space using the
RGB
color model (a color is therefore represented
by a tuple of 3 numbers).
A specific RGB color space is defined by the following properties:
 Three chromaticities of the red, green and blue primaries, which define the gamut of the color space.
 A white point chromaticity that defines the stimulus to which color space values are normalized (also just called "white").
 An optoelectronic transfer function, also called optoelectronic conversion function or often, and approximately, gamma function.
 An electrooptical transfer function, also called electooptical conversion function or often, and approximately, gamma function.
 A range of valid RGB values (most commonly \([0..1]\)).
The most commonly used RGB color space is sRGB
.
Primaries and white point chromaticities
In this implementation, the chromaticity of the primaries and the white point of an RGB color space is defined in the CIE xyY color space. This color space separates the chromaticity of a color, the x and y components, and its luminance, the Y component. Since the primaries and the white point have full brightness, the Y component is assumed to be 1 and only the x and y components are needed to encode them.
For convenience, this implementation also allows to define the primaries and white point in the CIE XYZ space. The tristimulus XYZ values are internally converted to xyY.
Transfer functions
A transfer function is a color component conversion function, defined as a single variable, monotonic mathematical function. It is applied to each individual component of a color. They are used to perform the mapping between linear tristimulus values and nonlinear electronic signal value.
The optoelectronic transfer function (OETF or OECF) encodes tristimulus values in a scene to a nonlinear electronic signal value. An OETF is often expressed as a power function with an exponent between 0.38 and 0.55 (the reciprocal of 1.8 to 2.6).
The electrooptical transfer function (EOTF or EOCF) decodes a nonlinear electronic signal value to a tristimulus value at the display. An EOTF is often expressed as a power function with an exponent between 1.8 and 2.6.
Transfer functions are used as a compression scheme. For instance,
linear sRGB values would normally require 11 to 12 bits of precision to
store all values that can be perceived by the human eye. When encoding
sRGB values using the appropriate OETF (see sRGB
for
an exact mathematical description of that OETF), the values can be
compressed to only 8 bits precision.
When manipulating RGB values, particularly sRGB values, it is safe to assume that these values have been encoded with the appropriate OETF (unless noted otherwise). Encoded values are often said to be in "gamma space". They are therefore defined in a nonlinear space. This in turns means that any linear operation applied to these values is going to yield mathematically incorrect results (any linear interpolation such as gradient generation for instance, most image processing functions such as blurs, etc.).
To properly process encoded RGB values you must first apply the EOTF to decode the value into linear space. After processing, the RGB value must be encoded back to nonlinear ("gamma") space. Here is a formal description of the process, where \(f\) is the processing function to apply:
$$RGB_{out} = OETF(f(EOTF(RGB_{in})))$$If the transfer functions of the color space can be expressed as an
ICC parametric curve as defined in ICC.1:200410, the numeric parameters
can be retrieved by calling getTransferParameters()
. This can
be useful to match color spaces for instance.
Some RGB color spaces, such as ACES
and
scRGB
, are said to be linear because
their transfer functions are the identity function: \(f(x) = x\).
If the source and/or destination are known to be linear, it is not
necessary to invoke the transfer functions.
Range
Most RGB color spaces allow RGB values in the range \([0..1]\). There
are however a few RGB color spaces that allow much larger ranges. For
instance, scRGB
is used to manipulate the
range \([0.5..7.5]\) while ACES
can be used throughout
the range \([65504, 65504]\).
Converting between RGB color spaces
Conversion between two color spaces is achieved by using an intermediate color space called the profile connection space (PCS). The PCS used by this implementation is CIE XYZ. The conversion operation is defined as such:
$$RGB_{out} = OETF(T_{dst}^{1} \cdot T_{src} \cdot EOTF(RGB_{in}))$$Where \(T_{src}\) is the RGB to XYZ transform
of the source color space and \(T_{dst}^{1}\) the XYZ to RGB transform
of the destination color space.
Many RGB color spaces commonly used with electronic devices use the
standard illuminant D65
. Care must be take however
when converting between two RGB color spaces if their white points do not
match. This can be achieved by either calling
adapt(ColorSpace, float[])
to adapt one or both color spaces to
a single common white point. This can be achieved automatically by calling
connect(ColorSpace, ColorSpace)
, which also handles
nonRGB color spaces.
To learn more about the white point adaptation process, refer to the
documentation of ColorSpace.Adaptation
.
This method is safe to call from any thread.
Summary
Nested classes  

class 
ColorSpace.Rgb.TransferParameters
Defines the parameters for the ICC parametric curve type 4, as defined in ICC.1:200410, section 10.15. 
Inherited constants 

Inherited fields 

Public constructors  

ColorSpace.Rgb(String name, float[] toXYZ, DoubleUnaryOperator oetf, DoubleUnaryOperator eotf)
Creates a new RGB color space using a 3x3 columnmajor transform matrix. 

ColorSpace.Rgb(String name, float[] primaries, float[] whitePoint, DoubleUnaryOperator oetf, DoubleUnaryOperator eotf, float min, float max)
Creates a new RGB color space using a specified set of primaries and a specified white point. 

ColorSpace.Rgb(String name, float[] toXYZ, ColorSpace.Rgb.TransferParameters function)
Creates a new RGB color space using a 3x3 columnmajor transform matrix. 

ColorSpace.Rgb(String name, float[] primaries, float[] whitePoint, ColorSpace.Rgb.TransferParameters function)
Creates a new RGB color space using a specified set of primaries and a specified white point. 

ColorSpace.Rgb(String name, float[] toXYZ, double gamma)
Creates a new RGB color space using a 3x3 columnmajor transform matrix. 

ColorSpace.Rgb(String name, float[] primaries, float[] whitePoint, double gamma)
Creates a new RGB color space using a specified set of primaries and a specified white point. 
Public methods  

boolean

equals(Object o)
Indicates whether some other object is "equal to" this one. 
float[]

fromLinear(float[] v)
Encodes an RGB value from linear space to this color space's "gamma space". 
float[]

fromLinear(float r, float g, float b)
Encodes an RGB value from linear space to this color space's "gamma space". 
float[]

fromXyz(float[] v)
Converts tristimulus values from the CIE XYZ space to this color space's color model. 
DoubleUnaryOperator

getEotf()
Returns the electrooptical transfer function (EOTF) of this color space. 
float[]

getInverseTransform(float[] inverseTransform)
Copies the inverse transform of this color space in specified array. 
float[]

getInverseTransform()
Returns the inverse transform of this color space as a new array. 
float

getMaxValue(int component)
Returns the maximum valid value for the specified component of this color space's color model. 
float

getMinValue(int component)
Returns the minimum valid value for the specified component of this color space's color model. 
DoubleUnaryOperator

getOetf()
Returns the optoelectronic transfer function (OETF) of this color space. 
float[]

getPrimaries(float[] primaries)
Copies the primaries of this color space in specified array. 
float[]

getPrimaries()
Returns the primaries of this color space as a new array of 6 floats. 
ColorSpace.Rgb.TransferParameters

getTransferParameters()
Returns the parameters used by the 
float[]

getTransform()
Returns the transform of this color space as a new array. 
float[]

getTransform(float[] transform)
Copies the transform of this color space in specified array. 
float[]

getWhitePoint()
Returns the nonadapted CIE xyY white point of this color space as a new array of 2 floats. 
float[]

getWhitePoint(float[] whitePoint)
Copies the nonadapted CIE xyY white point of this color space in specified array. 
int

hashCode()
Returns a hash code value for the object. 
boolean

isSrgb()
Indicates whether this color space is the sRGB color space or equivalent to the sRGB color space. 
boolean

isWideGamut()
Returns whether this color space is a widegamut color space. 
float[]

toLinear(float[] v)
Decodes an RGB value to linear space. 
float[]

toLinear(float r, float g, float b)
Decodes an RGB value to linear space. 
float[]

toXyz(float[] v)
Converts a color value from this color space's model to tristimulus CIE XYZ values. 
Inherited methods  

Public constructors
ColorSpace.Rgb
ColorSpace.Rgb (String name, float[] toXYZ, DoubleUnaryOperator oetf, DoubleUnaryOperator eotf)
Creates a new RGB color space using a 3x3 columnmajor transform matrix. The transform matrix must convert from the RGB space to the profile connection space CIE XYZ.
The range of the color space is imposed to be \([0..1]\).
Parameters  

name 
String : Name of the color space, cannot be null, its length must be >= 1 
toXYZ 
float : 3x3 columnmajor transform matrix from RGB to the profile
connection space CIE XYZ as an array of 9 floats, cannot be null 
oetf 
DoubleUnaryOperator : Optoelectronic transfer function, cannot be null 
eotf 
DoubleUnaryOperator : Electrooptical transfer function, cannot be null 
Throws  

IllegalArgumentException 
If any of the following conditions is met:

See also:
ColorSpace.Rgb
ColorSpace.Rgb (String name, float[] primaries, float[] whitePoint, DoubleUnaryOperator oetf, DoubleUnaryOperator eotf, float min, float max)
Creates a new RGB color space using a specified set of primaries and a specified white point.
The primaries and white point can be specified in the CIE xyY space or in CIE XYZ. The length of the arrays depends on the chosen space:
Space  Primaries length  White point length 

xyY  6  2 
XYZ  9  3 
When the primaries and/or white point are specified in xyY, the Y component does not need to be specified and is assumed to be 1.0. Only the xy components are required.
The ID, areturned by getId()
, of an object created by
this constructor is always MIN_ID
.
Parameters  

name 
String : Name of the color space, cannot be null, its length must be >= 1 
primaries 
float : RGB primaries as an array of 6 (xy) or 9 (XYZ) floatsThis value must never be 
whitePoint 
float : Reference white as an array of 2 (xy) or 3 (XYZ) floatsThis value must never be 
oetf 
DoubleUnaryOperator : Optoelectronic transfer function, cannot be null 
eotf 
DoubleUnaryOperator : Electrooptical transfer function, cannot be null 
min 
float : The minimum valid value in this color space's RGB range 
max 
float : The maximum valid value in this color space's RGB range 
Throws  

IllegalArgumentException 
If any of the following conditions is met:

See also:
ColorSpace.Rgb
ColorSpace.Rgb (String name, float[] toXYZ, ColorSpace.Rgb.TransferParameters function)
Creates a new RGB color space using a 3x3 columnmajor transform matrix. The transform matrix must convert from the RGB space to the profile connection space CIE XYZ.
The range of the color space is imposed to be \([0..1]\).
Parameters  

name 
String : Name of the color space, cannot be null, its length must be >= 1 
toXYZ 
float : 3x3 columnmajor transform matrix from RGB to the profile
connection space CIE XYZ as an array of 9 floats, cannot be null 
function 
ColorSpace.Rgb.TransferParameters : Parameters for the transfer functionsThis value must never be 
Throws  

IllegalArgumentException 
If any of the following conditions is met:

See also:
ColorSpace.Rgb
ColorSpace.Rgb (String name, float[] primaries, float[] whitePoint, ColorSpace.Rgb.TransferParameters function)
Creates a new RGB color space using a specified set of primaries and a specified white point.
The primaries and white point can be specified in the CIE xyY space or in CIE XYZ. The length of the arrays depends on the chosen space:
Space  Primaries length  White point length 

xyY  6  2 
XYZ  9  3 
When the primaries and/or white point are specified in xyY, the Y component does not need to be specified and is assumed to be 1.0. Only the xy components are required.
Parameters  

name 
String : Name of the color space, cannot be null, its length must be >= 1 
primaries 
float : RGB primaries as an array of 6 (xy) or 9 (XYZ) floatsThis value must never be 
whitePoint 
float : Reference white as an array of 2 (xy) or 3 (XYZ) floatsThis value must never be 
function 
ColorSpace.Rgb.TransferParameters : Parameters for the transfer functionsThis value must never be 
Throws  

IllegalArgumentException 
If any of the following conditions is met:

See also:
ColorSpace.Rgb
ColorSpace.Rgb (String name, float[] toXYZ, double gamma)
Creates a new RGB color space using a 3x3 columnmajor transform matrix. The transform matrix must convert from the RGB space to the profile connection space CIE XYZ.
The range of the color space is imposed to be \([0..1]\).
Parameters  

name 
String : Name of the color space, cannot be null, its length must be >= 1 
toXYZ 
float : 3x3 columnmajor transform matrix from RGB to the profile
connection space CIE XYZ as an array of 9 floats, cannot be null 
gamma 
double : Gamma to use as the transfer function 
Throws  

IllegalArgumentException 
If any of the following conditions is met:

See also:
ColorSpace.Rgb
ColorSpace.Rgb (String name, float[] primaries, float[] whitePoint, double gamma)
Creates a new RGB color space using a specified set of primaries and a specified white point.
The primaries and white point can be specified in the CIE xyY space or in CIE XYZ. The length of the arrays depends on the chosen space:
Space  Primaries length  White point length 

xyY  6  2 
XYZ  9  3 
When the primaries and/or white point are specified in xyY, the Y component does not need to be specified and is assumed to be 1.0. Only the xy components are required.
Parameters  

name 
String : Name of the color space, cannot be null, its length must be >= 1 
primaries 
float : RGB primaries as an array of 6 (xy) or 9 (XYZ) floatsThis value must never be 
whitePoint 
float : Reference white as an array of 2 (xy) or 3 (XYZ) floatsThis value must never be 
gamma 
double : Gamma to use as the transfer function 
Throws  

IllegalArgumentException 
If any of the following conditions is met:

See also:
Public methods
equals
boolean equals (Object o)
Indicates whether some other object is "equal to" this one.
The equals
method implements an equivalence relation
on nonnull object references:
 It is reflexive: for any nonnull reference value
x
,x.equals(x)
should returntrue
.  It is symmetric: for any nonnull reference values
x
andy
,x.equals(y)
should returntrue
if and only ify.equals(x)
returnstrue
.  It is transitive: for any nonnull reference values
x
,y
, andz
, ifx.equals(y)
returnstrue
andy.equals(z)
returnstrue
, thenx.equals(z)
should returntrue
.  It is consistent: for any nonnull reference values
x
andy
, multiple invocations ofx.equals(y)
consistently returntrue
or consistently returnfalse
, provided no information used inequals
comparisons on the objects is modified.  For any nonnull reference value
x
,x.equals(null)
should returnfalse
.
The equals
method for class Object
implements
the most discriminating possible equivalence relation on objects;
that is, for any nonnull reference values x
and
y
, this method returns true
if and only
if x
and y
refer to the same object
(x == y
has the value true
).
Note that it is generally necessary to override the hashCode
method whenever this method is overridden, so as to maintain the
general contract for the hashCode
method, which states
that equal objects must have equal hash codes.
Parameters  

o 
Object : the reference object with which to compare. 
Returns  

boolean 
true if this object is the same as the obj
argument; false otherwise. 
fromLinear
float[] fromLinear (float[] v)
Encodes an RGB value from linear space to this color space's "gamma space". This is achieved by applying this color space's optoelectronic transfer function to the first 3 values of the supplied array. The result is stored back in the input array.
Refer to the documentation of ColorSpace.Rgb
for
more information about transfer functions and their use for
encoding and decoding RGB values.
Parameters  

v 
float : A nonnull array of linear RGB values, its length
must be at least 3 
Returns  

float[] 
A new array of 3 floats containing nonlinear RGB values This value will never be 
fromLinear
float[] fromLinear (float r, float g, float b)
Encodes an RGB value from linear space to this color space's "gamma space". This is achieved by applying this color space's optoelectronic transfer function to the supplied values.
Refer to the documentation of ColorSpace.Rgb
for
more information about transfer functions and their use for
encoding and decoding RGB values.
Parameters  

r 
float : The red component to encode from linear space 
g 
float : The green component to encode from linear space 
b 
float : The blue component to encode from linear space 
Returns  

float[] 
A new array of 3 floats containing nonlinear RGB values This value will never be 
fromXyz
float[] fromXyz (float[] v)
Converts tristimulus values from the CIE XYZ space to this color space's color model. The resulting value is passed back in the specified array.
The specified array's length must be at least equal to
to the number of color components as returned by
getComponentCount()
, and its first 3 values must
be the XYZ components to convert from.
Parameters  

v 
float : An array of color components containing the XYZ values
to convert from, and large enough to hold the number
of components of this color space's modelThis value must never be 
Returns  

float[] 
The array passed in parameter This value will never be 
getEotf
DoubleUnaryOperator getEotf ()
Returns the electrooptical transfer function (EOTF) of this color space.
The inverse function is the optoelectronic transfer function (OETF)
returned by getOetf()
. These functions are defined to satisfy the
following equality for \(x \in [0..1]\):
For RGB colors, this function can be used to convert from "gamma space"
(gamma encoded) to linear space. The terms gamma space and gamma encoded
are frequently used because many EOTFs can be closely approximated using
a simple power function of the form \(x^\gamma\) (the approximation of the
sRGB
EOTF uses \(\gamma=2.2\) for instance).
Returns  

DoubleUnaryOperator 
A transfer function that converts from "gamma space" to linear space This value will never be 
See also:
getInverseTransform
float[] getInverseTransform (float[] inverseTransform)
Copies the inverse transform of this color space in specified array.
The inverse transform is used to convert from XYZ to RGB (with the
same white point as this color space). To connect color spaces, you
must first adapt
them
to the same white point.
It is recommended to use connect(ColorSpace, ColorSpace)
to convert between color spaces.
Parameters  

inverseTransform 
float : The destination array, cannot be null, its length
must be >= 9 
Returns  

float[] 
The destination array passed as a parameter This value will never be 
See also:
getInverseTransform
float[] getInverseTransform ()
Returns the inverse transform of this color space as a new array.
The inverse transform is used to convert from XYZ to RGB (with the
same white point as this color space). To connect color spaces, you
must first adapt
them
to the same white point.
It is recommended to use connect(ColorSpace, ColorSpace)
to convert between color spaces.
Returns  

float[] 
A new array of 9 floats This value will never be 
See also:
getMaxValue
float getMaxValue (int component)
Returns the maximum valid value for the specified component of this color space's color model.
Parameters  

component 
int : The index of the component 
Returns  

float 
A floating point value greater than getMinValue(int) 
getMinValue
float getMinValue (int component)
Returns the minimum valid value for the specified component of this color space's color model.
Parameters  

component 
int : The index of the component 
Returns  

float 
A floating point value less than getMaxValue(int) 
getOetf
DoubleUnaryOperator getOetf ()
Returns the optoelectronic transfer function (OETF) of this color space.
The inverse function is the electrooptical transfer function (EOTF) returned
by getEotf()
. These functions are defined to satisfy the following
equality for \(x \in [0..1]\):
For RGB colors, this function can be used to convert from linear space
to "gamma space" (gamma encoded). The terms gamma space and gamma encoded
are frequently used because many OETFs can be closely approximated using
a simple power function of the form \(x^{\frac{1}{\gamma}}\) (the
approximation of the sRGB
OETF uses \(\gamma=2.2\)
for instance).
Returns  

DoubleUnaryOperator 
A transfer function that converts from linear space to "gamma space" This value will never be 
See also:
getPrimaries
float[] getPrimaries (float[] primaries)
Copies the primaries of this color space in specified array. The Y component is assumed to be 1 and is therefore not copied into the destination. The x and y components of the first primary are written in the array at positions 0 and 1 respectively.
Parameters  

primaries 
float : The destination array, cannot be null, its length
must be >= 6 
Returns  

float[] 
The destination array passed as a parameter This value will never be 
See also:
getPrimaries
float[] getPrimaries ()
Returns the primaries of this color space as a new array of 6 floats. The Y component is assumed to be 1 and is therefore not copied into the destination. The x and y components of the first primary are written in the array at positions 0 and 1 respectively.
Returns  

float[] 
A new nonnull array of 2 floats 
See also:
getTransferParameters
ColorSpace.Rgb.TransferParameters getTransferParameters ()
Returns the parameters used by the electrooptical
and optoelectronic
transfer functions. If the transfer
functions do not match the ICC parametric curves defined in ICC.1:200410
(section 10.15), this method returns null.
See ColorSpace.Rgb.TransferParameters
for a full description of the transfer
functions.
Returns  

ColorSpace.Rgb.TransferParameters 
An instance of ColorSpace.Rgb.TransferParameters or null if this color
space's transfer functions do not match the equation defined in
ColorSpace.Rgb.TransferParameters

getTransform
float[] getTransform ()
Returns the transform of this color space as a new array. The
transform is used to convert from RGB to XYZ (with the same white
point as this color space). To connect color spaces, you must first
adapt
them to the
same white point.
It is recommended to use connect(ColorSpace, ColorSpace)
to convert between color spaces.
Returns  

float[] 
A new array of 9 floats This value will never be 
See also:
getTransform
float[] getTransform (float[] transform)
Copies the transform of this color space in specified array. The
transform is used to convert from RGB to XYZ (with the same white
point as this color space). To connect color spaces, you must first
adapt
them to the
same white point.
It is recommended to use connect(ColorSpace, ColorSpace)
to convert between color spaces.
Parameters  

transform 
float : The destination array, cannot be null, its length
must be >= 9 
Returns  

float[] 
The destination array passed as a parameter This value will never be 
See also:
getWhitePoint
float[] getWhitePoint ()
Returns the nonadapted CIE xyY white point of this color space as a new array of 2 floats. The Y component is assumed to be 1 and is therefore not copied into the destination. The x and y components are written in the array at positions 0 and 1 respectively.
Returns  

float[] 
A new nonnull array of 2 floats 
See also:
getWhitePoint
float[] getWhitePoint (float[] whitePoint)
Copies the nonadapted CIE xyY white point of this color space in specified array. The Y component is assumed to be 1 and is therefore not copied into the destination. The x and y components are written in the array at positions 0 and 1 respectively.
Parameters  

whitePoint 
float : The destination array, cannot be null, its length
must be >= 2 
Returns  

float[] 
The destination array passed as a parameter This value will never be 
See also:
hashCode
int hashCode ()
Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
HashMap
.
The general contract of hashCode
is:
 Whenever it is invoked on the same object more than once during
an execution of a Java application, the
hashCode
method must consistently return the same integer, provided no information used inequals
comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.  If two objects are equal according to the
equals(Object)
method, then calling thehashCode
method on each of the two objects must produce the same integer result.  It is not required that if two objects are unequal
according to the
equals(java.lang.Object)
method, then calling thehashCode
method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
As much as is reasonably practical, the hashCode method defined by
class Object
does return distinct integers for distinct
objects. (This is typically implemented by converting the internal
address of the object into an integer, but this implementation
technique is not required by the
Java™ programming language.)
Returns  

int 
a hash code value for this object. 
isSrgb
boolean isSrgb ()
Indicates whether this color space is the sRGB color space or equivalent to the sRGB color space.
A color space is considered sRGB if it meets all the following conditions:
 Its color model is
RGB
. 
Its primaries are within 1e3 of the true
sRGB
primaries. 
Its white point is withing 1e3 of the CIE standard
illuminant
D65
.  Its optoelectronic transfer function is not linear.
 Its electrooptical transfer function is not linear.
 Its range is \([0..1]\).
This method always returns true for SRGB
.
Returns  

boolean 
True if this color space is the sRGB color space (or a close approximation), false otherwise 
isWideGamut
boolean isWideGamut ()
Returns whether this color space is a widegamut color space.
An RGB color space is widegamut if its gamut entirely contains
the sRGB
gamut and if the area of its gamut is
90% of greater than the area of the NTSC
gamut.
Returns  

boolean 
True if this color space is a widegamut color space, false otherwise 
toLinear
float[] toLinear (float[] v)
Decodes an RGB value to linear space. This is achieved by applying this color space's electrooptical transfer function to the first 3 values of the supplied array. The result is stored back in the input array.
Refer to the documentation of ColorSpace.Rgb
for
more information about transfer functions and their use for
encoding and decoding RGB values.
Parameters  

v 
float : A nonnull array of nonlinear RGB values, its length
must be at least 3 
Returns  

float[] 
The specified array This value will never be 
toLinear
float[] toLinear (float r, float g, float b)
Decodes an RGB value to linear space. This is achieved by applying this color space's electrooptical transfer function to the supplied values.
Refer to the documentation of ColorSpace.Rgb
for
more information about transfer functions and their use for
encoding and decoding RGB values.
Parameters  

r 
float : The red component to decode to linear space 
g 
float : The green component to decode to linear space 
b 
float : The blue component to decode to linear space 
Returns  

float[] 
A new array of 3 floats containing linear RGB values This value will never be 
toXyz
float[] toXyz (float[] v)
Converts a color value from this color space's model to
tristimulus CIE XYZ values. If the color model of this color
space is not RGB
, it is assumed that the
target CIE XYZ space uses a D50
standard illuminant.
The specified array's length must be at least
equal to to the number of color components as returned by
getComponentCount()
.
Parameters  

v 
float : An array of color components containing the color space's
color value to convert to XYZ, and large enough to hold
the resulting tristimulus XYZ valuesThis value must never be 
Returns  

float[] 
The array passed in parameter This value will never be 