java.awt.color
Class ICC_Profile
public
class
ICC_Profile
extends Object
implements Serializable
ICC Profile - represents an ICC Color profile.
The ICC profile format is a standard file format which maps the transform
from a device color space to a standard Profile Color Space (PCS), which
can either be CIE L*a*b or CIE XYZ.
(With the exception of device link profiles which map from one device space
to another)
ICC profiles calibrated to specific input/output devices are used when color
fidelity is of importance.
An instance of ICC_Profile can be created using the getInstance() methods,
either using one of the predefined color spaces enumerated in ColorSpace,
or from an ICC profile file, or from an input stream.
An ICC_ColorSpace object can then be created to transform color values
through the profile.
The ICC_Profile class implements the version 2 format specified by
International Color Consortium Specification ICC.1:1998-09,
and its addendum ICC.1A:1999-04, April 1999
(available at www.color.org)
Since: 1.2
Method Summary |
protected void | finalize()
Free up the used memory. |
int | getColorSpaceType()
Returns the color space of this profile, in terms
of the color space constants defined in ColorSpace.
|
byte[] | getData()
Returns the data corresponding to this ICC_Profile as a byte array.
|
byte[] | getData(int tagSignature)
Returns the ICC profile tag data
The non ICC-tag icSigHead is also permitted to request the header data.
|
static ICC_Profile | getInstance(byte[] data)
Returns an ICC_Profile instance from a byte array of profile data.
|
static ICC_Profile | getInstance(int cspace)
Returns an predefined ICC_Profile instance.
|
static ICC_Profile | getInstance(String filename)
Returns an ICC_Profile instance from an ICC Profile file.
|
static ICC_Profile | getInstance(InputStream in)
Returns an ICC_Profile instance from an InputStream.
|
int | getMajorVersion()
Returns the major version number |
int | getMinorVersion()
Returns the minor version number.
|
int | getNumComponents()
Get the number of components in the profile's device color space. |
int | getPCSType()
Returns the color space of this profile's Profile Connection Space (OCS)
In terms of the color space constants defined in ColorSpace.
|
int | getProfileClass()
Returns the device class of this profile,
(E.g. |
protected Object | readResolve()
After deserializing we must determine if the class we want
is really one of the more specialized ICC_ProfileRGB or
ICC_ProfileGray classes. |
void | setData(int tagSignature, byte[] data)
Sets the ICC profile tag data.
|
void | write(String filename)
Writes the profile data to an ICC profile file. |
void | write(OutputStream out)
Writes the profile data in ICC profile file-format to a stream.
|
public static final int CLASS_ABSTRACT
public static final int CLASS_COLORSPACECONVERSION
public static final int CLASS_DEVICELINK
public static final int CLASS_DISPLAY
public static final int CLASS_INPUT
ICC Profile classes
public static final int CLASS_NAMEDCOLOR
public static final int CLASS_OUTPUT
public static final int icAbsoluteColorimetric
public static final int icCurveCount
public static final int icCurveData
public static final int icHdrAttributes
public static final int icHdrCmmId
public static final int icHdrColorSpace
public static final int icHdrCreator
public static final int icHdrDate
public static final int icHdrDeviceClass
public static final int icHdrFlags
public static final int icHdrIlluminant
public static final int icHdrMagic
public static final int icHdrManufacturer
public static final int icHdrModel
public static final int icHdrPcs
public static final int icHdrPlatform
public static final int icHdrRenderingIntent
public static final int icHdrSize
Header offsets
public static final int icHdrVersion
public static final int icPerceptual
Rendering intents
public static final int icRelativeColorimetric
public static final int icSaturation
public static final int icSigAbstractClass
public static final int icSigAToB0Tag
Tag signatures
public static final int icSigAToB1Tag
public static final int icSigAToB2Tag
public static final int icSigBlueColorantTag
public static final int icSigBlueTRCTag
public static final int icSigBToA0Tag
public static final int icSigBToA1Tag
public static final int icSigBToA2Tag
public static final int icSigCalibrationDateTimeTag
public static final int icSigCharTargetTag
public static final int icSigChromaticityTag
public static final int icSigCmyData
public static final int icSigCmykData
public static final int icSigColorSpaceClass
public static final int icSigCopyrightTag
public static final int icSigCrdInfoTag
public static final int icSigDeviceMfgDescTag
public static final int icSigDeviceModelDescTag
public static final int icSigDeviceSettingsTag
public static final int icSigDisplayClass
public static final int icSigGamutTag
public static final int icSigGrayData
public static final int icSigGrayTRCTag
public static final int icSigGreenColorantTag
public static final int icSigGreenTRCTag
public static final int icSigHead
Non-ICC tag 'head' for use in retrieving the header with getData()
public static final int icSigHlsData
public static final int icSigHsvData
public static final int icSigInputClass
ICC Profile class signatures
public static final int icSigLabData
public static final int icSigLinkClass
public static final int icSigLuminanceTag
public static final int icSigLuvData
public static final int icSigMeasurementTag
public static final int icSigMediaBlackPointTag
public static final int icSigMediaWhitePointTag
public static final int icSigNamedColor2Tag
public static final int icSigNamedColorClass
public static final int icSigOutputClass
public static final int icSigOutputResponseTag
public static final int icSigPreview0Tag
public static final int icSigPreview1Tag
public static final int icSigPreview2Tag
public static final int icSigProfileDescriptionTag
public static final int icSigProfileSequenceDescTag
public static final int icSigPs2CRD0Tag
public static final int icSigPs2CRD1Tag
public static final int icSigPs2CRD2Tag
public static final int icSigPs2CRD3Tag
public static final int icSigPs2CSATag
public static final int icSigPs2RenderingIntentTag
public static final int icSigRedColorantTag
public static final int icSigRedTRCTag
public static final int icSigRgbData
public static final int icSigScreeningDescTag
public static final int icSigScreeningTag
public static final int icSigSpace2CLR
public static final int icSigSpace3CLR
public static final int icSigSpace4CLR
public static final int icSigSpace5CLR
public static final int icSigSpace6CLR
public static final int icSigSpace7CLR
public static final int icSigSpace8CLR
public static final int icSigSpace9CLR
public static final int icSigSpaceACLR
public static final int icSigSpaceBCLR
public static final int icSigSpaceCCLR
public static final int icSigSpaceDCLR
public static final int icSigSpaceECLR
public static final int icSigSpaceFCLR
public static final int icSigTechnologyTag
public static final int icSigUcrBgTag
public static final int icSigViewingCondDescTag
public static final int icSigViewingConditionsTag
public static final int icSigXYZData
Color space signatures
public static final int icSigYCbCrData
public static final int icSigYxyData
public static final int icTagReserved
public static final int icTagType
public static final int icXYZNumberX
protected void finalize()
Free up the used memory.
public int getColorSpaceType()
Returns the color space of this profile, in terms
of the color space constants defined in ColorSpace.
(For example, it may be a ColorSpace.TYPE_RGB)
public byte[] getData()
Returns the data corresponding to this ICC_Profile as a byte array.
Returns: The data in a byte array,
where the first element corresponds to first byte of the profile file.
public byte[] getData(int tagSignature)
Returns the ICC profile tag data
The non ICC-tag icSigHead is also permitted to request the header data.
Parameters: tagSignature The ICC signature of the requested tag
Returns: A byte array containing the tag data
Returns an ICC_Profile instance from a byte array of profile data.
An instance of the specialized classes ICC_ProfileRGB or ICC_ProfileGray
may be returned if appropriate.
Parameters: data - the profile data
Returns: An ICC_Profile object
Throws: IllegalArgumentException if the profile data is an invalid
v2 profile.
Returns an predefined ICC_Profile instance.
This will construct an ICC_Profile instance from one of the predefined
color spaces in the ColorSpace class. (e.g. CS_sRGB, CS_GRAY, etc)
An instance of the specialized classes ICC_ProfileRGB or ICC_ProfileGray
may be returned if appropriate.
Returns: An ICC_Profile object
Returns an ICC_Profile instance from an ICC Profile file.
An instance of the specialized classes ICC_ProfileRGB or ICC_ProfileGray
may be returned if appropriate.
Parameters: filename - the file name of the profile file.
Returns: An ICC_Profile object
Throws: IllegalArgumentException if the profile data is an invalid
v2 profile. IOException if the file could not be read.
Returns an ICC_Profile instance from an InputStream.
This method can be used for reading ICC profiles embedded in files
which support this. (JPEG and SVG for instance).
The stream is treated in the following way: The profile header
(128 bytes) is read first, and the header is validated. If the profile
header is valid, it will then attempt to read the rest of the profile
from the stream. The stream is not closed after reading.
An instance of the specialized classes ICC_ProfileRGB or ICC_ProfileGray
may be returned if appropriate.
Parameters: in - the input stream to read the profile from.
Returns: An ICC_Profile object
Throws: IllegalArgumentException if the profile data is an invalid
v2 profile. IOException if the stream could not be read.
public int getMajorVersion()
Returns the major version number
public int getMinorVersion()
Returns the minor version number.
Only the least-significant byte contains data, in BCD form:
the least-significant nibble is the BCD bug fix revision,
the most-significant nibble is the BCD minor revision number.
(E.g. For a v2.1.0 profile this will return 0x10
)
public int getNumComponents()
Get the number of components in the profile's device color space.
public int getPCSType()
Returns the color space of this profile's Profile Connection Space (OCS)
In terms of the color space constants defined in ColorSpace.
This may be TYPE_XYZ or TYPE_Lab
public int getProfileClass()
Returns the device class of this profile,
(E.g. CLASS_INPUT for a scanner profile,
CLASS_OUTPUT for a printer)
protected
Object readResolve()
After deserializing we must determine if the class we want
is really one of the more specialized ICC_ProfileRGB or
ICC_ProfileGray classes.
public void setData(int tagSignature, byte[] data)
Sets the ICC profile tag data.
Note that an ICC profile can only contain one tag of each type, if
a tag already exists with the given signature, it is replaced.
Parameters: tagSignature - The signature of the tag to set data - A byte array containing the tag data
public void write(
String filename)
Writes the profile data to an ICC profile file.
Parameters: filename - The name of the file to write
Throws: IOException if the write failed.
Writes the profile data in ICC profile file-format to a stream.
This is useful for embedding ICC profiles in file formats which
support this (such as JPEG and SVG).
The stream is not closed after writing.
Parameters: out - The outputstream to which the profile data should be written
Throws: IOException if the write failed.