Class DIBImageReader

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected DIBImageReader​(javax.imageio.spi.ImageReaderSpi provider)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static void addImage​(java.awt.Container parent, javax.imageio.ImageReader reader, int imageNo)  
      private static int adjustToPadding​(int width)  
      private static javax.swing.JFrame createWindow​(java.lang.String title)  
      private Directory getDirectory()  
      (package private) DirectoryEntry getEntry​(int imageIndex)  
      private DIBHeader getHeader​(DirectoryEntry entry)  
      int getHeight​(int imageIndex)  
      java.util.Iterator<javax.imageio.ImageTypeSpecifier> getImageTypes​(int imageIndex)  
      private java.util.Iterator<javax.imageio.ImageTypeSpecifier> getImageTypesPNG​(DirectoryEntry entry)  
      int getNumImages​(boolean allowSearch)
      Default implementation that always returns 1.
      private javax.imageio.ImageReader getPNGReader()  
      int getWidth​(int imageIndex)  
      private javax.imageio.ImageReader initPNGReader​(DirectoryEntry entry)  
      private boolean isPNG​(DirectoryEntry entry)  
      static void main​(java.lang.String[] args)  
      java.awt.image.BufferedImage read​(int imageIndex, javax.imageio.ImageReadParam param)  
      private java.awt.image.BufferedImage readBitmap​(DirectoryEntry entry)  
      private void readBitmap16​(BitmapDescriptor bitmap)  
      private void readBitmap24​(BitmapDescriptor bitmap)  
      private void readBitmap32​(BitmapDescriptor bitmap)  
      private void readBitmapIndexed​(BitmapIndexed bitmap)  
      private void readBitmapIndexed1​(BitmapIndexed bitmap, boolean asMask)  
      private void readBitmapIndexed4​(BitmapIndexed bitmap)  
      private void readBitmapIndexed8​(BitmapIndexed bitmap)  
      private void readColorMap​(BitmapIndexed bitmap)  
      private void readFileHeader()  
      private static void readImagesInFile​(java.lang.String fileName, javax.imageio.ImageReader reader, java.awt.Container container)  
      private java.awt.image.BufferedImage readPNG​(DirectoryEntry entry, javax.imageio.ImageReadParam param)  
      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, getRawImageType, 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
    • Constructor Detail

      • DIBImageReader

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

      • 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
      • 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
      • 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
      • isPNG

        private boolean isPNG​(DirectoryEntry entry)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • readPNG

        private java.awt.image.BufferedImage readPNG​(DirectoryEntry entry,
                                                     javax.imageio.ImageReadParam param)
                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • getImageTypesPNG

        private java.util.Iterator<javax.imageio.ImageTypeSpecifier> getImageTypesPNG​(DirectoryEntry entry)
                                                                               throws java.io.IOException
        Throws:
        java.io.IOException
      • initPNGReader

        private javax.imageio.ImageReader initPNGReader​(DirectoryEntry entry)
                                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • getPNGReader

        private javax.imageio.ImageReader getPNGReader()
                                                throws javax.imageio.IIOException
        Throws:
        javax.imageio.IIOException
      • getHeader

        private DIBHeader getHeader​(DirectoryEntry entry)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • readBitmap

        private java.awt.image.BufferedImage readBitmap​(DirectoryEntry entry)
                                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • readBitmapIndexed

        private void readBitmapIndexed​(BitmapIndexed bitmap)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • readColorMap

        private void readColorMap​(BitmapIndexed bitmap)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • readBitmapIndexed1

        private void readBitmapIndexed1​(BitmapIndexed bitmap,
                                        boolean asMask)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • readBitmapIndexed4

        private void readBitmapIndexed4​(BitmapIndexed bitmap)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • readBitmapIndexed8

        private void readBitmapIndexed8​(BitmapIndexed bitmap)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • adjustToPadding

        private static int adjustToPadding​(int width)
        Parameters:
        width - Bytes per scan line (i.e., 1BPP, width = 9 -> bytes = 2)
        Returns:
        padded width
      • readBitmap16

        private void readBitmap16​(BitmapDescriptor bitmap)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • readBitmap24

        private void readBitmap24​(BitmapDescriptor bitmap)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • readBitmap32

        private void readBitmap32​(BitmapDescriptor bitmap)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • getDirectory

        private Directory getDirectory()
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • readFileHeader

        private void readFileHeader()
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • getEntry

        final DirectoryEntry getEntry​(int imageIndex)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • main

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

        private static void readImagesInFile​(java.lang.String fileName,
                                             javax.imageio.ImageReader reader,
                                             java.awt.Container container)
                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • createWindow

        private static javax.swing.JFrame createWindow​(java.lang.String title)
      • addImage

        private static void addImage​(java.awt.Container parent,
                                     javax.imageio.ImageReader reader,
                                     int imageNo)
                              throws java.io.IOException
        Throws:
        java.io.IOException