Package com.itextpdf.io.colors
Class IccProfile
java.lang.Object
com.itextpdf.io.colors.IccProfile
Class used to represent the International Color Consortium profile
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getData()Get the icc color profile data.static StringgetIccColorSpaceName(byte[] data) Get the Color space name of the icc profile found in the data.static StringgetIccDeviceClass(byte[] data) Get the device class of the icc profile found in the data.static IntegergetIccNumberOfComponents(byte[] data) Get the number of color components of the icc profile found in the data.static IccProfilegetInstance(byte[] data) Construct an icc profile from the passed byte[], using the passed number of components.static IccProfilegetInstance(byte[] data, int numComponents) Construct an icc profile from the passed byte[], using the passed number of components.static IccProfileConstruct an icc profile from the passed random-access file or array.static IccProfilegetInstance(InputStream stream) Construct an icc profile from the passed InputStream.static IccProfilegetInstance(String filename) Construct an icc profile from the file found at the passed pathintGet the number of color components in the profile.
-
Field Details
-
data
protected byte[] data -
numComponents
protected int numComponents
-
-
Constructor Details
-
IccProfile
protected IccProfile()Creates a new, empty icc profile.
-
-
Method Details
-
getInstance
Construct an icc profile from the passed byte[], using the passed number of components.- Parameters:
-
data- byte[] containing the raw icc profile data -
numComponents- number of components the profile contains - Returns:
- IccProfile constructed from the data
- Throws:
-
IOException- when the specified number of components and the number of components in the created profile do not match.
-
getInstance
Construct an icc profile from the passed byte[], using the passed number of components.- Parameters:
-
data- byte[] containing the raw icc profile data - Returns:
- IccProfile constructed from the data
-
getInstance
Construct an icc profile from the passed random-access file or array.- Parameters:
-
file- random-access file or array containing the profile - Returns:
- IccProfile constructed from the data
- Throws:
-
IOException- if the source does not contain a valid icc profile
-
getInstance
Construct an icc profile from the passed InputStream.- Parameters:
-
stream- inputstream containing the profile - Returns:
- IccProfile constructed from the data
- Throws:
-
IOException- if the source does not contain a valid icc profile
-
getInstance
Construct an icc profile from the file found at the passed path- Parameters:
-
filename- path to the file contaning the profile - Returns:
- IccProfile constructed from the data
- Throws:
-
IOException- if the source does not contain a valid icc profile
-
getIccColorSpaceName
Get the Color space name of the icc profile found in the data.- Parameters:
-
data- byte[] containing the icc profile - Returns:
- String containing the color space of the profile
- Throws:
-
IOException- if the source does not contain a valid icc profile
-
getIccDeviceClass
Get the device class of the icc profile found in the data.- Parameters:
-
data- byte[] containing the icc profile - Returns:
- String containing the device class of the profile
- Throws:
-
IOException- if the source does not contain a valid icc profile
-
getIccNumberOfComponents
Get the number of color components of the icc profile found in the data.- Parameters:
-
data- byte[] containing the icc profile - Returns:
- Number of color components
-
getData
public byte[] getData()Get the icc color profile data.- Returns:
- byte[] containing the data
-
getNumComponents
public int getNumComponents()Get the number of color components in the profile.- Returns:
- number of components
-