org.geotoolkit.image.io.plugin
Class RawTiffImageReader.Spi

Object
  extended by IIOServiceProvider
      extended by ImageReaderWriterSpi
          extended by ImageReaderSpi
              extended by SpatialImageReader.Spi
                  extended by RawTiffImageReader.Spi
All Implemented Interfaces:
RegisterableService, SystemOverride
Enclosing class:
RawTiffImageReader

public static class RawTiffImageReader.Spi
extends SpatialImageReader.Spi
implements SystemOverride

Service provider interface (SPI) for RawTiffImageReaders. This SPI provides necessary implementation for creating default RawTiffImageReader instances.

The default constructor initializes the fields to the values listed below. Users wanting different values should create a subclass of Spi and set the desired values in their constructor.

FieldValue
 ImageReaderWriterSpi.names   "tiff" 
 ImageReaderWriterSpi.MIMETypes   "image/tiff" 
 ImageReaderWriterSpi.pluginClassName   "org.geotoolkit.image.io.plugin.RawTiffImageReader" 
 IIOServiceProvider.vendorName   "Geotoolkit.org" 
 IIOServiceProvider.version   Version.GEOTOOLKIT 

By default, this provider register itself after the provider supplied by the Image I/O extension for JAI, because the later supports a wider range of formats. See onRegistration for more information.

Since:
3.16
Version:
3.16
Author:
Martin Desruisseaux (Geomatys)
Module:
coverage/geotk-coverageio (download)    View source code for this class

Field Summary
 
Fields inherited from class ImageReaderSpi
inputTypes, STANDARD_INPUT_TYPE, writerSpiNames
 
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
 
Fields inherited from interface SystemOverride
KEY_ALLOW_OVERRIDE
 
Constructor Summary
RawTiffImageReader.Spi()
          Constructs a default RawTiffImageReader.Spi.
 
Method Summary
 boolean canDecodeInput(Object source)
          Current implementation returns false in every case.
 ImageReader createReaderInstance(Object extension)
          Returns an instance of the ImageReader implementation associated with this service provider.
 String getDescription(Locale locale)
          Returns a brief, human-readable description of this service provider and its associated implementation.
 void onRegistration(ServiceRegistry registry, Class<?> category)
          Invoked when this Service Provider is registered.
 
Methods inherited from class SpatialImageReader.Spi
getImageMetadataFormat, getStreamMetadataFormat
 
Methods inherited from class ImageReaderSpi
createReaderInstance, getImageWriterSpiNames, getInputTypes, isOwnReader
 
Methods inherited from class ImageReaderWriterSpi
getExtraImageMetadataFormatNames, getExtraStreamMetadataFormatNames, getFileSuffixes, getFormatNames, getMIMETypes, getNativeImageMetadataFormatName, getNativeStreamMetadataFormatName, getPluginClassName, isStandardImageMetadataFormatSupported, isStandardStreamMetadataFormatSupported
 
Methods inherited from class IIOServiceProvider
getVendorName, getVersion, onDeregistration
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RawTiffImageReader.Spi

public RawTiffImageReader.Spi()
Constructs a default RawTiffImageReader.Spi. The fields are initialized as documented in the class javadoc. Subclasses can modify those values if desired.

For efficiency reasons, the fields are initialized to shared arrays. Subclasses can assign new arrays, but should not modify the default array content.

Method Detail

getDescription

public String getDescription(Locale locale)
Returns a brief, human-readable description of this service provider and its associated implementation. The resulting string should be localized for the supplied locale, if possible.

Specified by:
getDescription in class IIOServiceProvider
Parameters:
locale - A Locale for which the return value should be localized.
Returns:
A String containing a description of this service provider.

canDecodeInput

public boolean canDecodeInput(Object source)
                       throws IOException
Current implementation returns false in every case. Future implementation may perform a better check if the RawTiffImageReader become less restrictive.

Specified by:
canDecodeInput in class ImageReaderSpi
Parameters:
source - The input source to be decoded.
Returns:
true if the given source can be used by RawTiffImageReader.
Throws:
IOException - if an I/O error occurs while reading the stream.

createReaderInstance

public ImageReader createReaderInstance(Object extension)
                                 throws IOException
Returns an instance of the ImageReader implementation associated with this service provider.

Specified by:
createReaderInstance in class ImageReaderSpi
Parameters:
extension - An optional extension object, which may be null.
Returns:
An image reader instance.
Throws:
IOException - if the attempt to instantiate the reader fails.

onRegistration

public void onRegistration(ServiceRegistry registry,
                           Class<?> category)
Invoked when this Service Provider is registered. By default, this method sets the ordering of this RawTiffImageReader.Spi after the one provided in Image I/O extension for JAI. This behavior can be changed by setting the "geotk.system.override" system property explicitly to true.

Note that the Geotk TIFF image reader will be selected only if the source given to the canDecodeInput(Object) method is compliant with the restrictions documented in RawTiffImageReader javadoc, otherwise the standard TIFF image reader will be selected instead.

Specified by:
onRegistration in interface RegisterableService
Overrides:
onRegistration in class IIOServiceProvider
Parameters:
registry - The registry where is service is registered.
category - The category for which this service is registered.


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