|
||||||||||
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.PiecewiseDescriptor
An OperationDescriptor
describing the "Piecewise" operation.
The "Piecewise" operation performs a piecewise linear mapping of the pixel values of an image. The piecewise linear mapping is described by a set of breakpoints which are provided as an array of the form
float breakPoints[N][2][numBreakPoints]where the value of N may be either unity or the number of bands in the source image. If N is unity then the same set of breakpoints will be applied to all bands in the image. The abscissas of the supplied breakpoints must be monotonically increasing.
The pixel values of the destination image are defined by the pseudocode:
if (src[x][y][b] < breakPoints[b][0][0]) { dst[x][y][b] = breakPoints[b][1][0]); } else if (src[x][y][b] > breakPoints[b][0][numBreakPoints-1]) { dst[x][y][b] = breakPoints[b][1][numBreakPoints-1]); } else { int i = 0; while(breakPoints[b][0][i+1] < src[x][y][b]) { i++; } dst[x][y][b] = breakPoints[b][1][i] + (src[x][y][b] - breakPoints[b][0][i])* (breakPoints[b][1][i+1] - breakPoints[b][1][i])/ (breakPoints[b][0][i+1] - breakPoints[b][0][i]); }
Name | Value |
---|---|
GlobalName | Piecewise |
LocalName | Piecewise |
Vendor | com.sun.media.jai |
Description | Applies a piecewise pixel value mapping. |
DocURL | http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/PiecewiseDescriptor.html |
Version | 1.0 |
arg0Desc | The breakpoint array. |
Name | Class Type | Default Value |
---|---|---|
breakPoints | float[][][] | identity mapping on [0, 255] |
DataBuffer
,
ImageLayout
,
OperationDescriptor
,
Serialized FormField Summary |
Fields inherited from class javax.media.jai.OperationDescriptorImpl |
sourceNames |
Fields inherited from interface javax.media.jai.OperationDescriptor |
NO_PARAMETER_DEFAULT |
Constructor Summary | |
PiecewiseDescriptor()
Constructor. |
Method Summary | |
static RenderedOp |
create(RenderedImage source0,
float[][][] breakPoints,
RenderingHints hints)
Applies a piecewise pixel value mapping. |
static RenderableOp |
createRenderable(RenderableImage source0,
float[][][] breakPoints,
RenderingHints hints)
Applies a piecewise pixel value mapping. |
boolean |
validateArguments(String modeName,
ParameterBlock args,
StringBuffer msg)
Validates the input source and parameter. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PiecewiseDescriptor()
Method Detail |
public boolean validateArguments(String modeName, ParameterBlock args, StringBuffer msg)
In addition to the standard checks performed by the superclass method, this method checks that the number of bands in "breakPoints" is either 1 or the number of bands in the source image, the second breakpoint array dimension is 2, the third dimension is the same for abscissas and ordinates, and that the absicssas are monotonically increasing.
validateArguments
in interface OperationDescriptor
validateArguments
in class OperationDescriptorImpl
modeName
- the operation mode nameargs
- Input arguments, including source(s) and/or parameter(s).msg
- A string that may contain error messages.OperationDescriptorImpl.validateSources(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer)
,
OperationDescriptorImpl.validateParameters(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer)
public static RenderedOp create(RenderedImage source0, float[][][] breakPoints, RenderingHints hints)
Creates a ParameterBlockJAI
from all
supplied arguments except hints
and invokes
JAI.create(String,ParameterBlock,RenderingHints)
.
source0
- RenderedImage
source 0.breakPoints
- The breakpoint array.
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, float[][][] breakPoints, RenderingHints hints)
Creates a ParameterBlockJAI
from all
supplied arguments except hints
and invokes
JAI.createRenderable(String,ParameterBlock,RenderingHints)
.
source0
- RenderableImage
source 0.breakPoints
- The breakpoint array.
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 |