public class PixelsView extends TiledView implements ColorMapped
The first step is a mapping from function values to unsigned byte values. This mapping is linear, except for clipping, which ensures that no byte value lies outside the range [0,255]. The linear mapping is defined by two clip values, clipMin and clipMax. The minimum clip value clipMin corresponds to byte value 0, and the maximum clip value clipMax corresponds to byte value 255. Sample values less than clipMin are mapped to 0; sample values greater than clipMax are mapped to 255.
Byte values are computed for every pixel displayed by this view. Because the view typically contains more pixels than samples, this first mapping often requires interpolation between sampled values of functions f(x1,x2). Either linear or nearest-neighbor interpolation may be specified for this first step.
The second step depends on the number (one, three, or four) of sampled
functions specified. For one function, the byte values are indices for
a table of 256 colors (a color map) in a specified index color model.
See ColorMap
for more details.
For three (or four) sampled functions, the byte values are interpreted directly as color components red, green, and blue (and alpha). In this case, any indexed color model specified is not used. The number of color components equals the number of sampled functions specified.
Modifier and Type | Class and Description |
---|---|
static class |
PixelsView.Interpolation
Method used to interpolate pixels between samples of f(x1,x2).
|
static class |
PixelsView.Orientation
Orientation of sample axes x1 and x2.
|
Constructor and Description |
---|
PixelsView(float[][] f)
Constructs a pixels view of the specified sampled function f(x1,x2).
|
PixelsView(float[][][] f)
Constructs a pixels view of the specified sampled functions f(x1,x2).
|
PixelsView(Sampling s1,
Sampling s2,
float[][] f)
Constructs a pixels view of the specified sampled function f(x1,x2).
|
PixelsView(Sampling s1,
Sampling s2,
float[][][] f)
Constructs a pixels view of the specified sampled functions f(x1,x2).
|
Modifier and Type | Method and Description |
---|---|
void |
addColorMapListener(ColorMapListener cml)
Adds the specified color map listener.
|
float |
getClipMax()
Gets the maximum clip value.
|
float |
getClipMax(int ic)
Gets the maximum clip value for the specified color component.
|
float |
getClipMin()
Gets the minimum clip value.
|
float |
getClipMin(int ic)
Gets the minimum clip value for the specified color component.
|
ColorMap |
getColorMap()
Gets the color map.
|
java.awt.image.IndexColorModel |
getColorModel()
Gets the index color model for this view.
|
PixelsView.Interpolation |
getInterpolation()
Gets the method for interpolation between samples.
|
PixelsView.Orientation |
getOrientation()
Gets the orientation of sample axes.
|
float |
getPercentileMax()
Gets the maximum percentile.
|
float |
getPercentileMax(int ic)
Gets the maximum percentile for the specified color component.
|
float |
getPercentileMin()
Gets the minimum percentile.
|
float |
getPercentileMin(int ic)
Gets the minimum percentile for the specified color component.
|
void |
paint(java.awt.Graphics2D g2d)
Paints this tiled view.
|
void |
removeColorMapListener(ColorMapListener cml)
Removes the specified color map listener.
|
void |
set(float[][] f)
Sets the sampled function f(x1,x2) for this view.
|
void |
set(float[][][] f)
Sets the sampled functions f(x1,x2) for this view.
|
void |
set(Sampling s1,
Sampling s2,
float[][] f)
Sets the sampled function f(x1,x2) for this view.
|
void |
set(Sampling s1,
Sampling s2,
float[][][] f)
Sets the sampled functions f(x1,x2) for this view.
|
void |
setClips(float clipMin,
float clipMax)
Sets the clips for this view.
|
void |
setClips(int ic,
float clipMin,
float clipMax)
Sets the clips for the specified color component.
|
void |
setColorModel(java.awt.image.IndexColorModel colorModel)
Sets the index color model for this view.
|
void |
setInterpolation(PixelsView.Interpolation interpolation)
Sets the method for interpolation between samples.
|
void |
setOrientation(PixelsView.Orientation orientation)
Sets the orientation of sample axes.
|
void |
setPercentiles(float percMin,
float percMax)
Sets the percentiles used to compute clips for this view.
|
void |
setPercentiles(int ic,
float percMin,
float percMax)
Sets the percentiles for the specified color component.
|
getBestHorizontalProjector, getBestVerticalProjector, getHorizontalProjector, getLineWidth, getTile, getTranscaler, getVerticalProjector, repaint, setBestProjectors
public PixelsView(float[][] f)
f
- array[n2][n1] of sampled function values f(x1,x2).public PixelsView(float[][][] f)
f
- array[nc][n2][n1] of sampled function values f(x1,x2),
where nc is the number (three or four) of color components.public PixelsView(Sampling s1, Sampling s2, float[][] f)
s1
- the sampling of the variable x1; must be uniform.s2
- the sampling of the variable x2; must be uniform.f
- array[n2][n1] of sampled function values f(x1,x2).public PixelsView(Sampling s1, Sampling s2, float[][][] f)
s1
- the sampling of the variable x1; must be uniform.s2
- the sampling of the variable x2; must be uniform.f
- array[nc][n2][n1] of sampled function values f(x1,x2),
where nc is the number (three or four) of color components.public void set(float[][] f)
f
- array[n2][n1] of sampled function values f(x1,x2).public void set(float[][][] f)
f
- array[nc][n2][n1] of sampled function values f(x1,x2),
where nc is the number (three or four) of color components.public void set(Sampling s1, Sampling s2, float[][] f)
s1
- the sampling of the variable x1; must be uniform.s2
- the sampling of the variable x2; must be uniform.f
- array[n2][n1] of sampled function values f(x1,x2).public void set(Sampling s1, Sampling s2, float[][][] f)
s1
- the sampling of the variable x1; must be uniform.s2
- the sampling of the variable x2; must be uniform.f
- array[nc][n2][n1] of sampled function values f(x1,x2),
where nc is the number (three or four) of color components.
This number must equal that when this view was constructed.public void setOrientation(PixelsView.Orientation orientation)
orientation
- the orientation.public PixelsView.Orientation getOrientation()
public void setInterpolation(PixelsView.Interpolation interpolation)
interpolation
- the interpolation method.public PixelsView.Interpolation getInterpolation()
public void setColorModel(java.awt.image.IndexColorModel colorModel)
colorModel
- the index color model.public java.awt.image.IndexColorModel getColorModel()
public void setClips(float clipMin, float clipMax)
Calling this method disables the computation of clips from percentiles. Any clip values computed or specified previously will be forgotten.
If multiple color components, sets clips for all components.
clipMin
- the sample value corresponding to color model index 0.clipMax
- the sample value corresponding to color model index 255.public float getClipMin()
public float getClipMax()
public void setPercentiles(float percMin, float percMax)
Calling this method enables the computation of clips from percentiles. Any clip values specified or computed previously will be forgotten.
If multiple color components, sets percentiles for all components.
percMin
- the percentile corresponding to clipMin.percMax
- the percentile corresponding to clipMax.public float getPercentileMin()
public float getPercentileMax()
public void setClips(int ic, float clipMin, float clipMax)
ic
- the index (0, 1, 2, or 3) of the color component.clipMin
- the sample value corresponding to byte value 0.clipMax
- the sample value corresponding to byte value 255.public float getClipMin(int ic)
ic
- the index (0, 1, 2, or 3) of the color component.public float getClipMax(int ic)
ic
- the index (0, 1, 2, or 3) of the color component.public void setPercentiles(int ic, float percMin, float percMax)
ic
- the index (0, 1, 2, or 3) of the color component.percMin
- the percentile corresponding to clipMin.percMax
- the percentile corresponding to clipMax.public float getPercentileMin(int ic)
ic
- the index (0, 1, 2, or 3) of the color component.public float getPercentileMax(int ic)
ic
- the index (0, 1, 2, or 3) of the color component.public void addColorMapListener(ColorMapListener cml)
cml
- the listener.public void removeColorMapListener(ColorMapListener cml)
cml
- the listener.public void paint(java.awt.Graphics2D g2d)
TiledView
Tiled views should not replace (set) entirely the transform in the specified graphics context. This transform may already have been set by the tile or its mosaic. Therefore, tiled views should modify this transform only by specifying additional scaling, translation, etc.
public ColorMap getColorMap()
ColorMapped
getColorMap
in interface ColorMapped