org.geotoolkit.image.io.mosaic
Class MosaicImageWriter.Spi

Object
  extended by IIOServiceProvider
      extended by ImageReaderWriterSpi
          extended by ImageWriterSpi
              extended by MosaicImageWriter.Spi
All Implemented Interfaces:
RegisterableService
Enclosing class:
MosaicImageWriter

public static class MosaicImageWriter.Spi
extends ImageWriterSpi

Service provider for MosaicImageWriter. This service provider is not strictly compliant with the Image I/O specification since it cant not work with ImageOutputStream.

Since:
2.5
Version:
3.18
Author:
Martin Desruisseaux (Geomatys), Cédric Briançon (Geomatys)
Module:
coverage/geotk-coverageio (download)    View source code for this class

Field Summary
static MosaicImageWriter.Spi DEFAULT
          The default instance.
 
Fields inherited from class ImageWriterSpi
outputTypes, readerSpiNames, STANDARD_OUTPUT_TYPE
 
Fields inherited from class ImageReaderWriterSpi
extraImageMetadataFormatClassNames, extraImageMetadataFormatNames, extraStreamMetadataFormatClassNames, extraStreamMetadataFormatNames, MIMETypes, names, nativeImageMetadataFormatClassName, nativeImageMetadataFormatName, nativeStreamMetadataFormatClassName, nativeStreamMetadataFormatName, pluginClassName, suffixes, supportsStandardImageMetadataFormat, supportsStandardStreamMetadataFormat
 
Fields inherited from class IIOServiceProvider
vendorName, version
 
Constructor Summary
MosaicImageWriter.Spi()
          Creates a default provider.
 
Method Summary
 boolean canEncodeImage(ImageTypeSpecifier type)
          Returns true if this writer is likely to be able to encode images with the given layout.
 boolean canEncodeOutput(Object destination)
          Returns true if the image writer can encode the given output.
 ImageWriter createWriterInstance(Object extension)
          Returns a new MosaicImageWriter.
 String getDescription(Locale locale)
          Returns a brief, human-readable description of this service provider.
 Class<?>[] getOutputTypes()
          Returns the types of objects that may be used as arguments to the MosaicImageWriter.setOutput(Object) method.
 
Methods inherited from class ImageWriterSpi
canEncodeImage, createWriterInstance, getImageReaderSpiNames, isFormatLossless, isOwnWriter
 
Methods inherited from class ImageReaderWriterSpi
getExtraImageMetadataFormatNames, getExtraStreamMetadataFormatNames, getFileSuffixes, getFormatNames, getImageMetadataFormat, getMIMETypes, getNativeImageMetadataFormatName, getNativeStreamMetadataFormatName, getPluginClassName, getStreamMetadataFormat, isStandardImageMetadataFormatSupported, isStandardStreamMetadataFormatSupported
 
Methods inherited from class IIOServiceProvider
getVendorName, getVersion, onDeregistration, onRegistration
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT

public static final MosaicImageWriter.Spi DEFAULT
The default instance. There is no instance of this provider registered in the standard IIORegistry, because this provider is not strictly compliant with the Image I/O requirement (in particular, the Mosaic Image Writer does not accept ImageOutputStream). This constant can be used as a replacement.

Constructor Detail

MosaicImageWriter.Spi

public MosaicImageWriter.Spi()
Creates a default provider. This constructor does not set the ImageWriterSpi.outputTypes field in order to delay loading of Tile and TileManager classes as much as possible.

Method Detail

getOutputTypes

public Class<?>[] getOutputTypes()
Returns the types of objects that may be used as arguments to the MosaicImageWriter.setOutput(Object) method. This method initializes the ImageWriterSpi.outputTypes field when first needed.

Overrides:
getOutputTypes in class ImageWriterSpi
Since:
3.18

canEncodeOutput

public boolean canEncodeOutput(Object destination)
                        throws IOException
Returns true if the image writer can encode the given output. The default implementation returns true if the given object is an instance assignable to one of the types returned by the getOutputTypes() implementation of this Spi class, and other type-specific restrictions are meet (e.g. Collection contains only instances of Tile, etc.).

Parameters:
destination - The output to be encoded.
Returns:
true If the image writer can encode the given output.
Throws:
IOException - If an I/O operation was required and failed.
Since:
3.14

canEncodeImage

public boolean canEncodeImage(ImageTypeSpecifier type)
Returns true if this writer is likely to be able to encode images with the given layout. The default implementation returns true in all cases. The capability to encode images depends on the tile format specified in Tile objects, which are not known to this provider.

Specified by:
canEncodeImage in class ImageWriterSpi

createWriterInstance

public ImageWriter createWriterInstance(Object extension)
                                 throws IOException
Returns a new MosaicImageWriter.

Specified by:
createWriterInstance in class ImageWriterSpi
Throws:
IOException - If an I/O operation was required and failed.

getDescription

public String getDescription(Locale locale)
Returns a brief, human-readable description of this service provider.

Specified by:
getDescription in class IIOServiceProvider
TODO:
Localize.


Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.