net.coobird.thumbnailator.tasks.io
Interface ImageSource<T>

Type Parameters:
T - The source class from which the source image is retrieved or read.
All Known Implementing Classes:
AbstractImageSource, BufferedImageSource, FileImageSource, InputStreamImageSource, URLImageSource

public interface ImageSource<T>

An interface to be implemented by classes which read or retrieve images from which a thumbnail should be produced.

Author:
coobird

Method Summary
 String getInputFormatName()
          Returns the name of the image format.
 T getSource()
          Returns the source from which the image is read or retrieved.
 BufferedImage read()
          Retrieves the image from the source.
 void setThumbnailParameter(ThumbnailParameter param)
          Sets the ThumbnailParameter from which to retrieve parameters to use when retrieving the image.
 

Method Detail

read

BufferedImage read()
                   throws IOException
Retrieves the image from the source.

Returns:
The image.
Throws:
IOException - When a problem occurs while reading or obtaining the image.

getInputFormatName

String getInputFormatName()
Returns the name of the image format.

Returns:
The image format name. If there is no image format information, then null will be returned.
Throws:
IllegalStateException - If the source image has not been read yet.

setThumbnailParameter

void setThumbnailParameter(ThumbnailParameter param)
Sets the ThumbnailParameter from which to retrieve parameters to use when retrieving the image.

Parameters:
param - The ThumbnailParameter with image reading parameters.

getSource

T getSource()
Returns the source from which the image is read or retrieved.

Returns:
The source of the image.


Copyright © 2014. All rights reserved.