Class ICNSImageReader

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List<IconResource> icons  
      private IconResource lastResourceRead  
      private int length  
      private java.util.List<IconResource> masks  
      • Fields inherited from class javax.imageio.ImageReader

        availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void addResource​(IconResource resource)  
      private static int[] createBandOffsets​(int bandLen)  
      private IconResource findMaskResource​(IconResource iconResource)  
      private java.lang.String getForeignFormat​(javax.imageio.stream.ImageInputStream stream)  
      int getHeight​(int imageIndex)  
      javax.imageio.metadata.IIOMetadata getImageMetadata​(int imageIndex)
      Default implementation that always returns null.
      java.util.Iterator<javax.imageio.ImageTypeSpecifier> getImageTypes​(int imageIndex)  
      int getNumImages​(boolean allowSearch)
      Default implementation that always returns 1.
      javax.imageio.ImageTypeSpecifier getRawImageType​(int imageIndex)  
      int getWidth​(int imageIndex)  
      static void main​(java.lang.String[] args)  
      java.awt.image.BufferedImage read​(int imageIndex, javax.imageio.ImageReadParam param)  
      private void readeFileHeader()  
      private java.awt.image.BufferedImage readForeignFormat​(int imageIndex, javax.imageio.ImageReadParam param, IconResource resource)  
      private java.awt.image.BufferedImage readICNSFormat​(int imageIndex, javax.imageio.ImageReadParam param, IconResource resource)  
      private IconResource readIconResource​(int imageIndex)  
      private java.awt.image.Raster readMask​(IconResource resource)  
      private IconResource readNextIconResource()  
      protected void resetMembers()
      Resets all member variables.
      • Methods inherited from class javax.imageio.ImageReader

        abort, abortRequested, addIIOReadProgressListener, addIIOReadUpdateListener, addIIOReadWarningListener, canReadRaster, checkReadParamBandSettings, clearAbortRequest, computeRegions, getAspectRatio, getAvailableLocales, getDefaultReadParam, getFormatName, getImageMetadata, getInput, getLocale, getMinIndex, getNumThumbnails, getOriginatingProvider, getSourceRegion, getStreamMetadata, getThumbnailHeight, getThumbnailWidth, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, hasThumbnails, isIgnoringMetadata, isImageTiled, isRandomAccessEasy, isSeekForwardOnly, processImageComplete, processImageProgress, processImageStarted, processImageUpdate, processPassComplete, processPassStarted, processReadAborted, processSequenceComplete, processSequenceStarted, processThumbnailComplete, processThumbnailPassComplete, processThumbnailPassStarted, processThumbnailProgress, processThumbnailStarted, processThumbnailUpdate, processWarningOccurred, processWarningOccurred, read, readAll, readAll, readAsRenderedImage, readerSupportsThumbnails, readRaster, readThumbnail, readTile, readTileRaster, removeAllIIOReadProgressListeners, removeAllIIOReadUpdateListeners, removeAllIIOReadWarningListeners, removeIIOReadProgressListener, removeIIOReadUpdateListener, removeIIOReadWarningListener, setInput, setInput, setLocale
      • Methods inherited from class java.lang.Object

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

      • length

        private int length
    • Constructor Detail

      • ICNSImageReader

        public ICNSImageReader()
      • ICNSImageReader

        ICNSImageReader​(javax.imageio.spi.ImageReaderSpi provider)
    • Method Detail

      • getWidth

        public int getWidth​(int imageIndex)
                     throws java.io.IOException
        Specified by:
        getWidth in class javax.imageio.ImageReader
        Throws:
        java.io.IOException
      • getHeight

        public int getHeight​(int imageIndex)
                      throws java.io.IOException
        Specified by:
        getHeight in class javax.imageio.ImageReader
        Throws:
        java.io.IOException
      • getRawImageType

        public javax.imageio.ImageTypeSpecifier getRawImageType​(int imageIndex)
                                                         throws java.io.IOException
        Overrides:
        getRawImageType in class javax.imageio.ImageReader
        Throws:
        java.io.IOException
      • createBandOffsets

        private static int[] createBandOffsets​(int bandLen)
      • getImageTypes

        public java.util.Iterator<javax.imageio.ImageTypeSpecifier> getImageTypes​(int imageIndex)
                                                                           throws java.io.IOException
        Specified by:
        getImageTypes in class javax.imageio.ImageReader
        Throws:
        java.io.IOException
      • getNumImages

        public int getNumImages​(boolean allowSearch)
                         throws java.io.IOException
        Description copied from class: ImageReaderBase
        Default implementation that always returns 1.
        Overrides:
        getNumImages in class ImageReaderBase
        Parameters:
        allowSearch - ignored, unless overridden
        Returns:
        1, unless overridden
        Throws:
        java.io.IOException - never, unless overridden
      • read

        public java.awt.image.BufferedImage read​(int imageIndex,
                                                 javax.imageio.ImageReadParam param)
                                          throws java.io.IOException
        Specified by:
        read in class javax.imageio.ImageReader
        Throws:
        java.io.IOException
      • readICNSFormat

        private java.awt.image.BufferedImage readICNSFormat​(int imageIndex,
                                                            javax.imageio.ImageReadParam param,
                                                            IconResource resource)
                                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • readMask

        private java.awt.image.Raster readMask​(IconResource resource)
                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • findMaskResource

        private IconResource findMaskResource​(IconResource iconResource)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • readForeignFormat

        private java.awt.image.BufferedImage readForeignFormat​(int imageIndex,
                                                               javax.imageio.ImageReadParam param,
                                                               IconResource resource)
                                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • getForeignFormat

        private java.lang.String getForeignFormat​(javax.imageio.stream.ImageInputStream stream)
                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • readIconResource

        private IconResource readIconResource​(int imageIndex)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • readNextIconResource

        private IconResource readNextIconResource()
                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • addResource

        private void addResource​(IconResource resource)
      • readeFileHeader

        private void readeFileHeader()
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • getImageMetadata

        public javax.imageio.metadata.IIOMetadata getImageMetadata​(int imageIndex)
                                                            throws java.io.IOException
        Description copied from class: ImageReaderBase
        Default implementation that always returns null.
        Overrides:
        getImageMetadata in class ImageReaderBase
        Parameters:
        imageIndex - ignored, unless overridden
        Returns:
        null, unless overridden
        Throws:
        java.io.IOException - never, unless overridden.
      • main

        public static void main​(java.lang.String[] args)
                         throws java.io.IOException
        Throws:
        java.io.IOException