Package com.idrsolutions.image.bmp
Class BmpDecoder
java.lang.Object
com.idrsolutions.image.JDeliImage
com.idrsolutions.image.bmp.BmpDecoder
- All Implemented Interfaces:
com.idrsolutions.image.Decoder
public class BmpDecoder
extends com.idrsolutions.image.JDeliImage
implements com.idrsolutions.image.Decoder
Class reads BMP image as BufferedImage
Example 1 (Using raw byte data):
BmpDecoder decoder = new BmpDecoder();
BufferedImage decodedImage = decoder.read(bmpBytes);
Example 2 (Using a File):
File bmpFile = new File("C:\\path\\to\\file\\image.bmp");
BmpDecoder decoder = new BmpDecoder();
BufferedImage decodedImage = decoder.read(bmpFile);
-
Field Summary
Fields inherited from class com.idrsolutions.image.JDeliImage
bb -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionread(byte[] bmpData) Decodes and returns the BMP image as a BufferedImage from bytesDecodes and returns the BMP image as a BufferedImage from a FilereadDimension(byte[] bmpData) Decodes and returns the width and height of BMP imagereadDimension(File bmpFile) Decodes and returns the width and height of BMP imageMethods inherited from class com.idrsolutions.image.JDeliImage
optimiseImageMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.idrsolutions.image.Decoder
getImageCount, getImageCount, readEmbeddedThumbnail, readEmbeddedThumbnail, readImageAt, readImageAt, readImageSpecificMetaData, readImageSpecificMetaData, setMetadata
-
Constructor Details
-
BmpDecoder
public BmpDecoder()
-
-
Method Details
-
read
Decodes and returns the BMP image as a BufferedImage from bytes- Specified by:
readin interfacecom.idrsolutions.image.Decoder- Parameters:
bmpData- byte[] containing the BMP data- Returns:
- BufferedImage The decoded image
- Throws:
IOException- if an error occurs in reading image
-
read
Decodes and returns the BMP image as a BufferedImage from a File- Specified by:
readin interfacecom.idrsolutions.image.Decoder- Parameters:
bmpFile- BMP file to be converted to a BufferedImage- Returns:
- BufferedImage The decoded image
- Throws:
IOException- if an error occurs in reading image
-
readDimension
Decodes and returns the width and height of BMP image- Specified by:
readDimensionin interfacecom.idrsolutions.image.Decoder- Parameters:
bmpFile- File containing the image- Returns:
- width and height of image
- Throws:
IOException- if problem reading image
-
readDimension
Decodes and returns the width and height of BMP image- Specified by:
readDimensionin interfacecom.idrsolutions.image.Decoder- Parameters:
bmpData- image contained in raw data if present- Returns:
- Rectangle width and height of image
- Throws:
IOException- if problem reading image
-