Package com.idrsolutions.image.sgi
Class SgiDecoder
java.lang.Object
com.idrsolutions.image.JDeliImage
com.idrsolutions.image.sgi.SgiDecoder
- All Implemented Interfaces:
com.idrsolutions.image.Decoder
public class SgiDecoder
extends com.idrsolutions.image.JDeliImage
implements com.idrsolutions.image.Decoder
Class decodes images ending with .sgi or .rgb extensions as BufferedImage
Example 1 (Using raw byte data):
SgiDecoder decoder = new SgiDecoder();
BufferedImage decodedImage = decoder.read(sgiBytes);
Example 2 (Using File):
File sgiFile = new File("C:\\path\\to\\output\\file.sgi");
SgiDecoder decoder = new SgiDecoder();
BufferedImage decodedImage = decoder.read(sgiFile);
-
Field Summary
Fields inherited from class com.idrsolutions.image.JDeliImage
bb
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionread
(byte[] data) Decodes and returns the SGI image as a BufferedImage from bytesDecodes and returns the SGI image as a BufferedImage from filereadDimension
(byte[] sgiRawData) Decodes and returns the width and height of sgi imagereadDimension
(File file) Decodes and returns the width and height of sgi imageMethods inherited from class com.idrsolutions.image.JDeliImage
optimiseImage
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.idrsolutions.image.Decoder
getImageCount, getImageCount, readEmbeddedThumbnail, readEmbeddedThumbnail, readImageAt, readImageAt, readImageSpecificMetaData, readImageSpecificMetaData, setMetadata
-
Constructor Details
-
SgiDecoder
public SgiDecoder()
-
-
Method Details
-
read
Decodes and returns the SGI image as a BufferedImage from bytes- Specified by:
read
in interfacecom.idrsolutions.image.Decoder
- Parameters:
data
- byte[] containing the SGI or RGB data to be decoded- Returns:
- BufferedImage The decoded image
- Throws:
IOException
- if an error occurs in reading image
-
read
Decodes and returns the SGI image as a BufferedImage from file- Specified by:
read
in interfacecom.idrsolutions.image.Decoder
- Parameters:
file
- input image file to be decoded- Returns:
- BufferedImage decoded image
- Throws:
IOException
- if an error occurs in reading image
-
readDimension
Decodes and returns the width and height of sgi image- Specified by:
readDimension
in interfacecom.idrsolutions.image.Decoder
- Parameters:
file
- image image contained in raw data if present- Returns:
- width and height of image
- Throws:
Exception
- if problem reading image
-
readDimension
Decodes and returns the width and height of sgi image- Specified by:
readDimension
in interfacecom.idrsolutions.image.Decoder
- Parameters:
sgiRawData
- image image contained in raw data if present- Returns:
- Rectangle width and height of image
- Throws:
Exception
- if problem reading image
-