Class DisplacementMapRed
java.lang.Object
org.apache.batik.ext.awt.image.rendered.AbstractRed
org.apache.batik.ext.awt.image.rendered.DisplacementMapRed
- All Implemented Interfaces:
RenderedImage
,CachableRed
This implementation of RenderableImage will render its input
GraphicsNode on demand for tiles.
- Version:
- $Id: DisplacementMapRed.java 1733416 2016-03-03 07:07:13Z gadams $
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescription(package private) RenderingHints
The set of rendering hints(package private) CachableRed
The image to distort.(package private) int
The maximum possible offsets in x and y(package private) int
The maximum possible offsets in x and y(package private) CachableRed
The offset image (displacement map).private float
The displacement scale factor along the x axisprivate float
The displacement scale factor along the y axisprivate static final boolean
private static final boolean
private ARGBChannel
The channel type of the operation on X axis(package private) DisplacementMapRed.TileOffsets[]
Computed tile Offsets Soft referencces to TileOffsets instances...private ARGBChannel
The channel type of the operation on Y axis(package private) DisplacementMapRed.TileOffsets[]
Fields inherited from class org.apache.batik.ext.awt.image.rendered.AbstractRed
bounds, cm, minTileX, minTileY, numXTiles, numYTiles, props, sm, srcs, tileGridXOff, tileGridYOff, tileHeight, tileWidth
-
Constructor Summary
ConstructorsConstructorDescriptionDisplacementMapRed
(CachableRed image, CachableRed offsets, ARGBChannel xChannel, ARGBChannel yChannel, float scaleX, float scaleY, RenderingHints rh) -
Method Summary
Modifier and TypeMethodDescriptionvoid
filterBL
(Raster off, WritableRaster dst, int[] xTile, int[] xOff, int[] yTile, int[] yOff) void
filterBLPre
(Raster off, WritableRaster dst, int[] xTile, int[] xOff, int[] yTile, int[] yOff) void
filterNN
(Raster off, WritableRaster dst, int[] xTile, int[] xOff, int[] yTile, int[] yOff) Does displacement map using Nearest neighbor interpolationgetTile
(int tileX, int tileY) getXOffsets
(int xTile) getYOffsets
(int yTile) Methods inherited from class org.apache.batik.ext.awt.image.rendered.AbstractRed
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
-
Field Details
-
TIME
private static final boolean TIME- See Also:
-
USE_NN
private static final boolean USE_NN- See Also:
-
scaleX
private float scaleXThe displacement scale factor along the x axis -
scaleY
private float scaleYThe displacement scale factor along the y axis -
xChannel
The channel type of the operation on X axis -
yChannel
The channel type of the operation on Y axis -
image
CachableRed imageThe image to distort. -
offsets
CachableRed offsetsThe offset image (displacement map). -
maxOffX
int maxOffXThe maximum possible offsets in x and y -
maxOffY
int maxOffYThe maximum possible offsets in x and y -
hints
RenderingHints hintsThe set of rendering hints -
xOffsets
DisplacementMapRed.TileOffsets[] xOffsetsComputed tile Offsets Soft referencces to TileOffsets instances... -
yOffsets
DisplacementMapRed.TileOffsets[] yOffsets
-
-
Constructor Details
-
DisplacementMapRed
public DisplacementMapRed(CachableRed image, CachableRed offsets, ARGBChannel xChannel, ARGBChannel yChannel, float scaleX, float scaleY, RenderingHints rh) - Parameters:
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 hints
-
-
Method Details
-
copyData
-
getTile
- Specified by:
getTile
in interfaceRenderedImage
- Overrides:
getTile
in classAbstractRed
-
getXOffsets
-
getYOffsets
-
filterBL
public void filterBL(Raster off, WritableRaster dst, int[] xTile, int[] xOff, int[] yTile, int[] yOff) -
filterBLPre
public void filterBLPre(Raster off, WritableRaster dst, int[] xTile, int[] xOff, int[] yTile, int[] yOff) -
filterNN
public void filterNN(Raster off, WritableRaster dst, int[] xTile, int[] xOff, int[] yTile, int[] yOff) Does displacement map using Nearest neighbor interpolation- Parameters:
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.
-