org.apache.sanselan
Class ImageParser

java.lang.Object
  extended by org.apache.sanselan.common.BinaryFileFunctions
      extended by org.apache.sanselan.common.BinaryFileParser
          extended by org.apache.sanselan.ImageParser
All Implemented Interfaces:
BinaryConstants, SanselanConstants
Direct Known Subclasses:
BmpImageParser, GifImageParser, IcoImageParser, JpegImageParser, PngImageParser, PNMImageParser, PsdImageParser, TiffImageParser

public abstract class ImageParser
extends BinaryFileParser
implements SanselanConstants


Field Summary
 
Fields inherited from class org.apache.sanselan.common.BinaryFileFunctions
debug
 
Fields inherited from interface org.apache.sanselan.SanselanConstants
BUFFERED_IMAGE_FACTORY, PARAM_KEY_COMPRESSION, PARAM_KEY_FILENAME, PARAM_KEY_FORMAT, PARAM_KEY_READ_THUMBNAILS, PARAM_KEY_STRICT, PARAM_KEY_VERBOSE, PARAM_KEY_XMP_XML
 
Fields inherited from interface org.apache.sanselan.common.BinaryConstants
BYTE_ORDER_BIG_ENDIAN, BYTE_ORDER_INTEL, BYTE_ORDER_LEAST_SIGNIFICANT_BYTE, BYTE_ORDER_LITTLE_ENDIAN, BYTE_ORDER_LSB, BYTE_ORDER_MOST_SIGNIFICANT_BYTE, BYTE_ORDER_MOTOROLA, BYTE_ORDER_MSB, BYTE_ORDER_NETWORK
 
Constructor Summary
ImageParser()
           
 
Method Summary
protected  boolean canAcceptExtension(java.io.File file)
           
protected  boolean canAcceptExtension(java.lang.String filename)
           
 boolean canAcceptType(ImageFormat type)
           
 java.lang.String dumpImageFile(byte[] bytes)
           
 java.lang.String dumpImageFile(ByteSource byteSource)
           
 java.lang.String dumpImageFile(java.io.File file)
           
 boolean dumpImageFile(java.io.PrintWriter pw, ByteSource byteSource)
           
abstract  boolean embedICCProfile(java.io.File src, java.io.File dst, byte[] profile)
           
protected abstract  java.lang.String[] getAcceptedExtensions()
           
protected abstract  ImageFormat[] getAcceptedTypes()
           
 java.util.ArrayList getAllBufferedImages(byte[] bytes)
           
 java.util.ArrayList getAllBufferedImages(ByteSource byteSource)
           
 java.util.ArrayList getAllBufferedImages(java.io.File file)
           
static ImageParser[] getAllImageParsers()
           
 java.awt.image.BufferedImage getBufferedImage(byte[] bytes, java.util.Map params)
           
abstract  java.awt.image.BufferedImage getBufferedImage(ByteSource byteSource, java.util.Map params)
           
 java.awt.image.BufferedImage getBufferedImage(java.io.File file, java.util.Map params)
           
protected  IBufferedImageFactory getBufferedImageFactory(java.util.Map params)
           
abstract  java.lang.String getDefaultExtension()
           
 FormatCompliance getFormatCompliance(byte[] bytes)
           
 FormatCompliance getFormatCompliance(ByteSource byteSource)
           
 FormatCompliance getFormatCompliance(java.io.File file)
           
 byte[] getICCProfileBytes(byte[] bytes)
           
 byte[] getICCProfileBytes(byte[] bytes, java.util.Map params)
           
abstract  byte[] getICCProfileBytes(ByteSource byteSource, java.util.Map params)
           
 byte[] getICCProfileBytes(java.io.File file)
           
 byte[] getICCProfileBytes(java.io.File file, java.util.Map params)
           
 ImageInfo getImageInfo(byte[] bytes, java.util.Map params)
           
 ImageInfo getImageInfo(ByteSource byteSource)
           
