Package com.itextpdf.io.colors
Class IccProfile
java.lang.Object
com.itextpdf.io.colors.IccProfile
Class used to represented the International Color Consortium profile
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getData()
Get the icc color profile data.static String
getIccColorSpaceName
(byte[] data) Get the Color space name of the icc profile found in the data.static String
getIccDeviceClass
(byte[] data) Get the device class of the icc profile found in the data.static Integer
getIccNumberOfComponents
(byte[] data) Get the number of color components of the icc profile found in the data.static IccProfile
getInstance
(byte[] data) Construct an icc profile from the passed byte[], using the passed number of components.static IccProfile
getInstance
(byte[] data, int numComponents) Construct an icc profile from the passed byte[], using the passed number of components.static IccProfile
Construct an icc profile from the passed random-access file or array.static IccProfile
getInstance
(InputStream stream) Construct an icc profile from the passed InputStream.static IccProfile
getInstance
(String filename) Construct an icc profile from the file found at the passed pathint
Get the number of color components in the profile.
-
Field Details
-
data
protected byte[] data -
numComponents
protected int numComponents
-
-
Constructor Details
-
IccProfile
protected IccProfile()
-
-
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
-