Returns an array of all of the color/alpha components in normalized
form, given a pixel in this
ColorModel
. The pixel
value is specified by an array of data elements of type transferType
passed in as an object reference. If pixel is not a primitive array
of type transferType, a
ClassCastException
is thrown.
An
ArrayIndexOutOfBoundsException
is thrown if
pixel
is not large enough to hold a pixel value for this
ColorModel
.
Normalized components are float values between a per component minimum
and maximum specified by the
ColorSpace
object for this
ColorModel
. If the
normComponents
array is
null
, a new array
will be allocated. The
normComponents
array
will be returned. Color/alpha components are stored in the
normComponents
array starting at
normOffset
(even if the array is allocated by this
method). An
ArrayIndexOutOfBoundsException
is thrown
if the
normComponents
array is not
null
and is not large enough to hold all the color and alpha components
(starting at
normOffset
).
Since
ColorModel
is an abstract class,
any instance is an instance of a subclass. The default implementation
of this method in this abstract class first retrieves color and alpha
components in the unnormalized form using
getComponents(Object, int[], int)
and then calls
getNormalizedComponents(int[], int, float[], int)
.
Subclasses which may
have instances which do not support the unnormalized form must
override this method.
Returns:
an array containing normalized color and alpha
components.
Parameters:
-
pixel - the specified pixel
-
normComponents - an array to receive the normalized components
-
normOffset - the offset into the
normComponents
array at which to start storing normalized components
Throws:
-
ClassCastException - if
pixel
is not a primitive
array of type transferType
-
ArrayIndexOutOfBoundsException - if
normComponents
is not large enough to hold all
color and alpha components starting at
normOffset
-
ArrayIndexOutOfBoundsException - if
pixel
is not large enough to hold a pixel
value for this
ColorModel
.
-
UnsupportedOperationException - if the
constructor of this
ColorModel
called the
super(bits)
constructor, but did not
override this method. See the constructor,
{@link #ColorModel(int)}.
-
UnsupportedOperationException - if this method is unable
to determine the number of bits per component
Since:
1.4