abstract  ImageInfo getImageInfo(ByteSource byteSource, java.util.Map params)
           
 ImageInfo getImageInfo(java.io.File file, java.util.Map params)
           
 java.awt.Dimension getImageSize(byte[] bytes)
           
 java.awt.Dimension getImageSize(byte[] bytes, java.util.Map params)
           
abstract  java.awt.Dimension getImageSize(ByteSource byteSource, java.util.Map params)
           
 java.awt.Dimension getImageSize(java.io.File file)
           
 java.awt.Dimension getImageSize(java.io.File file, java.util.Map params)
           
 IImageMetadata getMetadata(byte[] bytes)
           
 IImageMetadata getMetadata(byte[] bytes, java.util.Map params)
           
 IImageMetadata getMetadata(ByteSource byteSource)
           
abstract  IImageMetadata getMetadata(ByteSource byteSource, java.util.Map params)
           
 IImageMetadata getMetadata(java.io.File file)
           
 IImageMetadata getMetadata(java.io.File file, java.util.Map params)
           
abstract  java.lang.String getName()
           
abstract  java.lang.String getXmpXml(ByteSource byteSource, java.util.Map params)
           
static boolean isStrict(java.util.Map params)
           
 void writeImage(java.awt.image.BufferedImage src, java.io.OutputStream os, java.util.Map params)
           
 
Methods inherited from class org.apache.sanselan.common.BinaryFileParser
byteArrayHasPrefix, convertByteArrayToInt, convertByteArrayToInt, convertByteArrayToShort, convertByteArrayToShort, getByteOrder, int2ToByteArray, read2Bytes, read3Bytes, read4Bytes, setByteOrder, setByteOrder
 
Methods inherited from class org.apache.sanselan.common.BinaryFileFunctions
CharsToQuad, compareByteArrays, compareByteArrays, compareBytes, compareBytes, convertByteArrayToDouble, convertByteArrayToDouble, convertByteArrayToDoubleArray, convertByteArrayToFloat, convertByteArrayToFloat, convertByteArrayToFloatArray, convertByteArrayToInt, convertByteArrayToInt, convertByteArrayToIntArray, convertByteArrayToRational, convertByteArrayToRational, convertByteArrayToRationalArray, convertByteArrayToShort, convertByteArrayToShort, convertByteArrayToShortArray, convertDoubleArrayToByteArray, convertDoubleToByteArray, convertFloatArrayToByteArray, convertFloatToByteArray, convertIntArrayToByteArray, convertIntArrayToRationalArray, convertRationalArrayToByteArray, convertRationalToByteArray, convertShortArrayToByteArray, convertShortToByteArray, copyStreamToStream, debugByteArray, debugNumber, debugNumber, debugNumber, debugNumber, debugNumberArray, findNull, findNull, getBytearrayHead, getByteArrayTail, getDebug, getRAFBytes, getStreamBytes, head, int2ToByteArray, printByteBits, printCharQuad, printCharQuad, read2Bytes, read3Bytes, read4Bytes, readAndVerifyBytes, readAndVerifyBytes, readByte, readBytearray, readByteArray, readByteArray, readBytes, readRandomBytes, scanForByte, setDebug, skipBytes, skipBytes, slice, startsWith, tail, writeIntInToByteArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageParser

public ImageParser()
Method Detail

getAllImageParsers

public static final ImageParser[] getAllImageParsers()

getMetadata

public final IImageMetadata getMetadata(ByteSource byteSource)
                                 throws ImageReadException,
                                        java.io.IOException
Throws:
ImageReadException
java.io.IOException

getMetadata

public abstract IImageMetadata getMetadata(ByteSource byteSource,
                                           java.util.Map params)
                                    throws ImageReadException,
                                           java.io.IOException
Throws:
ImageReadException
java.io.IOException

getMetadata

public final IImageMetadata getMetadata(byte[] bytes)
                                 throws ImageReadException,
                                        java.io.IOException
