org.geotoolkit.parameter
Class ImagingParameterDescriptors

Object
  extended by FormattableObject
      extended by AbstractIdentifiedObject
          extended by AbstractParameterDescriptor
              extended by DefaultParameterDescriptorGroup
                  extended by ImagingParameterDescriptors
All Implemented Interfaces:
Serializable, Deprecable, LenientComparable, Formattable, GeneralParameterDescriptor, ParameterDescriptorGroup, IdentifiedObject

@Immutable
public class ImagingParameterDescriptors
extends DefaultParameterDescriptorGroup

Wraps a JAI's ParameterListDescriptor. This adaptor is provided for inter-operability with Java Advanced Imaging. A JAI parameter list descriptor is part of an operation descriptor. This adaptor make it easier to access parameters for a JAI operation through the general GeoAPI parameters framework.

Since:
2.2
Version:
3.18
Author:
Martin Desruisseaux (IRD, Geomatys)
See Also:
Serialized Form
Module:
coverage/geotk-coverage (download)    View source code for this class

Field Summary
static Map<Class<?>,Class<?>> DEFAULT_SOURCE_TYPE_MAP
          The default source type map as a (RenderedImage.class, GridCoverage.class) key-value pair.
protected  ParameterListDescriptor descriptor
          The Java Advanced Imaging parameter descriptor.
protected  RegistryElementDescriptor operation
          The JAI's operation descriptor, or null if none.
protected  String registryMode
          The registry mode, usually "rendered".
 
Fields inherited from interface IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
 
Constructor Summary
ImagingParameterDescriptors(Map<String,?> properties, ParameterListDescriptor descriptor)
          Constructs a parameter descriptor wrapping the specified JAI parameter list descriptor.
ImagingParameterDescriptors(Map<String,?> properties, RegistryElementDescriptor operation, String registryMode, Map<Class<?>,Class<?>> sourceTypeMap, Collection<ParameterDescriptor<?>> extension)
          Constructs a parameter descriptor wrapping the specified JAI operation, including sources.
ImagingParameterDescriptors(RegistryElementDescriptor operation)
          Constructs a parameter descriptor wrapping the specified JAI operation, including sources.
ImagingParameterDescriptors(RegistryElementDescriptor operation, Collection<ParameterDescriptor<?>> extension)
          Constructs a parameter descriptor wrapping the specified JAI operation, including sources.
 
Method Summary
protected  int computeHashCode()
          Computes a hash value for this identified object.
 ParameterValueGroup createValue()
          Creates a new instance of parameter value group.
 boolean equals(Object object, ComparisonMode mode)
          Compares the specified object with this parameter group for equality.
static Map<String,Object> properties(RegistryElementDescriptor operation)
          Infers from the specified JAI operation a set of properties that can be given to the constructor.
 
Methods inherited from class DefaultParameterDescriptorGroup
descriptor, descriptors, getMaximumOccurs, toString
 
Methods inherited from class AbstractParameterDescriptor
formatWKT, getMinimumOccurs
 
Methods inherited from class AbstractIdentifiedObject
equals, getAlias, getIdentifier, getIdentifiers, getName, getName, getRemarks, hashCode, isDeprecated, nameMatches
 
Methods inherited from class FormattableObject
print, toWKT, toWKT
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface GeneralParameterDescriptor
getMinimumOccurs
 
Methods inherited from interface IdentifiedObject
getAlias, getIdentifiers, getName, getRemarks, toWKT
 

Field Detail

DEFAULT_SOURCE_TYPE_MAP

public static final Map<Class<?>,Class<?>> DEFAULT_SOURCE_TYPE_MAP
The default source type map as a (RenderedImage.class, GridCoverage.class) key-value pair. This is the default argument for wrapping a JAI operation in the "rendered" registry mode.


registryMode

protected final String registryMode
The registry mode, usually "rendered". This field is null if operation is null.


operation

protected final RegistryElementDescriptor operation
The JAI's operation descriptor, or null if none. This is usually an instance of OperationDescriptor, but this is not strictly required.


descriptor

protected final ParameterListDescriptor descriptor
The Java Advanced Imaging parameter descriptor. If operation is non-null, then this attribute is defined by RegistryElementDescriptor.getParameterListDescriptor(java.lang.String).

Constructor Detail

ImagingParameterDescriptors

public ImagingParameterDescriptors(RegistryElementDescriptor operation)
Constructs a parameter descriptor wrapping the specified JAI operation, including sources. The name for this parameter group will be inferred from the name of the supplied registry element using the properties method.

