Class IccProfile


  • public class IccProfile
    extends java.lang.Object
    Class used to represented the International Color Consortium profile
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.Map<java.lang.String,​java.lang.Integer> cstags  
      protected byte[] data  
      protected int numComponents  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected IccProfile()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] getData()
      Get the icc color profile data.
      static java.lang.String getIccColorSpaceName​(byte[] data)
      Get the Color space name of the icc profile found in the data.
      static java.lang.String getIccDeviceClass​(byte[] data)
      Get the device class of the icc profile found in the data.
      static java.lang.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 getInstance​(RandomAccessFileOrArray file)
      Construct an icc profile from the passed random-access file or array.
      static IccProfile getInstance​(java.io.InputStream stream)
      Construct an icc profile from the passed InputStream.
      static IccProfile getInstance​(java.lang.String filename)
      Construct an icc profile from the file found at the passed path
      int getNumComponents()
      Get the number of color components in the profile.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • data

        protected byte[] data
      • numComponents

        protected int numComponents
      • cstags

        private static java.util.Map<java.lang.String,​java.lang.Integer> cstags
    • Constructor Detail

      • IccProfile

        protected IccProfile()
    • Method Detail

      • 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​(java.io.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​(java.lang.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 java.lang.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 java.lang.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 java.lang.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