Throws:
ImageReadException
java.io.IOException

getMetadata

public final IImageMetadata getMetadata(byte[] bytes,
                                        java.util.Map params)
                                 throws ImageReadException,
                                        java.io.IOException
Throws:
ImageReadException
java.io.IOException

getMetadata

public final IImageMetadata getMetadata(java.io.File file)
                                 throws ImageReadException,
                                        java.io.IOException
Throws:
ImageReadException
java.io.IOException

getMetadata

public final IImageMetadata getMetadata(java.io.File file,
                                        java.util.Map params)
                                 throws ImageReadException,
                                        java.io.IOException
Throws:
ImageReadException
java.io.IOException

getImageInfo

public abstract ImageInfo getImageInfo(ByteSource byteSource,
                                       java.util.Map params)
                                throws ImageReadException,
                                       java.io.IOException
Throws:
ImageReadException
java.io.IOException

getImageInfo

public final ImageInfo getImageInfo(ByteSource byteSource)
                             throws ImageReadException,
                                    java.io.IOException
Throws:
ImageReadException
java.io.IOException

getImageInfo

public final ImageInfo getImageInfo(byte[] bytes,
                                    java.util.Map params)
                             throws ImageReadException,
                                    java.io.IOException
Throws:
ImageReadException
java.io.IOException

getImageInfo

public final ImageInfo getImageInfo(java.io.File file,
                                    java.util.Map params)
                             throws ImageReadException,
                                    java.io.IOException
Throws:
ImageReadException
java.io.IOException

getFormatCompliance

public FormatCompliance getFormatCompliance(ByteSource byteSource)
                                     throws ImageReadException,
                                            java.io.IOException
Throws:
ImageReadException
java.io.IOException

getFormatCompliance

public final FormatCompliance getFormatCompliance(byte[] bytes)
                                           throws ImageReadException,
                                                  java.io.IOException
Throws:
ImageReadException
java.io.IOException

getFormatCompliance

public final FormatCompliance getFormatCompliance(java.io.File file)
                                           throws ImageReadException,
                                                  java.io.IOException
Throws:
ImageReadException
java.io.IOException

getAllBufferedImages

public java.util.ArrayList getAllBufferedImages(ByteSource byteSource)
                                         throws ImageReadException,
                                                java.io.IOException
Throws:
ImageReadException
java.io.IOException

getAllBufferedImages

public final java.util.ArrayList getAllBufferedImages(byte[] bytes)
                                               throws ImageReadException,
                                                      java.io.IOException
Throws:
ImageReadException
java.io.IOException

getAllBufferedImages

public final java.util.ArrayList getAllBufferedImages(java.io.File file)
                                               throws ImageReadException,
                                                      java.io.IOException
Throws:
ImageReadException
java.io.IOException

getBufferedImage

public abstract java.awt.image.BufferedImage getBufferedImage(ByteSource byteSource,
                                                              java.util.Map params)
                                                       throws ImageReadException,
                                                              java.io.IOException
Throws:
ImageReadException
java.io.IOException

getBufferedImage

public final java.awt.image.BufferedImage getBufferedImage(byte[] bytes,
                                                           java.util.Map params)
                                                    throws ImageReadException,
                                                           java.io.IOException
Throws:
ImageReadException
java.io.IOException

getBufferedImage

public final java.awt.image.BufferedImage getBufferedImage(java.io.File file,
                                                           java.util.Map params)
                                                    throws ImageReadException,
                                                           java.io.IOException
Throws:
ImageReadException
java.io.IOException

writeImage

public void writeImage(java.awt.image.BufferedImage src,
                       java.io.OutputStream os,
                       java.util.Map params)
                throws ImageWriteException,
                       java.io.IOException
Throws:
ImageWriteException
java.io.IOException

getImageSize

public final java.awt.Dimension getImageSize(byte[] bytes)
                                      throws ImageReadException,
                                             java.io.IOException
