|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.jai.OperationDescriptorImpl | +--javax.media.jai.operator.LookupDescriptor
An OperationDescriptor
describing the "Lookup" operation.
The Lookup operation takes a rendered or renderable image and a lookup table, and performs general table lookup by passing the source image through the table.
The source may be a single- or multi-banded image of data types
byte
, ushort
, short
, or
int
. The lookup table may be single- or multi-banded
and of any JAI supported data types. The destination image must have
the same data type as the lookup table, and its number of bands is
determined based on the number of bands of the source and the table.
If the source is single-banded, the destination has the same number
of bands as the lookup table; otherwise, the destination has the
same number of bands as the source.
If either the source or the table is single-banded and the other one is multi-banded, then the single band is applied to every band of the multi-banded object. If both are multi-banded, then their corresponding bands are matched up.
The table may have a set of offset values, one for each band. This value is subtracted from the source pixel values before indexing into the table data array.
It is the user's responsibility to make certain the lookup table supplied is suitable for the source image. Specifically, the table data covers the entire range of the source data. Otherwise, the result of this operation is undefined.
By the nature of this operation, the destination may have a
different number of bands and/or data type from the source. The
SampleModel
of the destination is created in accordance
with the actual lookup table used in a specific case.
The destination pixel values are defined by the pseudocode:
dst[x][y][b] = table[b][src[x][y][0] - offsets[b]]
dst[x][y][b] = table[0][src[x][y][b] - offsets[0]]
dst[x][y][b] = table[b][src[x][y][b] - offsets[b]]
Name | Value |
---|---|
GlobalName | Lookup |
LocalName | Lookup |
Vendor | com.sun.media.jai |
Description | Performs general table lookup on an image. |
DocURL | http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/LookupDescriptor.html |
Version | 1.0 |
arg0Desc | The lookup table the source image is passed through. |
Name | Class Type | Default Value |
---|---|---|
table | javax.media.jai.LookupTableJAI | NO_PARAMETER_DEFAULT |
LookupTableJAI
,
OperationDescriptor
, Serialized FormFields inherited from class javax.media.jai.OperationDescriptorImpl |
resources, sourceNames, supportedModes |
Fields inherited from interface javax.media.jai.OperationDescriptor |
NO_PARAMETER_DEFAULT |
Constructor Summary | |
LookupDescriptor()
Constructor. |
Method Summary | |
static RenderedOp |
create(RenderedImage source0,
LookupTableJAI table,
RenderingHints hints)
Performs general table lookup on an image. |
static RenderableOp |
createRenderable(RenderableImage source0,
LookupTableJAI table,
RenderingHints hints)
Performs general table lookup on an image. |
protected boolean |
validateSources(String modeName,
ParameterBlock args,
StringBuffer msg)
Validates the input source. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LookupDescriptor()
Method Detail |
protected boolean validateSources(String modeName, ParameterBlock args, StringBuffer msg)
In addition to the standard checks performed by the superclass method, this method checks that the source image is of integral data type.
validateSources
in class OperationDescriptorImpl
javax.media.jai.OperationDescriptorImpl
modeName
- the operation mode nameargs
- a ParameterBlock
that has the sourcesmsg
- A string that may contain error messages.IllegalArgumentException
- if any of the input parameters are null
.OperationDescriptorImpl.validateArguments(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer)
public static RenderedOp create(RenderedImage source0, LookupTableJAI table, RenderingHints hints)
Creates a ParameterBlockJAI
from all
supplied arguments except hints
and invokes
JAI.create(String,ParameterBlock,RenderingHints)
.
source0
- RenderedImage
source 0.table
- The lookup table the source image is passed through.hints
- The RenderingHints
to use.
May be null
.RenderedOp
destination.IllegalArgumentException
- if source0
is null
.IllegalArgumentException
- if table
is null
.JAI
,
ParameterBlockJAI
,
RenderedOp
public static RenderableOp createRenderable(RenderableImage source0, LookupTableJAI table, RenderingHints hints)
Creates a ParameterBlockJAI
from all
supplied arguments except hints
and invokes
JAI.createRenderable(String,ParameterBlock,RenderingHints)
.
source0
- RenderableImage
source 0.table
- The lookup table the source image is passed through.hints
- The RenderingHints
to use.
May be null
.RenderableOp
destination.IllegalArgumentException
- if source0
is null
.IllegalArgumentException
- if table
is null
.JAI
,
ParameterBlockJAI
,
RenderableOp
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |