ImageWriters.
For more information on service provider classes, see the class comment
for the IIORegistry class.
Each ImageWriterSpi provides several types of information
about the ImageWriter class with which it is associated.
The name of the vendor who defined the SPI class and a
brief description of the class are available via the
getVendorName, getDescription,
and getVersion methods.
These methods may be internationalized to provide locale-specific
output. These methods are intended mainly to provide short,
human-writable information that might be used to organize a pop-up
menu or other list.
Lists of format names, file suffixes, and MIME types associated
with the service may be obtained by means of the
getFormatNames, getFileSuffixes, and
getMIMEType methods. These methods may be used to
identify candidate ImageWriters for writing a
particular file or stream based on manual format selection, file
naming, or MIME associations.
A more reliable way to determine which ImageWriters
are likely to be able to parse a particular data stream is provided
by the canEncodeImage method. This methods allows the
service provider to inspect the actual image contents.
Finally, an instance of the ImageWriter class
associated with this service provider may be obtained by calling
the createWriterInstance method. Any heavyweight
initialization, such as the loading of native libraries or creation
of large tables, should be deferred at least until the first
invocation of this method.
IIORegistry, javax.imageio.ImageTypeSpecifier , javax.imageio.ImageWriter
| Modifier and Type | Field and Description |
|---|---|
| protected Class | outputTypes
An array of |
| protected String[] | readerSpiNames
An array of strings to be returned from
|
| public static final Class | STANDARD_OUTPUT_TYPE
Deprecated
Instead of using this field, directly create
the equivalent array A single-element array, initially containing
{ ImageOutputStream.class }.
ImageOutputStream.class, to be returned from
getOutputTypes.
|
| private Class | writerClass
The |
| Access | Constructor and Description |
|---|---|
| protected | |
| public | ImageWriterSpi(String
the vendor name, as a non- vendorName, String null
String.a version identifier, as a non- version, String[] null
String.a non- names, String[] null array of
Strings indicating the format names. At least one
entry must be present.an array of suffixes, String[] Strings indicating the
common file suffixes. If no suffixes are defined,
null should be supplied. An array of length 0
will be normalized to null.an array of MIMETypes, String Strings indicating
the format's MIME types. If no suffixes are defined,
null should be supplied. An array of length 0
will be normalized to null.the fully-qualified name of the
associated writerClassName, Class<?>[] ImageWriterSpi class, as a
non-null String.an array of outputTypes, String[] Class objects of
length at least 1 indicating the legal output types.an array readerSpiNames, boolean Strings of length
at least 1 naming the classes of all associated
ImageReaders, or null. An array of
length 0 is normalized to null.a
supportsStandardStreamMetadataFormat, String boolean that indicates whether a stream metadata
object can use trees described by the standard metadata format.a
nativeStreamMetadataFormatName, String String, or null, to be returned from
getNativeStreamMetadataFormatName.a
nativeStreamMetadataFormatClassName, String[] String, or null, to be used to instantiate
a metadata format object to be returned from
getNativeStreamMetadataFormat.an array of
extraStreamMetadataFormatNames, String[] Strings, or null, to be returned from
getExtraStreamMetadataFormatNames. An array of length
0 is normalized to null.an array of
extraStreamMetadataFormatClassNames, boolean Strings, or null, to be used to instantiate
a metadata format object to be returned from
getStreamMetadataFormat. An array of length
0 is normalized to null.a
supportsStandardImageMetadataFormat, String boolean that indicates whether an image metadata
object can use trees described by the standard metadata format.a
nativeImageMetadataFormatName, String String, or null, to be returned from
getNativeImageMetadataFormatName.a
nativeImageMetadataFormatClassName, String[] String, or null, to be used to instantiate
a metadata format object to be returned from
getNativeImageMetadataFormat.an array of
extraImageMetadataFormatNames, String[] Strings to be returned from
getExtraImageMetadataFormatNames. An array of length 0
is normalized to null.an array of
extraImageMetadataFormatClassNames)Strings, or null, to be used to instantiate
a metadata format object to be returned from
getImageMetadataFormat. An array of length
0 is normalized to null.Constructs an |
| Modifier and Type | Method and Description |
|---|---|
| public abstract boolean | Returns: true if this writer is likely to be able
to encode images with the given layout.an type)ImageTypeSpecifier specifying the
layout of the image to be written.Returns |
| public boolean | Returns: true if this writer is likely to be able
to encode this image.an instance of im)RenderedImage to be encoded.Returns |
| public ImageWriter | Returns: anImageWriter instance.Returns an instance of the |
| public abstract ImageWriter | Returns: anImageWriter instance.a plug-in specific extension object, which may
be extension)null.Returns an instance of the |
| public String[] | Returns: an array ofStrings of length at least 1
containing names of ImageReaderSpis, or
null.Returns an array of |
| public Class | Returns: a non-null array of
Class objects of length at least 1.Returns an array of |
| public boolean | Returns: true if the format preserves full pixel
accuracy.Returns |
| public boolean | Returns: true if writer is recognizedan writer)ImageWriter instance.Returns |
| outputTypes | back to summary |
|---|---|
| protected Class<?>[] outputTypes An array of | |
| readerSpiNames | back to summary |
|---|---|
| protected String[] readerSpiNames An array of strings to be returned from
| |
| STANDARD_OUTPUT_TYPE | back to summary |
|---|---|
| public static final Class<?>[] STANDARD_OUTPUT_TYPE
Deprecated Instead of using this field, directly create
the equivalent array A single-element array, initially containing
| |
| writerClass | back to summary |
|---|---|
| private Class<?> writerClass The | |
| ImageWriterSpi | back to summary |
|---|---|
| protected ImageWriterSpi() Constructs a blank | |
| ImageWriterSpi | back to summary |
|---|---|
| public ImageWriterSpi(String vendorName, String version, String[] names, String[] suffixes, String[] MIMETypes, String writerClassName, Class<?>[] outputTypes, String[] readerSpiNames, boolean supportsStandardStreamMetadataFormat, String nativeStreamMetadataFormatName, String nativeStreamMetadataFormatClassName, String[] extraStreamMetadataFormatNames, String[] extraStreamMetadataFormatClassNames, boolean supportsStandardImageMetadataFormat, String nativeImageMetadataFormatName, String nativeImageMetadataFormatClassName, String[] extraImageMetadataFormatNames, String[] extraImageMetadataFormatClassNames) Constructs an
| |
| canEncodeImage | back to summary |
|---|---|
| public abstract boolean canEncodeImage(ImageTypeSpecifier type) Returns A return value of Different
| |
| canEncodeImage | back to summary |
|---|---|
| public boolean canEncodeImage(RenderedImage im) Returns See the discussion for
| |
| createWriterInstance | back to summary |
|---|---|
| public ImageWriter createWriterInstance() throws IOException Returns an instance of the The default implementation simply returns
| |
| createWriterInstance | back to summary |
|---|---|
| public abstract ImageWriter createWriterInstance(Object extension) throws IOException Returns an instance of the An Typically, a plug-in will implement this method using code
such as
| |
| getImageReaderSpiNames | back to summary |
|---|---|
| public String[] getImageReaderSpiNames() Returns an array of The first item in the array must be the name of the service
provider for the "preferred" reader, as it will be used to
instantiate the This mechanism may be used to obtain
| |
| getOutputTypes | back to summary |
|---|---|
| public Class Returns an array of For most writers, which only output to an
| |
| isFormatLossless | back to summary |
|---|---|
| public boolean isFormatLossless() Returns
| |
| isOwnWriter | back to summary |
|---|---|
| public boolean isOwnWriter(ImageWriter writer) Returns
| |