|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.media.jai.OperationDescriptorImpl
javax.media.jai.operator.GradientMagnitudeDescriptor
public class GradientMagnitudeDescriptor
An OperationDescriptor
describing the "GradientMagnitude"
operation.
The "GradientMagnitude" operation is an edge detector which computes the magnitude of the image gradient vector in two orthogonal directions.
The result of the "GradientMagnitude" operation may be defined as:
dst[x][y][b] = ((SH(x,y,b))^2 + (SV(x,y,b))^2 )^0.5where SH(x,y,b) and SV(x,y,b) are the horizontal and vertical gradient images generated from band b of the source image by correlating it with the supplied orthogonal (horizontal and vertical) gradient masks. Origins set on the kernels will be ignored. The origins are assumed to be width/2 & height/2. It should be noted that this operation automatically adds a value of
Boolean.TRUE
for the
JAI.KEY_REPLACE_INDEX_COLOR_MODEL
to the given
configuration
so that the operation is performed
on the pixel values instead of being performed on the indices into
the color map if the source(s) have an IndexColorModel
.
This addition will take place only if a value for the
JAI.KEY_REPLACE_INDEX_COLOR_MODEL
has not already been
provided by the user. Note that the configuration
Map
is cloned before the new hint is added to it. The operation can be
smart about the value of the JAI.KEY_REPLACE_INDEX_COLOR_MODEL
RenderingHints
, i.e. while the default value for the
JAI.KEY_REPLACE_INDEX_COLOR_MODEL
is
Boolean.TRUE
, in some cases the operator could set the
default.
Name | Value |
---|---|
GlobalName | GradientMagnitude |
LocallName | GradientMagnitude |
Vendor | com.sun.media.jai |
Description | Performs gradient magnitude edge detection on an image. |
DocURL | http://java.sun.com/products/java-media/jai/forDevelopers/jaiapi/javax.media.jai.operator.GradientMagnitudeDescriptor.html |
Version | 1.0 |
arg0Desc | A gradient mask |
arg1Desc | A gradient mask orthogonal to the first one. |
Name | Class Type | Default Value |
---|---|---|
mask1 | javax.media.jai.KernelJAI | KernalJAI.GRADIENT_MASK_SOBEL_HORIZONTAL |
mask2 | javax.media.jai.KernelJAI | KernalJAI.GRADIENT_MASK_SOBEL_VERTICAL |
OperationDescriptor
,
KernelJAI
,
Serialized FormField Summary |
---|
Fields inherited from class javax.media.jai.OperationDescriptorImpl |
---|
sourceNames, supportedModes |
Fields inherited from interface javax.media.jai.OperationDescriptor |
---|
NO_PARAMETER_DEFAULT |
Constructor Summary | |
---|---|
GradientMagnitudeDescriptor()
Constructor for the GradientMagnitudeDescriptor. |
Method Summary | |
---|---|
static RenderedOp |
create(RenderedImage source0,
KernelJAI mask1,
KernelJAI mask2,
RenderingHints hints)
Computes the gradient of an image |
PropertyGenerator[] |
getPropertyGenerators()
Returns an array of PropertyGenerators implementing
property inheritance for the "GradientMagnitude" operation. |
protected boolean |
validateParameters(ParameterBlock args,
StringBuffer msg)
Validates the input parameters. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GradientMagnitudeDescriptor()
Method Detail |
---|
protected boolean validateParameters(ParameterBlock args, StringBuffer msg)
In addition to the standard checks performed by the superclass method, this method checks that "mask1" and "mask2" have the same dimensions.
validateParameters
in class OperationDescriptorImpl
OperationDescriptorImpl.validateParameters(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer)
public PropertyGenerator[] getPropertyGenerators()
PropertyGenerators
implementing
property inheritance for the "GradientMagnitude" operation.
getPropertyGenerators
in interface OperationDescriptor
getPropertyGenerators
in class OperationDescriptorImpl
OperationDescriptorImpl.getPropertyGenerators(java.lang.String)
public static RenderedOp create(RenderedImage source0, KernelJAI mask1, KernelJAI mask2, RenderingHints hints)
Creates a ParameterBlockJAI
from all
supplied arguments except hints
and invokes
JAI.create(String,ParameterBlock,RenderingHints)
.
source0
- RenderedImage
source 0.mask1
- A gradient mask.
May be null
.mask2
- A gradient mask orthogonal to the first one.
May be null
.hints
- The RenderingHints
to use.
May be null
.
RenderedOp
destination.
IllegalArgumentException
- if source0
is null
.JAI
,
ParameterBlockJAI
,
RenderedOp
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |