public final class BufferedImageFactory
extends java.lang.Object
Image to a
BufferedImage than using a PixelGrabber.
Clients may provide progress listeners to monitor conversion progress.
Supports source image subsampling and source region extraction.
Supports source images with 16 bit 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.| Modifier and Type | Class and Description |
|---|---|
static interface |
BufferedImageFactory.ProgressListener
This interface allows clients of a
BufferedImageFactory to
receive notifications of decoding progress. |
| Constructor and Description |
|---|
BufferedImageFactory(java.awt.Image pSource)
Creates a
BufferedImageFactory. |
BufferedImageFactory(java.awt.image.ImageProducer pSource)
Creates a
BufferedImageFactory. |
| Modifier and Type | Method and Description |
|---|---|
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. |
java.awt.image.BufferedImage |
getBufferedImage()
Returns the
BufferedImage extracted from the given
ImageSource. |
java.awt.image.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(java.awt.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.
|
public BufferedImageFactory(java.awt.Image pSource)
BufferedImageFactory.pSource - the source imagejava.lang.IllegalArgumentException - if pSource == nullpublic BufferedImageFactory(java.awt.image.ImageProducer pSource)
BufferedImageFactory.pSource - the source image producerjava.lang.IllegalArgumentException - if pSource == nullpublic java.awt.image.BufferedImage getBufferedImage()
throws ImageConversionException
BufferedImage extracted from the given
ImageSource. Multiple requests will return the same image.BufferedImageImageConversionException - if the given ImageSource cannot
be converted for some reason.public java.awt.image.ColorModel getColorModel()
throws ImageConversionException
ColorModel extracted from the
given ImageSource. Multiple requests will return the same model.ColorModelImageConversionException - if the given ImageSource cannot
be converted for some reason.public void dispose()
BufferedImageFactory.public void abort()
public void setSourceRegion(java.awt.Rectangle pRegion)
pRegion - the source regionpublic 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()
Copyright © 2018. All Rights Reserved.