Class IccProfile

java.lang.Object
com.itextpdf.io.colors.IccProfile

public class IccProfile extends Object
Class used to represented the International Color Consortium profile
  • Field Details

    • data

      protected byte[] data
    • numComponents

      protected int numComponents
  • Constructor Details

    • IccProfile

      protected IccProfile()
  • Method Details

    • getInstance

      public static IccProfile getInstance (byte[] data, int numComponents)
      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

      public static IccProfile getInstance (byte[] data)
      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

      public static IccProfile getInstance (RandomAccessFileOrArray file)
      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

      public static IccProfile getInstance (InputStream stream)
      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

      public static IccProfile getInstance (String filename)
      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

      public static String getIccColorSpaceName (byte[] data)
      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

      public static String getIccDeviceClass (byte[] data)
      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

      public static Integer getIccNumberOfComponents (byte[] data)
      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