|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.twelvemonkeys.image.BufferedImageFactory
public final class BufferedImageFactory
A faster, lighter and easier way to convert an Image to a
BufferedImage than using a PixelGrabber.
Clients may provide progress listeners to monitor conversion progress.
ColorModel and
DataBuffer.TYPE_USHORT transfer type, without converting to
32 bit/TYPE_INT.
NOTE: Does not support images with more than one ColorModel or
different types of pixel data. This is not very common.
| Nested Class Summary | |
|---|---|
static interface |
BufferedImageFactory.ProgressListener
This interface allows clients of a BufferedImageFactory to
receive notifications of decoding progress. |
| Constructor Summary | |
|---|---|
BufferedImageFactory(Image pSource)
Creates a BufferedImageFactory. |
|
BufferedImageFactory(ImageProducer pSource)
Creates a BufferedImageFactory. |
|
| Method Summary | |
|---|---|
void |
abort()
Aborts the image production. |
void |
addProgressListener(BufferedImageFactory.ProgressListener pListener)
Adds a progress listener to this factory. |
void |
dispose()
Frees resources used by this BufferedImageFactory. |
BufferedImage |
getBufferedImage()
Returns the BufferedImage extracted from the given
ImageSource. |
ColorModel |
getColorModel()
Returns the ColorModel extracted from the
given ImageSource. |
void |
removeAllProgressListeners()
Removes all progress listeners from this factory. |
void |
removeProgressListener(BufferedImageFactory.ProgressListener pListener)
Removes a progress listener from this factory. |
void |
setSourceRegion(Rectangle pRegion)
Sets the source region (AOI) for the new image. |
void |
setSourceSubsampling(int pXSub,
int pYSub)
Sets the source subsampling for the new image. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BufferedImageFactory(Image pSource)
BufferedImageFactory.
pSource - the source image
IllegalArgumentException - if pSource == nullpublic BufferedImageFactory(ImageProducer pSource)
BufferedImageFactory.
pSource - the source image producer
IllegalArgumentException - if pSource == null| Method Detail |
|---|
public BufferedImage getBufferedImage()
throws ImageConversionException
BufferedImage extracted from the given
ImageSource. Multiple requests will return the same image.
BufferedImage
ImageConversionException - if the given ImageSource cannot
be converted for some reason.
public ColorModel getColorModel()
throws ImageConversionException
ColorModel extracted from the
given ImageSource. Multiple requests will return the same model.
ColorModel
ImageConversionException - if the given ImageSource cannot
be converted for some reason.public void dispose()
BufferedImageFactory.
public void abort()
public void setSourceRegion(Rectangle pRegion)
pRegion - the source region
public void setSourceSubsampling(int pXSub,
int pYSub)
pXSub - horizontal subsampling factorpYSub - vertical subsampling factorpublic void addProgressListener(BufferedImageFactory.ProgressListener pListener)
pListener - the progress listenerpublic void removeProgressListener(BufferedImageFactory.ProgressListener pListener)
pListener - the progress listenerpublic void removeAllProgressListeners()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||