|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface provides a comprehensive description of a specific
image operation. All information regarding the operation, such as
its name, version, input, and properties should be listed. Any
conditions placed on the operation, such as its source class types and
legal parameter range, should also be included, and the methods to
enforce these conditions should be implemented. A set of
PropertyGenerator
s may be specified to be used as a
basis for the operation's property management.
Each image operation in JAI must have a descriptor that implements this interface. The following basic resource data must be provided:
Locale
s. OperationRegistry
.
Furthermore, it is recommended that a detailed description of the
operation's functionality be included in the class comments.
JAI currently knows about the following operation modes :
"rendered", "renderable", "collection" and "renderableCollection"
(these form a subset of the known registry modes returned by
RegistryMode.getModes()
). All mode names are dealt
with in a case insensitive (but retentive) manner. All modes have
to accept the same number of source images and the same number of
parameters. All the source names and parameter names are also the
same across all modes. The class types of the sources and parameters
can be different for each mode.
For example an operation supporting the "rendered" mode
takes RenderedImage
s as its sources, can only
be used in a rendered operation chain, and produces a
RenderedImage
. An operation supporting the renderable
mode takes RenderableImage
s as its sources, can
only be used in a renderable operation chain, and produces a
RenderableImage
.
JAI
,
OperationDescriptorImpl
Field Summary | |
static Object |
NO_PARAMETER_DEFAULT
An Object that signifies that
a parameter has no default value. |
Method Summary | |
Class |
getDestClass()
Deprecated. as of JAI 1.1 in favor of getDestClass("rendered") |
Class |
getDestClass(String modeName)
Returns a Class that describes the type of
destination this operation produces for the specified mode. |
Object |
getInvalidRegion(String registryModeName,
ParameterBlock oldParamBlock,
RenderingHints oldHints,
ParameterBlock newParamBlock,
RenderingHints newHints,
OperationNode node)
Calculates the region over which two distinct renderings of an operation may be expected to differ. |
int |
getNumParameters()
Deprecated. as of JAI 1.1 in favor of
getParameterListDescriptor(modeName).getNumParameters()
This will for the time being return the above value for
modeName = getSupportedModes()[0] |
int |
getNumSources()
Returns the number of sources required by this operation. |
Class[] |
getParamClasses()
Deprecated. as of JAI 1.1 in favor of
getParameterListDescriptor(modeName).getParamClasses()
This will for the time being return the above value for
modeName = getSupportedModes()[0] |
Object[] |
getParamDefaults()
Deprecated. as of JAI 1.1 in favor of
getParameterListDescriptor(modeName).getParamDefaults()
This will for the time being return the above value for
modeName = getSupportedModes()[0] |
Object |
getParamDefaultValue(int index)
Deprecated. as of JAI 1.1 in favor of
getParameterListDescriptor(modeName).getParamDefaultValue()
This will for the time being return the above value for
modeName = getSupportedModes()[0] |
Number |
getParamMaxValue(int index)
Deprecated. as of JAI 1.1 in favor of
getParameterListDescriptor(modeName).getParamValueRange()
This will for the time being return "getMaxValue" of the above
return value for modeName = getSupportedModes()[0] |
Number |
getParamMinValue(int index)
Deprecated. as of JAI 1.1 in favor of
getParameterListDescriptor(modeName).getParamValueRange()
This will for the time being return "getMinValue" of the above
return value for modeName = getSupportedModes()[0] |
String[] |
getParamNames()
Deprecated. as of JAI 1.1 in favor of
getParameterListDescriptor(modeName).getParamNames()
This will for the time being return the above value for
modeName = getSupportedModes()[0] |
PropertyGenerator[] |
getPropertyGenerators()
Deprecated. as of JAI 1.1 in favor of the equivalent method that specifies the mode name. |
Class |
getRenderableDestClass()
Deprecated. as of JAI 1.1 in favor of getDestClass("renderable") |
Class[] |
getRenderableSourceClasses()
Deprecated. as of JAI 1.1 in favor of getSourceClasses("renderable") |
ResourceBundle |
getResourceBundle(Locale locale)
Returns the resource data for this operation in the specified Locale in a ResourceBundle . |
String[][] |
getResources(Locale locale)
Returns the resource data for this operation in the specified Locale . |
Class[] |
getSourceClasses()
Deprecated. as of JAI 1.1 in favor of getSourceClasses("rendered") |
Class[] |
getSourceClasses(String modeName)
Returns an array of Class es that describe the types
of sources required by this operation for the specified mode. |
String[] |
getSourceNames()
Returns an array of String s that are the names
of the sources of this operation. |
boolean |
isImmediate()
Returns true if the operation should be computed
immediately for all supported modes of this operation during
the call to JAI.create() ; that is, the operation
is placed in immediate mode. |
boolean |
isRenderableSupported()
Deprecated. as of JAI 1.1 in favor of isModeSupported("renderable") |
boolean |
isRenderedSupported()
Deprecated. as of JAI 1.1 in favor of isModeSupported("rendered") |
boolean |
validateArguments(ParameterBlock args,
StringBuffer msg)
Deprecated. as of JAI 1.1 in favor of validateArguments("rendered", ...) |
boolean |
validateArguments(String modeName,
ParameterBlock args,
StringBuffer msg)
Returns true if this operation/mode is capable of
handling the input source(s) and/or parameter(s)
specified in the ParameterBlock , or
false otherwise, in which case an explanatory
message may be appended to the StringBuffer . |
boolean |
validateRenderableArguments(ParameterBlock args,
StringBuffer msg)
Deprecated. as of JAI 1.1 in favor of validateArguments("renderable", ...) |
Methods inherited from interface javax.media.jai.RegistryElementDescriptor |
arePropertiesSupported,
getName,
getParameterListDescriptor,
getPropertyGenerators,
getSupportedModes,
isModeSupported |
Field Detail |
public static final Object NO_PARAMETER_DEFAULT
Object
that signifies that
a parameter has no default value. Same as
ParameterListDescriptor.NO_PARAMETER_DEFAULT
Method Detail |
public String[][] getResources(Locale locale)
Locale
. It must contain String
data
for the following tags:
Locale
s. String
data for the
following tags when appropriate:
locale
- The Locale
for which the information
should be localized. It may be different from the default
Locale
.String
s containing
the mandatory and optional resource tags and their
corresponding resource data. (String[i][0] is
the tag for the i-th resource and String[i][1] is the
corresponding data)public ResourceBundle getResourceBundle(Locale locale)
Locale
in a ResourceBundle
. The
resource data values are taken from the
getResources()
method which must be implemented
by each operation descriptor.locale
- The Locale
for which the information
should be localized. It may be different from the default
Locale
.ResourceBundle
containing the mandatory
and optional resource information.public int getNumSources()
public Class[] getSourceClasses(String modeName)
Class
es that describe the types
of sources required by this operation for the specified mode.
If this operation has no sources, this method returns null
.modeName
- the operation mode namenull
or if it is not one of the supported modes.public String[] getSourceNames()
String
s that are the names
of the sources of this operation. If this operation has no
sources, this method returns null
.public Class getDestClass(String modeName)
Class
that describes the type of
destination this operation produces for the specified mode.modeName
- the operation mode namenull
or if it is not one of the supported modes.public boolean validateArguments(String modeName, ParameterBlock args, StringBuffer msg)
true
if this operation/mode is capable of
handling the input source(s) and/or parameter(s)
specified in the ParameterBlock
, or
false
otherwise, in which case an explanatory
message may be appended to the StringBuffer
.
This method is the standard place where input arguments are
validated against this operation's specification for the specified
mode. It is called by JAI.create()
as a part of its
validation process. Thus it is strongly recommended that the
application programs use the JAI.create()
methods to
instantiate all the rendered operations.
This method sets all the undefined parameters in the
ParameterBlock
to their default values, if the default
values are specified.
Note that DeferredData
parameters will not be
recognized as valid unless the parameter is defined to have class
DeferredData.class
.
modeName
- the operation mode nameargs
- Input arguments, including source(s) and/or parameter(s).msg
- A string that may contain error messages.null
public boolean isImmediate()
true
if the operation should be computed
immediately for all supported modes of this operation during
the call to JAI.create()
; that is, the operation
is placed in immediate mode. If true
, and
the computation fails, null
will be returned
from JAI.create()
. If false
,
JAI.create()
will return an instance of the
appropriate destination class that may be asked to compute itself
at a later time; this computation may fail at that time.
Operations that rely on an external resource, such as
a source file, or that produce externally-visible side
effects, such as writing to an output file, should return
true
from this method. Operations that rely
only on their sources and parameters usually wish to return
false
in order to defer rendering as long as
possible.
public Object getInvalidRegion(String registryModeName, ParameterBlock oldParamBlock, RenderingHints oldHints, ParameterBlock newParamBlock, RenderingHints newHints, OperationNode node)
The class of the returned object will vary as a function of
the mode of the operation. For rendered and renderable two-
dimensional images this should be an instance of a class which
implements java.awt.Shape
.
registryModeName
- The name of the mode.oldParamBlock
- The previous sources and parameters.oldHints
- The previous hints.newParamBlock
- The current sources and parameters.newHints
- The current hints.node
- The affected node in the processing chain.null
if there is no common region of validity. If an empty
java.awt.Shape
is returned, this indicates
that all pixels within the bounds of the old rendering
remain valid.registryModeName
is null
or if the operation requires either
sources or parameters and either oldParamBlock
or newParamBlock
is null
.oldParamBlock
or
newParamBlock
do not contain sufficient sources
or parameters for the operation in question.public PropertyGenerator[] getPropertyGenerators()
PropertyGenerator
s implementing
the property inheritance for this operation. They may be used
as a basis for the operation's property management.PropertyGenerator
s, or
null
if this operation does not have any of
its own PropertyGenerator
s.public boolean isRenderedSupported()
isModeSupported("rendered")
true
if this operation supports the rendered
image mode. That is, it may be performed on RenderedImage
sources in a rendered operation chain, and produces a rendered result.
The JAI.create()
and the
JAI.createCollection()
methods should be used to
instantiate the operation.
If this method returns true
, all the additional
methods that supply the rendered mode information must be
implemented.
public Class[] getSourceClasses()
getSourceClasses("rendered")
Class
es that describe the types
of sources required by this operation in the rendered image mode.
If this operation has no source, this method returns null
.public Class getDestClass()
getDestClass("rendered")
Class
that describes the type of
destination this operation produces in the rendered image
mode. Currently JAI supports two destination class types:
java.awt.image.RenderedImage.class
and
java.util.Collection.class
.public boolean validateArguments(ParameterBlock args, StringBuffer msg)
validateArguments("rendered", ...)
true
if this operation is capable of
handling the input rendered source(s) and/or parameter(s)
specified in the ParameterBlock
, or
false
otherwise, in which case an explanatory
message may be appended to the StringBuffer
.
This method is the standard place where input arguments are
validated against this operation's specification for the rendered
mode. It is called by JAI.create()
as a part of its
validation process. Thus it is strongly recommended that the
application programs use the JAI.create()
methods to
instantiate all the rendered operations.
This method sets all the undefined parameters in the
ParameterBlock
to their default values, if the default
values are specified.
Note that DeferredData
parameters will not be
recognized as valid unless the parameter is defined to have class
DeferredData.class
.
args
- Input arguments, including source(s) and/or parameter(s).msg
- A string that may contain error messages.public boolean isRenderableSupported()
isModeSupported("renderable")
true
if this operation supports the renderable
image mode. That is, it may be performed on RenderableImage
sources in a renderable operation chain, and produces a renderable
result. The JAI.createRenderable()
and the
JAI.createCollection()
methods should be used to
instantiate the operation.
If this method returns true
, all the additional
methods that supply the renderable mode information must be
implemented.
public Class[] getRenderableSourceClasses()
getSourceClasses("renderable")
Class
es that describe the types
of sources required by this operation in the renderable image mode.
If this operation does not support the renderable mode, or if it
has no source, this method returns null
.public Class getRenderableDestClass()
getDestClass("renderable")
Class
that describes the type of
destination this operation produces in the renderable image
mode. Currently JAI supports two destination class types:
java.awt.image.renderable.RenderableImage.class
and
java.util.Collection.class
.public boolean validateRenderableArguments(ParameterBlock args, StringBuffer msg)
validateArguments("renderable", ...)
true
if this operation is capable of handling
the input renderable source(s) and/or parameter(s) specified
in the ParameterBlock
, or false
otherwise, in which case an explanatory message may be appended
to the StringBuffer
.
This method is the standard place where input arguments are
validated against this operation's specification for the renderable
mode. It is called by JAI.createRenderable()
as a
part of its validation process. Thus it is strongly recommended
that the application programs use the
JAI.createRenderable()
method to instantiate all
the renderable operations.
This method sets all the undefined parameters in the
ParameterBlock
to their default values, if the default
values are specified.
Note that DeferredData
parameters will not be
recognized as valid unless the parameter is defined to have class
DeferredData.class
.
If this operation does not support the renderable mode,
this method returns false
regardless of the input
arguments
args
- Input arguments, including source(s) and/or parameter(s).msg
- A string that may contain error messages.public int getNumParameters()
getParameterListDescriptor(modeName).getNumParameters()
This will for the time being return the above value for
modeName = getSupportedModes()[0]
public Class[] getParamClasses()
getParameterListDescriptor(modeName).getParamClasses()
This will for the time being return the above value for
modeName = getSupportedModes()[0]
Class
es that describe the types
of parameters required by this operation. If this operation
has no parameter, this method returns null
.public String[] getParamNames()
getParameterListDescriptor(modeName).getParamNames()
This will for the time being return the above value for
modeName = getSupportedModes()[0]
String
s that are the localized
parameter names of this operation. If this operation has no
parameter, this method returns null
.public Object[] getParamDefaults()
getParameterListDescriptor(modeName).getParamDefaults()
This will for the time being return the above value for
modeName = getSupportedModes()[0]
Object
s that define the default
values of the parameters for this operation. Default values may
be null
. When instantiating the operation, the
default values may be used for those parameters whose values are
not supplied. The NO_PARAMETER_DEFAULT
static
Object
indicates that a parameter has no default
value. If this operation has no parameter, this method returns
null
.public Object getParamDefaultValue(int index)
getParameterListDescriptor(modeName).getParamDefaultValue()
This will for the time being return the above value for
modeName = getSupportedModes()[0]
null
. If a parameter has no default
value, this method returns NO_PARAMETER_DEFAULT
.index
- The index of the parameter whose default
value is queried.index
.public Number getParamMinValue(int index)
getParameterListDescriptor(modeName).getParamValueRange()
This will for the time being return "getMinValue" of the above
return value for modeName = getSupportedModes()[0]
null
.
The return value should be of the class type appropriate for
the parameter's type, that is, Byte
for a
byte
parameter, Integer
for an
int
parameter, and so forth.
index
- The index of the numeric parameter whose minimum
value is queried.Number
representing the minimum legal value
of the queried parameter, or null
.index
.public Number getParamMaxValue(int index)
getParameterListDescriptor(modeName).getParamValueRange()
This will for the time being return "getMaxValue" of the above
return value for modeName = getSupportedModes()[0]
null
.
The return value should be of the class type appropriate for
the parameter's type, that is, Byte
for a
byte
parameter, Integer
for an
int
parameter, and so forth.
index
- The index of the numeric parameter whose maximum
value is queried.Number
representing the maximum legal value
of the queried parameter, or null
.index
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |