org.apache.sanselan.formats.bmp
Class BmpImageParser
java.lang.Object
org.apache.sanselan.common.BinaryFileFunctions
org.apache.sanselan.common.BinaryFileParser
org.apache.sanselan.ImageParser
org.apache.sanselan.formats.bmp.BmpImageParser
- All Implemented Interfaces:
- BinaryConstants, SanselanConstants
public class BmpImageParser
- extends ImageParser
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 |
BmpImageParser
public BmpImageParser()
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.