org.apache.sanselan.formats.bmp
Class BmpImageParser

java.lang.Object
  extended by org.apache.sanselan.common.BinaryFileFunctions
      extended by org.apache.sanselan.common.BinaryFileParser
          extended by org.apache.sanselan.ImageParser
              extended by org.apache.sanselan.formats.bmp.BmpImageParser
All Implemented Interfaces:
BinaryConstants, SanselanConstants

public class BmpImageParser
extends ImageParser


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
BmpImageParser()
           
 
Method Summary
 boolean dumpImageFile(java.io.PrintWriter pw, ByteSource byteSource)
           
 byte[] embedICCProfile(byte[] image, byte[] profile)
           
 boolean embedICCProfile(java.io.File src, java.io.File dst, byte[] profile)
           
protected  java.lang.String[] getAcceptedExtensions()
           
protected  ImageFormat[] getAcceptedTypes()
           
 java.awt.image.BufferedImage getBufferedImage(ByteSource byteSource, java.util.Map params)
           
 java.lang.String getDefaultExtension()
           
 FormatCompliance getFormatCompliance(ByteSource byteSource)
           
 byte[] getICCProfileBytes(ByteSource byteSource, java.util.Map params)
           
 ImageInfo getImageInfo(ByteSource byteSource, java.util.Map params)
           
 java.awt.Dimension getImageSize(ByteSource byteSource, java.util.Map params)
           
 IImageMetadata getMetadata(ByteSource byteSource, java.util.Map params)
           
 java.lang.String getName()
           
 java.lang.String getXmpXml(ByteSource byteSource, java.util.Map params)
          Extracts embedded XML metadata as XML string.
 void writeImage(java.awt.image.BufferedImage src, java.io.OutputStream os, java.util.Map params)
           
 
Methods inherited from class org.apache.sanselan.ImageParser
canAcceptExtension, canAcceptExtension, canAcceptType, dumpImageFile, dumpImageFile, dumpImageFile, getAllBufferedImages, getAllBufferedImages, getAllBufferedImages, getAllImageParsers, getBufferedImage, getBufferedImage, getBufferedImageFactory, getFormatCompliance, getFormatCompliance, getICCProfileBytes, getICCProfileBytes, getICCProfileBytes, getICCProfileBytes, getImageInfo, getImageInfo, getImageInfo, getImageSize, getImageSize, getImageSize, getImageSize, getMetadata, getMetadata, getMetadata, getMetadata, getMetadata, isStrict
 
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

BmpImageParser

public BmpImageParser()
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in class ImageParser

getDefaultExtension

public java.lang.String getDefaultExtension()
Specified by:
getDefaultExtension in class ImageParser

getAcceptedExtensions

protected java.lang.String[] getAcceptedExtensions()
Specified by:
getAcceptedExtensions in class ImageParser

getAcceptedTypes

protected ImageFormat[] getAcceptedTypes()
Specified by:
getAcceptedTypes in class ImageParser

getICCProfileBytes

public byte[] getICCProfileBytes(ByteSource byteSource,
                                 java.util.Map params)
                          throws ImageReadException,
                                 java.io.IOException
Specified by:
getICCProfileBytes in class ImageParser
Throws:
ImageReadException
java.io.IOException

getImageSize

public java.awt.Dimension getImageSize(ByteSource byteSource,
                                       java.util.Map params)
                                throws ImageReadException,
                                       java.io.IOException
Specified by:
getImageSize in class ImageParser
Throws:
ImageReadException
java.io.IOException

embedICCProfile

public byte[] embedICCProfile(byte[] image,
                              byte[] profile)

embedICCProfile

public boolean embedICCProfile(java.io.File src,
                               java.io.File dst,
                               byte[] profile)
Specified by:
embedICCProfile in class ImageParser

getMetadata

public IImageMetadata getMetadata(ByteSource byteSource,
                                  java.util.Map params)
                           throws ImageReadException,
                                  java.io.IOException
Specified by:
getMetadata in class ImageParser
Throws:
ImageReadException
java.io.IOException

getImageInfo

public ImageInfo getImageInfo(ByteSource byteSource,
                              java.util.Map params)
                       throws ImageReadException,
                              java.io.IOException
Specified by:
getImageInfo in class ImageParser
Throws:
ImageReadException
java.io.IOException

dumpImageFile

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

getFormatCompliance

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

getBufferedImage

public java.awt.image.BufferedImage getBufferedImage(ByteSource byteSource,
                                                     java.util.Map params)
                                              throws ImageReadException,
                                                     java.io.IOException
Specified by:
getBufferedImage in class ImageParser
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
Overrides:
writeImage in class ImageParser
Throws:
ImageWriteException
java.io.IOException

getXmpXml

public java.lang.String getXmpXml(ByteSource byteSource,
                                  java.util.Map params)
                           throws ImageReadException,
                                  java.io.IOException
Extracts embedded XML metadata as XML string.

Specified by:
getXmpXml in class ImageParser
Parameters:
file - File containing image data.
params - Map of optional parameters, defined in SanselanConstants.
Returns:
Xmp Xml as String, if present. Otherwise, returns null..
Throws:
ImageReadException
java.io.IOException


Copyright © 2007-2009. All Rights Reserved.