The source type map default to a (RenderedImage.class, GridCoverage.class) key-value pair and the registry mode default to "rendered".

Parameters:
operation - The JAI's operation descriptor, usually as an instance of OperationDescriptor.

ImagingParameterDescriptors

public ImagingParameterDescriptors(RegistryElementDescriptor operation,
                                   Collection<ParameterDescriptor<?>> extension)
Constructs a parameter descriptor wrapping the specified JAI operation, including sources. The name for this parameter group will be inferred from the name of the supplied registry element using the properties method.

The source type map default to a (RenderedImage.class, GridCoverage.class) key-value pair and the registry mode default to "rendered".

Parameters:
operation - The JAI's operation descriptor, usually as an instance of OperationDescriptor.
extension - Additional parameters to put in this descriptor, or null if none. If a parameter has the same name than an operation parameter, then the extension overrides the later.
Since:
2.4

ImagingParameterDescriptors

public ImagingParameterDescriptors(Map<String,?> properties,
                                   RegistryElementDescriptor operation,
                                   String registryMode,
                                   Map<Class<?>,Class<?>> sourceTypeMap,
                                   Collection<ParameterDescriptor<?>> extension)
Constructs a parameter descriptor wrapping the specified JAI operation, including sources. The properties map is given unchanged to the super-class constructor.

Parameters:
properties - Set of properties. Should contains at least "name".
operation - The JAI's operation descriptor, usually as an instance of OperationDescriptor.
registryMode - The JAI's registry mode (usually "rendered").
sourceTypeMap - Mapping from JAI source type to this group source type. Typically a singleton with the (RenderedImage.class, GridCoverage.class) key-value pair.
extension - Additional parameters to put in this descriptor, or null if none. If a parameter has the same name than an operation parameter, then the extension overrides the later.
Since:
2.4

ImagingParameterDescriptors

public ImagingParameterDescriptors(Map<String,?> properties,
                                   ParameterListDescriptor descriptor)
Constructs a parameter descriptor wrapping the specified JAI parameter list descriptor. The properties map is given unchanged to the super-class constructor.

Parameters:
properties - Set of properties. Should contains at least "name".
descriptor - The JAI descriptor.
Method Detail

properties

public static Map<String,Object> properties(RegistryElementDescriptor operation)
Infers from the specified JAI operation a set of properties that can be given to the constructor. The returned map includes values (when available) for the following keys:

Key Inferred from
NAME_KEY descriptor name
ALIAS_KEY "Vendor" (for the scope) and "LocalName" resources
AUTHORITY_KEY JAI or Geotoolkit.org inferred from the vendor, extended with "DocURL" resources as contact information.
VERSION_KEY "Version" resources
REMARKS_KEY "Description" resources

For JAI image operation (for example "Add", the end result is fully-qualified name like "JAI:Add" and one alias like "com.sun.media.jai.Add".

This method returns a modifiable map. Users can safely changes its content in order to select for example a different name.

Parameters:
operation - The JAI operation from which to infer a set of properties.
Returns:
A set of properties that can be given to the constructor.

createValue

public ParameterValueGroup createValue()
Creates a new instance of parameter value group. A JAI ParameterList is created for holding parameter values, and wrapped into an ImagingParameters instance.

Specified by:
createValue in interface GeneralParameterDescriptor
Specified by:
createValue in interface ParameterDescriptorGroup
Overrides:
createValue in class DefaultParameterDescriptorGroup
Returns:
The new value initialized to the default value.

equals

public boolean equals(Object object,
                      ComparisonMode mode)
Compares the specified object with this parameter group for equality.

Specified by:
equals in interface LenientComparable
Overrides:
equals in class DefaultParameterDescriptorGroup
Parameters:
object - The object to compare to this.
mode - STRICT for performing a strict comparison, or IGNORE_METADATA for comparing only properties relevant to transformations.
Returns:
true if both objects are equal.
See Also:
Utilities.deepEquals(Object, Object, ComparisonMode)

computeHashCode

protected int computeHashCode()
Computes a hash value for this identified object. This method is invoked by AbstractIdentifiedObject.hashCode() when first needed.

Implementation specific feature
In the Geotk implementation, the name, identifiers and remarks are not used for hash code computation. Consequently two identified objects will return the same hash value if they are equal in the sense of equals(…, ComparisonMode.IGNORE_METADATA). This feature allows users to implement metadata-insensitive HashMap.

Overrides:
computeHashCode in class DefaultParameterDescriptorGroup
Returns:
The hash code value. This value may change between different execution of the Geotk library.


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