com.flagstone.transform.util.image
Interface ImageDecoder

All Known Implementing Classes:
BMPDecoder, BufferedImageDecoder, JPGDecoder, PNGDecoder

public interface ImageDecoder

ImageDecoder is an interface that classes used to decode different image formats should implement in order to be registered with the ImageRegistry.


Method Summary
 ImageTag defineImage(int identifier)
          Create the image definition so it can be added to a movie.
 int getHeight()
          Get the height of the image.
 byte[] getImage()
          Get the array of bytes that make up the image.
 int getWidth()
          Get the width of the image.
 void read(File file)
          Read an image from a file.
 void read(InputStream stream)
          Read an image from an input stream.
 void read(URL url)
          Read an image from a file referenced by a URL.
 

Method Detail

read

void read(File file)
          throws IOException,
                 DataFormatException
Read an image from a file.

Parameters:
file - the path to the file.
Throws:
IOException - if there is an error reading the image data.
DataFormatException - if the file contains an unsupported format.

read

void read(URL url)
          throws IOException,
                 DataFormatException
Read an image from a file referenced by a URL.

Parameters:
url - the reference to the file.
Throws:
IOException - if there is an error reading the image data.
DataFormatException - if the file contains an unsupported format.

read

void read(InputStream stream)
          throws IOException,
                 DataFormatException
Read an image from an input stream.

Parameters:
stream - the stream used to read the image data.
Throws:
IOException - if there is an error reading the image data.
DataFormatException - if the file contains an unsupported format.

getWidth

int getWidth()
Get the width of the image.

Returns:
the width of the image in pixels.

getHeight

int getHeight()
Get the height of the image.

Returns:
the height of the image in pixels.

getImage

byte[] getImage()
Get the array of bytes that make up the image. This method is used by the ImageFactory to generate a list of blocks for encoding an image as ScreenVideo.

Returns:
the array of bytes representing the image.

defineImage

ImageTag defineImage(int identifier)
Create the image definition so it can be added to a movie.

Parameters:
identifier - the unique identifier used to refer to the image.
Returns:
the image definition.


Copyright © 2002-2010 Flagstone Software Ltd.. All Rights Reserved.