public class DisplacementMapRed extends AbstractRed
Modifier and Type | Class and Description |
---|---|
(package private) static class |
DisplacementMapRed.TileOffsets |
Modifier and Type | Field and Description |
---|---|
(package private) java.awt.RenderingHints |
hints
The set of rendering hints
|
(package private) CachableRed |
image
The image to distort.
|
(package private) int |
maxOffX
The maximum possible offsets in x and y
|
(package private) int |
maxOffY
The maximum possible offsets in x and y
|
(package private) CachableRed |
offsets
The offset image (displacement map).
|
private float |
scaleX
The displacement scale factor along the x axis
|
private float |
scaleY
The displacement scale factor along the y axis
|
private static boolean |
TIME |
private static boolean |
USE_NN |
private ARGBChannel |
xChannel
The channel type of the operation on X axis
|
(package private) DisplacementMapRed.TileOffsets[] |
xOffsets
Computed tile Offsets Soft referencces to TileOffsets instances...
|
private ARGBChannel |
yChannel
The channel type of the operation on Y axis
|
(package private) DisplacementMapRed.TileOffsets[] |
yOffsets |
bounds, cm, minTileX, minTileY, numXTiles, numYTiles, props, sm, srcs, tileGridXOff, tileGridYOff, tileHeight, tileWidth
Constructor and Description |
---|
DisplacementMapRed(CachableRed image,
CachableRed offsets,
ARGBChannel xChannel,
ARGBChannel yChannel,
float scaleX,
float scaleY,
java.awt.RenderingHints rh) |
Modifier and Type | Method and Description |
---|---|
java.awt.image.WritableRaster |
copyData(java.awt.image.WritableRaster wr) |
void |
filterBL(java.awt.image.Raster off,
java.awt.image.WritableRaster dst,
int[] xTile,
int[] xOff,
int[] yTile,
int[] yOff) |
void |
filterBLPre(java.awt.image.Raster off,
java.awt.image.WritableRaster dst,
int[] xTile,
int[] xOff,
int[] yTile,
int[] yOff) |
void |
filterNN(java.awt.image.Raster off,
java.awt.image.WritableRaster dst,
int[] xTile,
int[] xOff,
int[] yTile,
int[] yOff)
Does displacement map using Nearest neighbor interpolation
|
java.awt.image.Raster |
getTile(int tileX,
int tileY) |
DisplacementMapRed.TileOffsets |
getXOffsets(int xTile) |
DisplacementMapRed.TileOffsets |
getYOffsets(int yTile) |
copyBand, copyToRaster, getBounds, getColorModel, getData, getData, getDependencyRegion, getDirtyRegion, getHeight, getMinTileX, getMinTileY, getMinX, getMinY, getNumXTiles, getNumYTiles, getProperty, getPropertyNames, getSampleModel, getSources, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, getWidth, getXTile, getYTile, init, init, makeTile, updateTileGridInfo
private static final boolean TIME
private static final boolean USE_NN
private float scaleX
private float scaleY
private ARGBChannel xChannel
private ARGBChannel yChannel
CachableRed image
CachableRed offsets
int maxOffX
int maxOffY
java.awt.RenderingHints hints
DisplacementMapRed.TileOffsets[] xOffsets
DisplacementMapRed.TileOffsets[] yOffsets
public DisplacementMapRed(CachableRed image, CachableRed offsets, ARGBChannel xChannel, ARGBChannel yChannel, float scaleX, float scaleY, java.awt.RenderingHints rh)
image
- the image to distortoffsets
- the displacement mapxChannel
- defines the channel of off whose values will be
on X-axis operationyChannel
- defines the channel of off whose values will bescaleX
- defines the scale factor of the filter operation
on the X axis.scaleY
- defines the scale factor of the filter operation
on the Y axisrh
- the rendering hintspublic java.awt.image.WritableRaster copyData(java.awt.image.WritableRaster wr)
public java.awt.image.Raster getTile(int tileX, int tileY)
getTile
in interface java.awt.image.RenderedImage
getTile
in class AbstractRed
public DisplacementMapRed.TileOffsets getXOffsets(int xTile)
public DisplacementMapRed.TileOffsets getYOffsets(int yTile)
public void filterBL(java.awt.image.Raster off, java.awt.image.WritableRaster dst, int[] xTile, int[] xOff, int[] yTile, int[] yOff)
public void filterBLPre(java.awt.image.Raster off, java.awt.image.WritableRaster dst, int[] xTile, int[] xOff, int[] yTile, int[] yOff)
public void filterNN(java.awt.image.Raster off, java.awt.image.WritableRaster dst, int[] xTile, int[] xOff, int[] yTile, int[] yOff)
off
- the displacement mapdst
- stores the filtered image. If null, a destination will
be created. img and dst can refer to the same Raster, in
which situation the img will be modified.