|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object![]()
![]()
![]()
javax.imageio.ImageWriter

public abstract class ImageWriter


An abstract superclass for encoding and writing images. This class must be subclassed by classes that write out images in the context of the Java Image I/O framework.
ImageWriter objects are normally instantiated by
the service provider class for the specific format. Service
provider classes are registered with the IIORegistry,
which uses them for format recognition and presentation of
available format readers and writers.
ImageReader
,
ImageWriteParam
,
IIORegistry
,
ImageWriterSpi

| Field Summary | |
|---|---|
protected Locale |
availableLocales
An array of Locales that may be used to localize
warning messages and compression setting values, or
null if localization is not supported. |
protected Locale |
locale
The current Locale to be used for localization, or
null if none has been set. |
protected ImageWriterSpi |
originatingProvider
The ImageWriterSpi that instantiated this object,
or null if its identity is not known or none
exists. |
protected Object |
output
The ImageOutputStream or other Object
set by setOutput and retrieved by
getOutput. |
protected List |
progressListeners
A List of currently registered
IIOWriteProgressListeners, initialized by default
null, which is synonymous with an empty
List. |
protected List |
warningListeners
A List of currently registered
IIOWriteWarningListeners, initialized by default to
null, which is synonymous with an empty
List. |
protected List |
warningLocales
A List of Locales, one for each
element of warningListeners, initialized by default
null, which is synonymous with an empty
List. |
| Constructor Summary | |
|---|---|
protected |
ImageWriter
Constructs an ImageWriter and sets its
originatingProvider instance variable to the
supplied value. |
| Method Summary | |
|---|---|
void |
abort
Requests that any current write operation be aborted. |
protected boolean |
abortRequested
Returns true if a request to abort the current
write operation has been made since the writer was instantiated or
clearAbortRequest was called. |
void |
addIIOWriteProgressListener
Adds an IIOWriteProgressListener to the list of
registered progress listeners. |
void |
addIIOWriteWarningListener
Adds an IIOWriteWarningListener to the list of
registered warning listeners. |
boolean |
canInsertEmpty
Returns true if the writer supports the insertion
of a new, empty image at the given index. |
boolean |
canInsertImage
Returns true if the writer supports the insertion
of a new image at the given index. |
boolean |
canRemoveImage
Returns true if the writer supports the removal
of an existing image at the given index. |
boolean |
canReplaceImageMetadata
Returns true if it is possible to replace the
image metadata associated with an existing image with index
imageIndex. |
boolean |
canReplacePixels
Returns true if the writer allows pixels of the
given image to be replaced using the replacePixels
methods. |
boolean |
canReplaceStreamMetadata
Returns true if it is possible to replace the
stream metadata already present in the output. |
boolean |
canWriteEmpty
Returns true if the writer supports the writing of
a complete image stream consisting of a single image with
undefined pixel values and associated metadata and thumbnails
to the output. |
boolean |
canWriteRasters
Returns true if the methods that take an
IIOImage parameter are capable of dealing with a
Raster (as opposed to RenderedImage)
source image. |
boolean |
canWriteSequence
Returns true if the writer is able to append an
image to an image stream that already contains header
information and possibly prior images. |
protected void |
clearAbortRequest
Clears any previous abort request. |
abstract IIOMetadata |
convertImageMetadata
Returns an IIOMetadata object that may be used for
encoding and optionally modified using its document interfaces
or other interfaces specific to the writer plug-in that will be
used for encoding. |
abstract IIOMetadata |
convertStreamMetadata
Returns an IIOMetadata object that may be used for
encoding and optionally modified using its document interfaces
or other interfaces specific to the writer plug-in that will be
used for encoding. |
void |
dispose
Allows any resources held by this object to be released. |
void |
endInsertEmpty
Completes the insertion of a new image that was begun with a prior call to prepareInsertEmpty. |
void |
endReplacePixels
Terminates a sequence of calls to replacePixels. |
void |
endWriteEmpty
Completes the writing of a new image that was begun with a prior call to prepareWriteEmpty. |
void |
endWriteSequence
Completes the writing of a sequence of images begun with prepareWriteSequence. |
Locale |
getAvailableLocales
Returns an array of Locales that may be used to
localize warning listeners and compression settings. |
abstract IIOMetadata |
getDefaultImageMetadata
Returns an IIOMetadata object containing default
values for encoding an image of the given type. |
abstract IIOMetadata |
getDefaultStreamMetadata
Returns an IIOMetadata object containing default
values for encoding a stream of images. |
ImageWriteParam |
getDefaultWriteParam
Returns a new ImageWriteParam object of the
appropriate type for this file format containing default
values, that is, those values that would be used
if no ImageWriteParam object were specified. |
Locale |
getLocale
Returns the currently set Locale, or
null if none has been set. |
int |
getNumThumbnailsSupported
Returns the number of thumbnails suported by the format being written, given the image type and any additional write parameters and metadata objects that will be used during encoding. |
ImageWriterSpi |
getOriginatingProvider
Returns the ImageWriterSpi object that created
this ImageWriter, or null if this
object was not created through the IIORegistry. |
Object |
getOutput
Returns the ImageOutputStream or other
Object set by the most recent call to the
setOutput method. |
Dimension |
getPreferredThumbnailSizes
Returns an array of Dimensions indicating the
legal size ranges for thumbnail images as they will be encoded
in the output file or stream. |
void |
prepareInsertEmpty
Begins the insertion of a new image with undefined pixel values into an existing image stream. |
void |
prepareReplacePixels
Prepares the writer to handle a series of calls to the replacePixels methods. |
void |
prepareWriteEmpty
Begins the writing of a complete image stream, consisting of a single image with undefined pixel values and associated metadata and thumbnails, to the output. |
void |
prepareWriteSequence
Prepares a stream to accept a series of subsequent writeToSequence calls, using the provided stream
metadata object. |
protected void |
processImageComplete
Broadcasts the completion of an image write to all registered IIOWriteProgressListeners by calling their
imageComplete method. |
protected void |
processImageProgress
Broadcasts the current percentage of image completion to all registered IIOWriteProgressListeners by calling
their imageProgress method. |
protected void |
processImageStarted
Broadcasts the start of an image write to all registered IIOWriteProgressListeners by calling their
imageStarted method. |
protected void |
processThumbnailComplete
Broadcasts the completion of a thumbnail write to all registered IIOWriteProgressListeners by calling their
thumbnailComplete method. |
protected void |
processThumbnailProgress
Broadcasts the current percentage of thumbnail completion to all registered IIOWriteProgressListeners by calling
their thumbnailProgress method. |
protected void |
processThumbnailStarted
Broadcasts the start of a thumbnail write to all registered IIOWriteProgressListeners by calling their
thumbnailStarted method. |
protected void |
processWarningOccurred
Broadcasts a warning message to all registered IIOWriteWarningListeners by calling their
warningOccurred method. |
protected void |
processWarningOccurred
Broadcasts a localized warning message to all registered IIOWriteWarningListeners by calling their
warningOccurred method with a string taken
from a ResourceBundle. |
protected void |
processWriteAborted
Broadcasts that the write has been aborted to all registered IIOWriteProgressListeners by calling their
writeAborted method. |
void |
removeAllIIOWriteProgressListeners
Removes all currently registered IIOWriteProgressListener objects. |
void |
removeAllIIOWriteWarningListeners
Removes all currently registered IIOWriteWarningListener objects. |
void |
removeIIOWriteProgressListener
Removes an IIOWriteProgressListener from the list
of registered progress listeners. |
void |
removeIIOWriteWarningListener
Removes an IIOWriteWarningListener from the list
of registered warning listeners. |
void |
removeImage
Removes an image from the stream. |
void |
replaceImageMetadata
Replaces the image metadata associated with an existing image. |
void |
replacePixels
Replaces a portion of an image already present in the output with a portion of the given Raster. |
void |
replacePixels
Replaces a portion of an image already present in the output with a portion of the given image. |
void |
replaceStreamMetadata
Replaces the stream metadata in the output with new information. |
void |
reset
Restores the ImageWriter to its initial state. |
void |
setLocale
Sets the current Locale of this
ImageWriter to the given value. |
void |
setOutput |