|
||||||||||
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.SubtractDescriptor
An OperationDescriptor
describing the "Subtract"
operation.
The Subtract operation takes two rendered or renderable images, and for every pair of pixels, one from each source image of the corresponding position and band, subtracts the pixel from the second source from the pixel from the first source. No additional parameters are required.
The two source images may have different numbers of bands and data types. By default, the destination image bounds are the intersection of the two source image bounds. If the sources don't intersect, the destination will have a width and height of 0.
The default number of bands of the destination image is equal to the smallest number of bands of the sources, and the data type is the smallest data type with sufficient range to cover the range of both source data types (not necessarily the range of their sums).
As a special case, if one of the source images has N bands (N >
1), the other source has 1 band, and an ImageLayout
hint is provided containing a destination SampleModel
with K bands (1 < K <= N), then the single band of the 1-banded
source is subtracted from or into each of the first K bands of the
N-band source.
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:
dst[x][y][dstBand] = clamp(srcs[0][x][y][src0Band] - srcs[1][x][y][src1Band]);
Name | Value |
---|---|
GlobalName | Subtract |
LocalName | Subtract |
Vendor | com.sun.media.jai |
Description | Subtracts one image from another image. |
DocURL | http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/SubtractDescriptor.html |
Version | 1.0 |
No parameters are needed for this operation.
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 | |
SubtractDescriptor()
Constructor. |
Method Summary | |
static RenderedOp |
create(RenderedImage source0,
RenderedImage source1,
RenderingHints hints)
Subtracts one image from another image. |
static RenderableOp |
createRenderable(RenderableImage source0,
RenderableImage source1,
RenderingHints hints)
Subtracts one image from another image. |
boolean |
isRenderableSupported()
Returns true since renderable operation is supported. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SubtractDescriptor()
Method Detail |
public boolean isRenderableSupported()
true
since renderable operation is supported.
isRenderableSupported
in interface OperationDescriptor
isRenderableSupported
in class OperationDescriptorImpl
OperationDescriptorImpl.isModeSupported(java.lang.String)
public static RenderedOp create(RenderedImage source0, RenderedImage source1, RenderingHints hints)
Creates a ParameterBlockJAI
from all
supplied arguments except hints
and invokes
JAI.create(String,ParameterBlock,RenderingHints)
.
source0
- RenderedImage
source 0.source1
- RenderedImage
source 1.hints
- The RenderingHints
to use.
May be null
.
RenderedOp
destination.
IllegalArgumentException
- if source0
is null
.
IllegalArgumentException
- if source1
is null
.JAI
,
ParameterBlockJAI
,
RenderedOp
public static RenderableOp createRenderable(RenderableImage source0, RenderableImage source1, RenderingHints hints)
Creates a ParameterBlockJAI
from all
supplied arguments except hints
and invokes
JAI.createRenderable(String,ParameterBlock,RenderingHints)
.
source0
- RenderableImage
source 0.source1
- RenderableImage
source 1.hints
- The RenderingHints
to use.
May be null
.
RenderableOp
destination.
IllegalArgumentException
- if source0
is null
.
IllegalArgumentException
- if source1
is null
.JAI
,
ParameterBlockJAI
,
RenderableOp
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |