public abstract class ImageWriterBase extends ImageWriter
Modifier and Type | Field and Description |
---|---|
protected ImageOutputStream |
imageOutput
For convenience.
|
availableLocales, locale, originatingProvider, output, progressListeners, warningListeners, warningLocales
Modifier | Constructor and Description |
---|---|
protected |
ImageWriterBase(ImageWriterSpi provider)
Constructs an
ImageWriter and sets its
originatingProvider instance variable to the
supplied value. |
Modifier and Type | Method and Description |
---|---|
protected void |
assertOutput()
Makes sure output is set.
|
IIOMetadata |
convertStreamMetadata(IIOMetadata inData,
ImageWriteParam param)
Returns
null |
protected static BufferedImage |
fakeAOI(BufferedImage pImage,
ImageWriteParam pParam)
Utility method for getting the area of interest (AOI) of an image.
|
protected static Image |
fakeSubsampling(Image pImage,
ImageWriteParam pParam)
Utility method for getting the subsampled image.
|
IIOMetadata |
getDefaultStreamMetadata(ImageWriteParam param)
Returns
null |
String |
getFormatName() |
protected static Rectangle |
getSourceRegion(ImageWriteParam pParam,
int pWidth,
int pHeight) |
void |
reset() |
protected void |
resetMembers() |
void |
setOutput(Object output) |
abort, abortRequested, addIIOWriteProgressListener, addIIOWriteWarningListener, canInsertEmpty, canInsertImage, canRemoveImage, canReplaceImageMetadata, canReplacePixels, canReplaceStreamMetadata, canWriteEmpty, canWriteRasters, canWriteSequence, clearAbortRequest, convertImageMetadata, dispose, endInsertEmpty, endReplacePixels, endWriteEmpty, endWriteSequence, getAvailableLocales, getDefaultImageMetadata, getDefaultWriteParam, getLocale, getNumThumbnailsSupported, getOriginatingProvider, getOutput, getPreferredThumbnailSizes, prepareInsertEmpty, prepareReplacePixels, prepareWriteEmpty, prepareWriteSequence, processImageComplete, processImageProgress, processImageStarted, processThumbnailComplete, processThumbnailProgress, processThumbnailStarted, processWarningOccurred, processWarningOccurred, processWriteAborted, removeAllIIOWriteProgressListeners, removeAllIIOWriteWarningListeners, removeIIOWriteProgressListener, removeIIOWriteWarningListener, removeImage, replaceImageMetadata, replacePixels, replacePixels, replaceStreamMetadata, setLocale, write, write, write, writeInsert, writeToSequence
protected ImageOutputStream imageOutput
ImageInputStream
.setOutput(Object)
protected ImageWriterBase(ImageWriterSpi provider)
ImageWriter
and sets its
originatingProvider
instance variable to the
supplied value.
Subclasses that make use of extensions should provide a
constructor with signature (ImageWriterSpi,
Object)
in order to retrieve the extension object. If
the extension object is unsuitable, an
IllegalArgumentException
should be thrown.
provider
- the ImageWriterSpi
that is constructing this object, or null
.public String getFormatName() throws IOException
IOException
public void setOutput(Object output)
setOutput
in class ImageWriter
protected void assertOutput()
IllegalStateException
- if getOutput() == null
.public void reset()
reset
in class ImageWriter
protected void resetMembers()
public IIOMetadata getDefaultStreamMetadata(ImageWriteParam param)
null
getDefaultStreamMetadata
in class ImageWriter
param
- ignored.null
.public IIOMetadata convertStreamMetadata(IIOMetadata inData, ImageWriteParam param)
null
convertStreamMetadata
in interface ImageTranscoder
convertStreamMetadata
in class ImageWriter
inData
- ignored.param
- ignored.null
.protected static Rectangle getSourceRegion(ImageWriteParam pParam, int pWidth, int pHeight)
protected static BufferedImage fakeAOI(BufferedImage pImage, ImageWriteParam pParam)
IIOParam.setSourceRegion(java.awt.Rectangle)
method.
Note: If it is possible for the reader to read the AOI directly, such a
method should be used instead, for efficiency.pImage
- the image to get AOI frompParam
- the param optionally specifying the AOIBufferedImage
containing the area of interest (source
region), or the original image, if no source region was set, or
pParam
was null
protected static Image fakeSubsampling(Image pImage, ImageWriteParam pParam)
IIOParam.setSourceSubsampling(int, int, int, int)
method.
NOTE: This method does not take the subsampling offsets into
consideration.
Note: If it is possible for the reader to subsample directly, such a
method should be used instead, for efficiency.pImage
- the image to subsamplepParam
- the param optionally specifying subsamplingImage
containing the subsampled image, or the
original image, if no subsampling was specified, or
pParam
was null
Copyright © 2017. All rights reserved.