org.geotoolkit.coverage.io
Class GridCoverageWriteParam

Object
  extended by GridCoverageStoreParam
      extended by GridCoverageWriteParam
All Implemented Interfaces:
Serializable

public class GridCoverageWriteParam
extends GridCoverageStoreParam

Describes how a stream is to be encoded. Instances of this class are used to supply information to instances of GridCoverageWriter.

Note: This class is conceptually equivalent to the ImageWriteParam class provided in the standard Java library. The main difference is that GridCoverageWriteParam works with geodetic coordinates while ImageWriteParam works with pixel coordinates.

Since:
3.14
Version:
3.15
Author:
Martin Desruisseaux (Geomatys)
See Also:
ImageWriteParam, Serialized Form
Module:
coverage/geotk-coverageio (download)    View source code for this class

Constructor Summary
GridCoverageWriteParam()
          Creates a new GridCoverageWriteParam instance.
GridCoverageWriteParam(GridCoverageStoreParam param)
          Creates a new GridCoverageWriteParam instance initialized to the same values than the given parameters.
 
Method Summary
 void clear()
          Resets all parameters to their null value.
 double[] getBackgroundValues()
          Returns the sample values to use for filling empty areas during reprojection, or null for the default.
 Float getCompressionQuality()
          Returns the compression quality as a value between 0 and 1, or null if not defined.
 String getFormatName()
          Returns the image format to use for fetching an ImageWriter, or null if unspecified.
 InterpolationMethod getInterpolation()
          Returns the interpolation method.
 void setBackgroundValues(double... values)
          Sets the sample values to use for filling empty areas during reprojection, or null for the default.
 void setCompressionQuality(Float quality)
          Sets the compression quality as a value between 0 and 1, or null for the default.
 void setFormatName(String name)
          Sets the image format to use for fetching an ImageWriter, or null if unspecified.
 void setInterpolation(InterpolationMethod method)
          Sets the interpolation method.
 
Methods inherited from class GridCoverageStoreParam
getCoordinateReferenceSystem, getEnvelope, getResolution, getSourceBands, setCoordinateReferenceSystem, setEnvelope, setEnvelope, setResolution, setSourceBands, toString
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GridCoverageWriteParam

public GridCoverageWriteParam()
Creates a new GridCoverageWriteParam instance. All properties are initialized to null. Callers must invoke setter methods in order to provide information about the way to encode the stream.


GridCoverageWriteParam

public GridCoverageWriteParam(GridCoverageStoreParam param)
Creates a new GridCoverageWriteParam instance initialized to the same values than the given parameters.

Parameters:
param - The parameters to copy, or null if none.
Since:
3.15
Method Detail

clear

public void clear()
Resets all parameters to their null value.

Overrides:
clear in class GridCoverageStoreParam

getFormatName

public String getFormatName()
Returns the image format to use for fetching an ImageWriter, or null if unspecified. If null, then the format while be inferred automatically from the output suffix.

Returns:
The format to use for fetching an ImageWriter, or null if unspecified.

setFormatName

public void setFormatName(String name)
Sets the image format to use for fetching an ImageWriter, or null if unspecified. If null, then the format while be inferred automatically from the output suffix.

Parameters:
name - The format to use for fetching an ImageWriter, or null if unspecified.

getCompressionQuality

public Float getCompressionQuality()
Returns the compression quality as a value between 0 and 1, or null if not defined. Value 0 stands for more compression, at the cost of either quality for lossy formats or speed for lossless formats.

Returns:
The compression quality, or null for the format-dependent default value.
Since:
3.15
See Also:
ImageWriteParam.getCompressionQuality()

setCompressionQuality

public void setCompressionQuality(Float quality)
                           throws IllegalArgumentException
Sets the compression quality as a value between 0 and 1, or null for the default. Value 0 stands for more compression, at the cost of either quality for lossy formats or speed for lossless formats.

Parameters:
quality - The compression quality, or null for the format-dependent default value.
Throws:
IllegalArgumentException - If the given value is not null but not in the [0…1] range.
Since:
3.15
See Also:
ImageWriteParam.setCompressionQuality(float)

getInterpolation

public InterpolationMethod getInterpolation()
Returns the interpolation method. The default value is nearest-neighbor.

Returns:
The interpolation method (never null).
Since:
3.15

setInterpolation

public void setInterpolation(InterpolationMethod method)
Sets the interpolation method. As a convenience, the null value is considered as synonymous to nearest-neighbor. We allow that because null can be interpreted as "no interpolation".

The InterpolationMethod.NEAREST_NEIGHBOUR method shall be supported by all writers. Other interpolation methods may or may not be supported on a case-by-case basis, but the BILINEAR and BICUBIC methods can be considered as typically supported for image writers backed by Java Advanced Imaging.

Parameters:
method - The interpolation method, or null for nearest-neighbor.
Since:
3.15

getBackgroundValues

public double[] getBackgroundValues()
Returns the sample values to use for filling empty areas during reprojection, or null for the default. If non-null, the array length shall be equals to the number of bands.

Returns:
The background values for each bands, or null for the default.
Since:
3.15

setBackgroundValues

public void setBackgroundValues(double... values)
Sets the sample values to use for filling empty areas during reprojection, or null for the default. If non-null, the array length shall be equals to the number of bands.

The values provided to this method will be casted to the appropriate type (typically byte) at writing time.

Parameters:
values - The background values for each bands, or null for the default.
Since:
3.15


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