Class NamedColorProfileParser
- java.lang.Object
-
- org.apache.xmlgraphics.java2d.color.profile.NamedColorProfileParser
-
public class NamedColorProfileParser extends java.lang.ObjectThis class is a parser for ICC named color profiles. It uses Java'sICC_Profileclass for parsing the basic structure but adds functionality to parse certain profile tags.
-
-
Constructor Summary
Constructors Constructor Description NamedColorProfileParser()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.StringgetCopyright(java.awt.color.ICC_Profile profile)private java.lang.StringgetProfileDescription(java.awt.color.ICC_Profile profile)private RenderingIntentgetRenderingIntent(java.awt.color.ICC_Profile profile)static booleanisNamedColorProfile(java.awt.color.ICC_Profile profile)Indicates whether the profile is a named color profile.NamedColorProfileparseProfile(java.awt.color.ICC_Profile profile)Parses a named color profile (NCP).NamedColorProfileparseProfile(java.awt.color.ICC_Profile profile, java.lang.String profileName, java.lang.String profileURI)Parses a named color profile (NCP).private java.lang.StringreadAscii(java.io.DataInput in, int maxLength)private java.lang.StringreadMLUC(java.io.DataInput din)private NamedColorSpace[]readNamedColors(java.awt.color.ICC_Profile profile, java.lang.String profileName, java.lang.String profileURI)private java.lang.StringreadSimpleString(byte[] tag)private int[]readUInt16Array(java.io.DataInput din, int count)private java.lang.StringtoSignatureString(int sig)
-
-
-
Field Detail
-
MLUC
private static final int MLUC
- See Also:
- Constant Field Values
-
NCL2
private static final int NCL2
- See Also:
- Constant Field Values
-
-
Method Detail
-
isNamedColorProfile
public static boolean isNamedColorProfile(java.awt.color.ICC_Profile profile)
Indicates whether the profile is a named color profile.- Parameters:
profile- the color profile- Returns:
- true if the profile is a named color profile, false otherwise
-
parseProfile
public NamedColorProfile parseProfile(java.awt.color.ICC_Profile profile, java.lang.String profileName, java.lang.String profileURI) throws java.io.IOException
Parses a named color profile (NCP).- Parameters:
profile- the profile to analyzeprofileName- Optional profile name associated with this color profileprofileURI- Optional profile URI associated with this color profile- Returns:
- an object representing the parsed NCP
- Throws:
java.io.IOException- if an I/O error occurs
-
parseProfile
public NamedColorProfile parseProfile(java.awt.color.ICC_Profile profile) throws java.io.IOException
Parses a named color profile (NCP).- Parameters:
profile- the profile to analyze- Returns:
- an object representing the parsed NCP
- Throws:
java.io.IOException- if an I/O error occurs
-
getProfileDescription
private java.lang.String getProfileDescription(java.awt.color.ICC_Profile profile) throws java.io.IOException- Throws:
java.io.IOException
-
getCopyright
private java.lang.String getCopyright(java.awt.color.ICC_Profile profile) throws java.io.IOException- Throws:
java.io.IOException
-
getRenderingIntent
private RenderingIntent getRenderingIntent(java.awt.color.ICC_Profile profile) throws java.io.IOException
- Throws:
java.io.IOException
-
readNamedColors
private NamedColorSpace[] readNamedColors(java.awt.color.ICC_Profile profile, java.lang.String profileName, java.lang.String profileURI) throws java.io.IOException
- Throws:
java.io.IOException
-
readUInt16Array
private int[] readUInt16Array(java.io.DataInput din, int count) throws java.io.IOException- Throws:
java.io.IOException
-
readAscii
private java.lang.String readAscii(java.io.DataInput in, int maxLength) throws java.io.IOException- Throws:
java.io.IOException
-
readSimpleString
private java.lang.String readSimpleString(byte[] tag) throws java.io.IOException- Throws:
java.io.IOException
-
readMLUC
private java.lang.String readMLUC(java.io.DataInput din) throws java.io.IOException- Throws:
java.io.IOException
-
toSignatureString
private java.lang.String toSignatureString(int sig)
-
-