org.geotools.gce.image
Class WorldImageFormat

Object
  extended by AbstractGridFormat
      extended by WorldImageFormat
All Implemented Interfaces:
Format

public final class WorldImageFormat
extends AbstractGridFormat
implements Format

A Format to allow discovery of Readers/Writers for raster images that support world files containing information about the image. Supports gif+gfw, jpg/jpeg+jgw, tif/tiff+tfw and png+pgw. wld may be used in place of the format specific extension (jpg+wld, etc) Designed to be used with GridCoverageExchange.

Author:
Simone Giannecchini
Module:

Field Summary
static ParameterDescriptor<String> FORMAT
          Format writing parameter.
 
Fields inherited from class AbstractGridFormat
GEOTOOLS_WRITE_PARAMS, mInfo, OVERVIEW_POLICY, READ_GRIDGEOMETRY2D, readParameters, USE_JAI_IMAGEREAD, writeParameters
 
Constructor Summary
WorldImageFormat()
          WorldImageFormat
 
Method Summary
 boolean accepts(Object input)
          Takes the input and determines if it is a class that we can understand and then futher checks the format of the class to make sure we can read/write to it.
 GeoToolsWriteParams getDefaultImageIOWriteParameters()
          Always returns null since for the moment there are no GeoToolsWriteParams availaible for this format.
 WorldImageReader getReader(Object source)
          Retrieves a WorldImageReader in case the providede source can be accepted as a valid source for a world image.
 WorldImageReader getReader(Object source, Hints hints)
          Retrieves a WorldImageReader in case the providede source can be accepted as a valid source for a world image.
static Set<String> getWorldExtension(String fileExtension)
          Takes an image file extension (such as .gif, including the '.') and returns it's corresponding world file extension (such as .gfw).
 GridCoverageWriter getWriter(Object destination)
          Call the accepts() method before asking for a writer to determine if the current object is supported.
 GridCoverageWriter getWriter(Object destination, Hints hints)
          Call the accepts() method before asking for a writer to determine if the current object is supported.
 
Methods inherited from class AbstractGridFormat
equals, getDefaultCRS, getDescription, getDocURL, getName, getReadParameters, getVendor, getVersion, getWriteParameters
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface Format
getDescription, getDocURL, getName, getReadParameters, getVendor, getVersion, getWriteParameters
 

Field Detail

FORMAT

public static final ParameterDescriptor<String> FORMAT
Format writing parameter. When writing a world image we need to provide an output format in which we want to encode the image itself. PNG is default output format.

Constructor Detail

WorldImageFormat

public WorldImageFormat()
WorldImageFormat

Method Detail

getReader

public WorldImageReader getReader(Object source)
Retrieves a WorldImageReader in case the providede source can be accepted as a valid source for a world image. The method returns null otherwise.

Specified by:
getReader in class AbstractGridFormat
Parameters:
source - The source object to read a WorldImage from
Returns:
a new WorldImageReader for the source

getWriter

public GridCoverageWriter getWriter(Object destination)
Call the accepts() method before asking for a writer to determine if the current object is supported.

Specified by:
getWriter in class AbstractGridFormat
Parameters:
destination - the destination object to write a WorldImage to
Returns:
a new WorldImageWriter for the destination

getWriter

public GridCoverageWriter getWriter(Object destination,
                                    Hints hints)
Call the accepts() method before asking for a writer to determine if the current object is supported.

Parameters:
destination - the destination object to write a WorldImage to
Returns:
a new WorldImageWriter for the destination

accepts

public boolean accepts(Object input)
Takes the input and determines if it is a class that we can understand and then futher checks the format of the class to make sure we can read/write to it.

Specified by:
accepts in class AbstractGridFormat
Parameters:
input - The object to check for acceptance.
Returns:
true if the input is acceptable, false otherwise

getWorldExtension

public static Set<String> getWorldExtension(String fileExtension)
Takes an image file extension (such as .gif, including the '.') and returns it's corresponding world file extension (such as .gfw).

Parameters:
fileExtension - an image file extension, including the '.'
Returns:
a corresponding Set of world file extensions, including the '.'

getReader

public WorldImageReader getReader(Object source,
                                  Hints hints)
Retrieves a WorldImageReader in case the providede source can be accepted as a valid source for a world image. The method returns null otherwise.

Specified by:
getReader in class AbstractGridFormat
Parameters:
source - The source object to read a WorldImage from
hints - Hints to control the provided WorldImageReader.
Returns:
a new WorldImageReader for the source

getDefaultImageIOWriteParameters

public GeoToolsWriteParams getDefaultImageIOWriteParameters()
Always returns null since for the moment there are no GeoToolsWriteParams availaible for this format.

Specified by:
getDefaultImageIOWriteParameters in class AbstractGridFormat
Returns:
always null.


Copyright © 1996-2010 Geotools. All Rights Reserved.