| java.lang.Object javax.media.jai.registry.TileEncoderRegistry
TileEncoderRegistry | final public class TileEncoderRegistry (Code) | | Utility class to provide type-safe interaction with the
OperationRegistry for TileEncoderFactory objects.
If the OperationRegistry specified as an argument to the
methods in this class is null, then JAI.getOperationRegistry()
will be used.
since: JAI 1.1 |
Method Summary | |
public static void | clearPreferences(OperationRegistry registry, String formatName, String productName) Clears all preferences set for registered TileEncoderFactory s
under the given formatName and productName in the given
OperationRegistry .
Parameters: registry - The OperationRegistry to clearpreferences from. Parameters: formatName - The format name to clear preferences under. Parameters: productName - The productName to clear preferences under. throws: IllegalArgumentException - if formatName is null. throws: IllegalArgumentException - if productName is null. | public static TileEncoder | create(OperationRegistry registry, String formatName, OutputStream output, TileCodecParameterList paramList, SampleModel sampleModel) Creates a TileEncoder for the specified format that is
capable of handling the supplied arguments. | public static void | encode(OperationRegistry registry, String formatName, Raster raster, OutputStream output, TileCodecParameterList param) Encodes the given Raster using the given formatName and
TileCodecParameterList and writes the encoded data to the
specified OutputStream . | public static TileEncoderFactory | get(OperationRegistry registry, String formatName) Returns the the most preferred TileEncoderFactory
object registered against the given format name. | public static Iterator | getIterator(OperationRegistry registry, String formatName) Returns an Iterator over all
TileEncoderFactory objects registered under the
given format name over all products. | public static List | getOrderedList(OperationRegistry registry, String formatName, String productName) Returns a List of the TileEncoderFactory s registered
in the given OperationRegistry under the given
formatName and productName, in an ordering that satisfies
all of the pairwise preferences that have been set. | public static void | register(OperationRegistry registry, String formatName, String productName, TileEncoderFactory tef) Registers the given TileEncoderFactory with the given
OperationRegistry under the given formatName and
productName.
Parameters: registry - The OperationRegistry to register the TileEncoderFactory with. Parameters: formatName - The formatName to register the TileEncoderFactory under. Parameters: productName - The productName to register the TileEncoderFactory under. Parameters: tef - The TileEncoderFactory to register. throws: IllegalArgumentException - if formatName is null. throws: IllegalArgumentException - if productName is null. throws: IllegalArgumentException - if tef is null. | public static void | setPreference(OperationRegistry registry, String formatName, String productName, TileEncoderFactory preferredTEF, TileEncoderFactory otherTEF) Sets a preference between the given two TileEncoderFactory
objects in the given OperationRegistry under the given
formatName and productName.
Parameters: registry - The OperationRegistry to setpreferences on. Parameters: formatName - The formatName of the twoTileEncoderFactory s. Parameters: productName - The productName of the twoTileEncoderFactory s. Parameters: preferredTEF - The preferred TileEncoderFactory . Parameters: otherTEF - The other TileEncoderFactory . throws: IllegalArgumentException - if formatName is null. throws: IllegalArgumentException - if productName is null. throws: IllegalArgumentException - if preferredTEF is null. throws: IllegalArgumentException - if otherTEF is null. | public static void | unregister(OperationRegistry registry, String formatName, String productName, TileEncoderFactory tef) Unregisters the given TileEncoderFactory previously
registered under the given formatName and productName in the given
OperationRegistry .
Parameters: registry - The OperationRegistry to unregister the TileEncoderFactory from. Parameters: formatName - The formatName to unregister theTileEncoderFactory from. Parameters: productName - The productName to unregister theTileEncoderFactory from. Parameters: tef - The TileEncoderFactory to unregister. throws: IllegalArgumentException - if formatName is null. throws: IllegalArgumentException - if productName is null. throws: IllegalArgumentException - if tef is null. | public static void | unsetPreference(OperationRegistry registry, String formatName, String productName, TileEncoderFactory preferredTEF, TileEncoderFactory otherTEF) Unsets a preference previously set amongst the given two
TileEncoderFactory objects in the given
OperationRegistry under the given formatName and productName.
Parameters: registry - The OperationRegistry to unsetpreferences on. Parameters: formanName - The formatName of the twoTileEncoderFactory s. Parameters: productName - The productName of the twoTileEncoderFactory s. Parameters: preferredTEF - The preferred TileEncoderFactory . Parameters: otherTEF - The other TileEncoderFactory . throws: IllegalArgumentException - if formatName is null. throws: IllegalArgumentException - if productName is null. throws: IllegalArgumentException - if preferredTEF is null. throws: IllegalArgumentException - if otherTEF is null. |
clearPreferences | public static void clearPreferences(OperationRegistry registry, String formatName, String productName)(Code) | | Clears all preferences set for registered TileEncoderFactory s
under the given formatName and productName in the given
OperationRegistry .
Parameters: registry - The OperationRegistry to clearpreferences from. Parameters: formatName - The format name to clear preferences under. Parameters: productName - The productName to clear preferences under. throws: IllegalArgumentException - if formatName is null. throws: IllegalArgumentException - if productName is null. throws: IllegalArgumentException - if there is no TileCodecDescriptor registered against the given formatName . |
create | public static TileEncoder create(OperationRegistry registry, String formatName, OutputStream output, TileCodecParameterList paramList, SampleModel sampleModel)(Code) | | Creates a TileEncoder for the specified format that is
capable of handling the supplied arguments.
The preferences set amongst the TileEncoderFactory
objects registered with the OperationRegistry are used
to select the most prefered TileEncoderFactory whose
createEncoder() method returns a non-null value.
Since this class is a simple type-safe wrapper around
OperationRegistry 's type-unsafe methods, no additional
argument validation is performed in this method. Thus errors/exceptions
may occur if incorrect values are provided for the input arguments.
Exceptions thrown by the TileEncoderFactory s used to
create the TileEncoder will be caught by this method
and will not be propagated.
Parameters: registry - The OperationRegistry to use to createthe TileEncoder . Parameters: formatName - The format for which the TileEncoder isto be created. Parameters: output - The OutputStream to write encoded data to. Parameters: paramList - The object containing the tile encoding parameters. Parameters: sampleModel - The SampleModel of the Raster to be encoded. throws: IllegalArgumentException - if formatName is null. throws: IllegalArgumentException - if there is no TileCodecDescriptor registered against the given formatName . |
encode | public static void encode(OperationRegistry registry, String formatName, Raster raster, OutputStream output, TileCodecParameterList param) throws IOException(Code) | | Encodes the given Raster using the given formatName and
TileCodecParameterList and writes the encoded data to the
specified OutputStream .
The TileEncoder which performs the encoding is the
one created from the most prefered TileEncoderFactory
whose create method returns a non-null result. If
there are no TileEncoder objects that can encode
the specified Raster according to the encoding
parameters supplied, nothing will be written to the specified
OutputStream .
If the specified TileCodecParameterList is null, the
default TileCodecParameterList retrieved by the specific
TileEncoder.getDefaultParameters() method for the
"tileEncoder" registry mode will be used.
If multiple tiles are to be encoded to the same
OutputStream in the same format using the same
TileCodecParameterList , it is advisable to create a
TileEncoder object and use the encode() method
on this encoder to encode each tile, thus creating and using only a
single TileEncoder object. The encode()
method on TileEncoderRegistry creates a new
TileEncoder object each time it is called.
Since this class is a simple type-safe wrapper around
OperationRegistry 's type-unsafe methods, no additional
argument validation is performed in this method. Thus errors/exceptions
may occur if incorrect values are provided for the input arguments.
Exceptions thrown by the TileEncoderFactory s used to
create the TileEncoder will be caught by this method
and will not be propagated.
Parameters: registry - The OperationRegistry to use to createthe TileEncoder . Parameters: formatName - The name of the format to encode the data in. Parameters: raster - The Raster to be encoded. Parameters: output - The OutputStream to write the encodeddata to. Parameters: param - The TileCodecParameterList to be used. throws: IllegalArgumentException - if formatName is null. throws: IOException - if an input/output error occurs during the encoding. throws: IllegalArgumentException - if there is no TileCodecDescriptor registered against the given formatName . The associated TileEncoder , or null . |
get | public static TileEncoderFactory get(OperationRegistry registry, String formatName)(Code) | | Returns the the most preferred TileEncoderFactory
object registered against the given format name. This
method will return the first TileEncoderFactory that
would be encountered by the Iterator returned by the
getIterator() method.
Parameters: registry - The OperationRegistry to use.If this is null , then JAI.getDefaultInstance().getOperationRegistry() will be used. Parameters: formatName - The format name as a String a registered TileEncoderFactory object throws: IllegalArgumentException - if formatName is null . throws: IllegalArgumentException - if there is no TileCodecDescriptor registered against the formatName |
getIterator | public static Iterator getIterator(OperationRegistry registry, String formatName)(Code) | | Returns an Iterator over all
TileEncoderFactory objects registered under the
given format name over all products. The order of the
TileEncoderFactory objects in the iteration will
be according to the pairwise preferences among products and
TileEncoderFactory objects within a product. The
remove() method of the Iterator
may not be implemented.
Parameters: registry - The OperationRegistry to use. Parameters: formatName - The format name. an Iterator over TileEncoderFactory objects. throws: IllegalArgumentException - if formatName is null throws: IllegalArgumentException - if there is noTileCodecDescriptor registered againstthe formatName . |
getOrderedList | public static List getOrderedList(OperationRegistry registry, String formatName, String productName)(Code) | | Returns a List of the TileEncoderFactory s registered
in the given OperationRegistry under the given
formatName and productName, in an ordering that satisfies
all of the pairwise preferences that have been set. Returns
null if cycles exist.
Parameters: registry - The OperationRegistry to clearpreferences from. Parameters: formatName - The format name to clear preferences under. Parameters: productName - The productName to clear preferences under. throws: IllegalArgumentException - if formatName is null. throws: IllegalArgumentException - if productName is null. throws: IllegalArgumentException - if there is no TileCodecDescriptor registered against the given formatName . |
register | public static void register(OperationRegistry registry, String formatName, String productName, TileEncoderFactory tef)(Code) | | Registers the given TileEncoderFactory with the given
OperationRegistry under the given formatName and
productName.
Parameters: registry - The OperationRegistry to register the TileEncoderFactory with. Parameters: formatName - The formatName to register the TileEncoderFactory under. Parameters: productName - The productName to register the TileEncoderFactory under. Parameters: tef - The TileEncoderFactory to register. throws: IllegalArgumentException - if formatName is null. throws: IllegalArgumentException - if productName is null. throws: IllegalArgumentException - if tef is null. throws: IllegalArgumentException - if there is no TileCodecDescriptor registered against the given formatName . |
setPreference | public static void setPreference(OperationRegistry registry, String formatName, String productName, TileEncoderFactory preferredTEF, TileEncoderFactory otherTEF)(Code) | | Sets a preference between the given two TileEncoderFactory
objects in the given OperationRegistry under the given
formatName and productName.
Parameters: registry - The OperationRegistry to setpreferences on. Parameters: formatName - The formatName of the twoTileEncoderFactory s. Parameters: productName - The productName of the twoTileEncoderFactory s. Parameters: preferredTEF - The preferred TileEncoderFactory . Parameters: otherTEF - The other TileEncoderFactory . throws: IllegalArgumentException - if formatName is null. throws: IllegalArgumentException - if productName is null. throws: IllegalArgumentException - if preferredTEF is null. throws: IllegalArgumentException - if otherTEF is null. throws: IllegalArgumentException - if there is no TileCodecDescriptor registered against the given formatName . throws: IllegalArgumentException - if either of the two tef'swas not previously registered against formatName and productName. |
unregister | public static void unregister(OperationRegistry registry, String formatName, String productName, TileEncoderFactory tef)(Code) | | Unregisters the given TileEncoderFactory previously
registered under the given formatName and productName in the given
OperationRegistry .
Parameters: registry - The OperationRegistry to unregister the TileEncoderFactory from. Parameters: formatName - The formatName to unregister theTileEncoderFactory from. Parameters: productName - The productName to unregister theTileEncoderFactory from. Parameters: tef - The TileEncoderFactory to unregister. throws: IllegalArgumentException - if formatName is null. throws: IllegalArgumentException - if productName is null. throws: IllegalArgumentException - if tef is null. throws: IllegalArgumentException - if there is no TileCodecDescriptor registered against the given formatName . throws: IllegalArgumentException - if the tef was not previouslyregistered against the given formatName and productName. |
unsetPreference | public static void unsetPreference(OperationRegistry registry, String formatName, String productName, TileEncoderFactory preferredTEF, TileEncoderFactory otherTEF)(Code) | | Unsets a preference previously set amongst the given two
TileEncoderFactory objects in the given
OperationRegistry under the given formatName and productName.
Parameters: registry - The OperationRegistry to unsetpreferences on. Parameters: formanName - The formatName of the twoTileEncoderFactory s. Parameters: productName - The productName of the twoTileEncoderFactory s. Parameters: preferredTEF - The preferred TileEncoderFactory . Parameters: otherTEF - The other TileEncoderFactory . throws: IllegalArgumentException - if formatName is null. throws: IllegalArgumentException - if productName is null. throws: IllegalArgumentException - if preferredTEF is null. throws: IllegalArgumentException - if otherTEF is null. throws: IllegalArgumentException - if there is no TileCodecDescriptor registered against the given formatName . throws: IllegalArgumentException - if either of the two tef'swas not previously registered against formatName and productName. |
|
|