|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.media.jai.OperationDescriptorImpl javax.media.jai.operator.DivideByConstDescriptor
An OperationDescriptor
describing the
"DivideByConst" operation.
The DivideByConst operation takes one rendered or renderable source image and an array of double constants, and divides every pixel of the same band of the source by the constant from the corresponding array entry. If the number of constants supplied is less than the number of bands of the destination, then the constant from entry 0 is applied to all the bands. Otherwise, a constant from a different entry is applied to each band.
In case of division by 0, if the numerator is 0, then the result is set to 0; otherwise, the result is set to the maximum value supported by the destination data type.
By default, the destination image bound, data type, and number of bands are the same as the source image. If the result of the operation underflows/overflows the minimum/maximum value supported by the destination data type, then it will be clamped to the minimum/maximum value respectively.
The destination pixel values are defined by the pseudocode:
if (constants.length < dstNumBands) { dst[x][y][b] = srcs[x][y][b]/constants[0]; } else { dst[x][y][b] = srcs[x][y][b]/constants[b]; }
Name | Value |
---|---|
GlobalName | DivideByConst |
LocalName | DivideByConst |
Vendor | com.sun.media.jai |
Description | Divides an image by constants. |
DocURL | http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/DivideByConstDescriptor.html |
Version | 1.0 |
arg0Desc | The constants to be divided by. |
Name | Class Type | Default Value |
---|---|---|
constants | double[] | {1.0} |
OperationDescriptor
,
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 | |
DivideByConstDescriptor()
Constructor. |
Method Summary | |
static RenderedOp |
create(RenderedImage source0,
double[] constants,
RenderingHints hints)
Divides an image by constants. |
static RenderableOp |
createRenderable(RenderableImage source0,
double[] constants,
RenderingHints hints)
Divides an image by constants. |
boolean |
isRenderableSupported()
Returns true since renderable operation is supported. |
protected boolean |
validateParameters(ParameterBlock args,
StringBuffer message)
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 DivideByConstDescriptor()
Method Detail |
public boolean isRenderableSupported()
true
since renderable operation is supported.
isRenderableSupported
in interface OperationDescriptor
isRenderableSupported
in class OperationDescriptorImpl
OperationDescriptorImpl.isModeSupported(java.lang.String)
protected boolean validateParameters(ParameterBlock args, StringBuffer message)
In addition to the standard checks performed by the superclass method, this method checks that the length of the "constants" array is at least 1.
validateParameters
in class OperationDescriptorImpl
OperationDescriptorImpl.validateParameters(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer)
public static RenderedOp create(RenderedImage source0, double[] constants, RenderingHints hints)
Creates a ParameterBlockJAI
from all
supplied arguments except hints
and invokes
JAI.create(String,ParameterBlock,RenderingHints)
.
source0
- RenderedImage
source 0.constants
- The constants to be divided by.
May be null
.hints
- The RenderingHints
to use.
May be null
.
RenderedOp
destination.
IllegalArgumentException
- if source0
is null
.JAI
,
ParameterBlockJAI
,
RenderedOp
public static RenderableOp createRenderable(RenderableImage source0, double[] constants, RenderingHints hints)
Creates a ParameterBlockJAI
from all
supplied arguments except hints
and invokes
JAI.createRenderable(String,ParameterBlock,RenderingHints)
.
source0
- RenderableImage
source 0.constants
- The constants to be divided by.
May be null
.hints
- The RenderingHints
to use.
May be null
.
RenderableOp
destination.
IllegalArgumentException
- if source0
is null
.JAI
,
ParameterBlockJAI
,
RenderableOp
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |