com.twelvemonkeys.imageio.plugins.jpeg
Class JPEGImageReader

java.lang.Object
  extended by javax.imageio.ImageReader
      extended by com.twelvemonkeys.imageio.ImageReaderBase
          extended by com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader

public class JPEGImageReader
extends ImageReaderBase

A JPEG ImageReader implementation based on the JRE JPEGImageReader, that adds support and properly handles cases where the JRE version throws exceptions.

Main features:

Thumbnail support: Metadata support:

Version:
$Id: JPEGImageReader.java,v 1.0 24.01.11 16.37 haraldk Exp$
Author:
Harald Kuhr, LUT-based YCbCR conversion by Werner Randelshofer, last modified by $Author: haraldk$

Field Summary
 
Fields inherited from class com.twelvemonkeys.imageio.ImageReaderBase
imageInput
 
Fields inherited from class javax.imageio.ImageReader
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales
 
Method Summary
 void abort()
           
 boolean canReadRaster()
           
 void dispose()
           
 String getFormatName()
           
 int getHeight(int imageIndex)
           
 IIOMetadata getImageMetadata(int imageIndex)
           
 Iterator<ImageTypeSpecifier> getImageTypes(int imageIndex)
           
 int getNumImages(boolean allowSearch)
           
 int getNumThumbnails(int imageIndex)
           
 ImageTypeSpecifier getRawImageType(int imageIndex)
           
 IIOMetadata getStreamMetadata()
           
 int getThumbnailHeight(int imageIndex, int thumbnailIndex)
           
 int getThumbnailWidth(int imageIndex, int thumbnailIndex)
           
 int getWidth(int imageIndex)
           
 boolean isRandomAccessEasy(int imageIndex)
           
static void main(String[] args)
           
protected  void processWarningOccurred(String warning)
           
 BufferedImage read(int imageIndex, ImageReadParam param)
           
 RenderedImage readAsRenderedImage(int imageIndex, ImageReadParam param)
           
 boolean readerSupportsThumbnails()
           
 Raster readRaster(int imageIndex, ImageReadParam param)
           
 BufferedImage readThumbnail(int imageIndex, int thumbnailIndex)
           
protected  void resetMembers()
           
 void setInput(Object input, boolean seekForwardOnly, boolean ignoreMetadata)
           
protected static void showIt(BufferedImage pImage, String pTitle)
           
 
Methods inherited from class com.twelvemonkeys.imageio.ImageReaderBase
assertInput, checkBounds, fakeAOI, fakeSubsampling, getDestination, hasExplicitDestination, reset
 
Methods inherited from class javax.imageio.ImageReader
abortRequested, addIIOReadProgressListener, addIIOReadUpdateListener, addIIOReadWarningListener, checkReadParamBandSettings, clearAbortRequest, computeRegions, getAspectRatio, getAvailableLocales, getDefaultReadParam, getImageMetadata, getInput, getLocale, getMinIndex, getOriginatingProvider, getSourceRegion, getStreamMetadata, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, hasThumbnails, isIgnoringMetadata, isImageTiled, isSeekForwardOnly, processImageComplete, processImageProgress, processImageStarted, processImageUpdate, processPassComplete, processPassStarted, processReadAborted, processSequenceComplete, processSequenceStarted, processThumbnailComplete, processThumbnailPassComplete, processThumbnailPassStarted, processThumbnailProgress, processThumbnailStarted, processThumbnailUpdate, processWarningOccurred, read, readAll, readAll, 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
 

Method Detail

resetMembers

protected void resetMembers()
Specified by:
resetMembers in class ImageReaderBase

dispose

public void dispose()
Overrides:
dispose in class ImageReaderBase

getFormatName

public String getFormatName()
                     throws IOException
Overrides:
getFormatName in class ImageReader
Throws:
IOException

getNumImages

public int getNumImages(boolean allowSearch)
                 throws IOException
Overrides:
getNumImages in class ImageReaderBase
Throws:
IOException

getWidth

public int getWidth(int imageIndex)
             throws IOException
Specified by:
getWidth in class ImageReader
Throws:
IOException

getHeight

public int getHeight(int imageIndex)
              throws IOException
Specified by:
getHeight in class ImageReader
Throws:
IOException

getImageTypes

public Iterator<ImageTypeSpecifier> getImageTypes(int imageIndex)
                                           throws IOException
Specified by:
getImageTypes in class ImageReader
Throws:
IOException

getRawImageType

public ImageTypeSpecifier getRawImageType(int imageIndex)
                                   throws IOException
Overrides:
getRawImageType in class ImageReader
Throws:
IOException

setInput

public void setInput(Object input,
                     boolean seekForwardOnly,
                     boolean ignoreMetadata)
Overrides:
setInput in class ImageReaderBase

isRandomAccessEasy

public boolean isRandomAccessEasy(int imageIndex)
                           throws IOException
Overrides:
isRandomAccessEasy in class ImageReader
Throws:
IOException

read

public BufferedImage read(int imageIndex,
                          ImageReadParam param)
                   throws IOException
Specified by:
read in class ImageReader
Throws:
IOException

canReadRaster

public boolean canReadRaster()
Overrides:
canReadRaster in class ImageReader

readRaster

public Raster readRaster(int imageIndex,
                         ImageReadParam param)
                  throws IOException
Overrides:
readRaster in class ImageReader
Throws:
IOException

readAsRenderedImage

public RenderedImage readAsRenderedImage(int imageIndex,
                                         ImageReadParam param)
                                  throws IOException
Overrides:
readAsRenderedImage in class ImageReader
Throws:
IOException

abort

public void abort()
Overrides:
abort in class ImageReader

readerSupportsThumbnails

public boolean readerSupportsThumbnails()
Overrides:
readerSupportsThumbnails in class ImageReader

getNumThumbnails

public int getNumThumbnails(int imageIndex)
                     throws IOException
Overrides:
getNumThumbnails in class ImageReader
Throws:
IOException

getThumbnailWidth

public int getThumbnailWidth(int imageIndex,
                             int thumbnailIndex)
                      throws IOException
Overrides:
getThumbnailWidth in class ImageReader
Throws:
IOException

getThumbnailHeight

public int getThumbnailHeight(int imageIndex,
                              int thumbnailIndex)
                       throws IOException
Overrides:
getThumbnailHeight in class ImageReader
Throws:
IOException

readThumbnail

public BufferedImage readThumbnail(int imageIndex,
                                   int thumbnailIndex)
                            throws IOException
Overrides:
readThumbnail in class ImageReader
Throws:
IOException

getImageMetadata

public IIOMetadata getImageMetadata(int imageIndex)
                             throws IOException
Overrides:
getImageMetadata in class ImageReaderBase
Throws:
IOException

getStreamMetadata

public IIOMetadata getStreamMetadata()
                              throws IOException
Overrides:
getStreamMetadata in class ImageReaderBase
Throws:
IOException

processWarningOccurred

protected void processWarningOccurred(String warning)
Overrides:
processWarningOccurred in class ImageReader

showIt

protected static void showIt(BufferedImage pImage,
                             String pTitle)

main

public static void main(String[] args)
                 throws IOException
Throws:
IOException


Copyright © 2015. All Rights Reserved.