Throws:
ImageReadException
java.io.IOException

getImageSize

public final java.awt.Dimension getImageSize(byte[] bytes,
                                             java.util.Map params)
                                      throws ImageReadException,
                                             java.io.IOException
Throws:
ImageReadException
java.io.IOException

getImageSize

public final java.awt.Dimension getImageSize(java.io.File file)
                                      throws ImageReadException,
                                             java.io.IOException
Throws:
ImageReadException
java.io.IOException

getImageSize

public final java.awt.Dimension getImageSize(java.io.File file,
                                             java.util.Map params)
                                      throws ImageReadException,
                                             java.io.IOException
Throws:
ImageReadException
java.io.IOException

getImageSize

public abstract java.awt.Dimension getImageSize(ByteSource byteSource,
                                                java.util.Map params)
                                         throws ImageReadException,
                                                java.io.IOException
Throws:
ImageReadException
java.io.IOException

getXmpXml

public abstract java.lang.String getXmpXml(ByteSource byteSource,
                                           java.util.Map params)
                                    throws ImageReadException,
                                           java.io.IOException
Throws:
ImageReadException
java.io.IOException

getICCProfileBytes

public final byte[] getICCProfileBytes(byte[] bytes)
                                throws ImageReadException,
                                       java.io.IOException
Throws:
ImageReadException
java.io.IOException

getICCProfileBytes

public final byte[] getICCProfileBytes(byte[] bytes,
                                       java.util.Map params)
                                throws ImageReadException,
                                       java.io.IOException
Throws:
ImageReadException
java.io.IOException

getICCProfileBytes

public final byte[] getICCProfileBytes(java.io.File file)
                                throws ImageReadException,
                                       java.io.IOException
Throws:
ImageReadException
java.io.IOException

getICCProfileBytes

public final byte[] getICCProfileBytes(java.io.File file,
                                       java.util.Map params)
                                throws ImageReadException,
                                       java.io.IOException
Throws:
ImageReadException
java.io.IOException

getICCProfileBytes

public abstract byte[] getICCProfileBytes(ByteSource byteSource,
                                          java.util.Map params)
                                   throws ImageReadException,
                                          java.io.IOException
Throws:
ImageReadException
java.io.IOException

dumpImageFile

public final java.lang.String dumpImageFile(byte[] bytes)
                                     throws ImageReadException,
                                            java.io.IOException
Throws:
ImageReadException
java.io.IOException

dumpImageFile

public final java.lang.String dumpImageFile(java.io.File file)
                                     throws ImageReadException,
                                            java.io.IOException
Throws:
ImageReadException
java.io.IOException

dumpImageFile

public final java.lang.String dumpImageFile(ByteSource byteSource)
                                     throws ImageReadException,
                                            java.io.IOException
Throws:
ImageReadException
java.io.IOException

dumpImageFile

public boolean dumpImageFile(java.io.PrintWriter pw,
                             ByteSource byteSource)
                      throws ImageReadException,
                             java.io.IOException
Throws:
ImageReadException
java.io.IOException

embedICCProfile

public abstract boolean embedICCProfile(java.io.File src,
                                        java.io.File dst,
                                        byte[] profile)

getName

public abstract java.lang.String getName()

getDefaultExtension

public abstract java.lang.String getDefaultExtension()

getAcceptedExtensions

protected abstract java.lang.String[] getAcceptedExtensions()

getAcceptedTypes

protected abstract ImageFormat[] getAcceptedTypes()

canAcceptType

public boolean canAcceptType(ImageFormat type)

canAcceptExtension

protected final boolean canAcceptExtension(java.io.File file)

canAcceptExtension

protected final boolean canAcceptExtension(java.lang.String filename)

getBufferedImageFactory

protected IBufferedImageFactory getBufferedImageFactory(java.util.Map params)

isStrict

public static final boolean isStrict(java.util.Map params)


Copyright © 2007-2009. All Rights Reserved.