Class DisplacementMapRed
- java.lang.Object
-
- org.apache.batik.ext.awt.image.rendered.AbstractRed
-
- org.apache.batik.ext.awt.image.rendered.DisplacementMapRed
-
- All Implemented Interfaces:
java.awt.image.RenderedImage,CachableRed
public class DisplacementMapRed extends AbstractRed
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 Modifier and Type Class Description (package private) static classDisplacementMapRed.TileOffsets
-
Field Summary
Fields Modifier and Type Field Description (package private) java.awt.RenderingHintshintsThe set of rendering hints(package private) CachableRedimageThe image to distort.(package private) intmaxOffXThe maximum possible offsets in x and y(package private) intmaxOffYThe maximum possible offsets in x and y(package private) CachableRedoffsetsThe offset image (displacement map).private floatscaleXThe displacement scale factor along the x axisprivate floatscaleYThe displacement scale factor along the y axisprivate static booleanTIMEprivate static booleanUSE_NNprivate ARGBChannelxChannelThe channel type of the operation on X axis(package private) DisplacementMapRed.TileOffsets[]xOffsetsComputed tile Offsets Soft referencces to TileOffsets instances...private ARGBChannelyChannelThe channel type of the operation on Y axis(package private) DisplacementMapRed.TileOffsets[]yOffsets-
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
Constructors Constructor Description DisplacementMapRed(CachableRed image, CachableRed offsets, ARGBChannel xChannel, ARGBChannel yChannel, float scaleX, float scaleY, java.awt.RenderingHints rh)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.image.WritableRastercopyData(java.awt.image.WritableRaster wr)voidfilterBL(java.awt.image.Raster off, java.awt.image.WritableRaster dst, int[] xTile, int[] xOff, int[] yTile, int[] yOff)voidfilterBLPre(java.awt.image.Raster off, java.awt.image.WritableRaster dst, int[] xTile, int[] xOff, int[] yTile, int[] yOff)voidfilterNN(java.awt.image.Raster off, java.awt.image.WritableRaster dst, int[] xTile, int[] xOff, int[] yTile, int[] yOff)Does displacement map using Nearest neighbor interpolationjava.awt.image.RastergetTile(int tileX, int tileY)DisplacementMapRed.TileOffsetsgetXOffsets(int xTile)DisplacementMapRed.TileOffsetsgetYOffsets(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 Detail
-
TIME
private static final boolean TIME
- See Also:
- Constant Field Values
-
USE_NN
private static final boolean USE_NN
- See Also:
- Constant Field Values
-
scaleX
private float scaleX
The displacement scale factor along the x axis
-
scaleY
private float scaleY
The displacement scale factor along the y axis
-
xChannel
private ARGBChannel xChannel
The channel type of the operation on X axis
-
yChannel
private ARGBChannel yChannel
The channel type of the operation on Y axis
-
image
CachableRed image
The image to distort.
-
offsets
CachableRed offsets
The offset image (displacement map).
-
maxOffX
int maxOffX
The maximum possible offsets in x and y
-
maxOffY
int maxOffY
The maximum possible offsets in x and y
-
hints
java.awt.RenderingHints hints
The set of rendering hints
-
xOffsets
DisplacementMapRed.TileOffsets[] xOffsets
Computed tile Offsets Soft referencces to TileOffsets instances...
-
yOffsets
DisplacementMapRed.TileOffsets[] yOffsets
-
-
Constructor Detail
-
DisplacementMapRed
public DisplacementMapRed(CachableRed image, CachableRed offsets, ARGBChannel xChannel, ARGBChannel yChannel, float scaleX, float scaleY, java.awt.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 Detail
-
copyData
public java.awt.image.WritableRaster copyData(java.awt.image.WritableRaster wr)
-
getTile
public java.awt.image.Raster getTile(int tileX, int tileY)- Specified by:
getTilein interfacejava.awt.image.RenderedImage- Overrides:
getTilein classAbstractRed
-
getXOffsets
public DisplacementMapRed.TileOffsets getXOffsets(int xTile)
-
getYOffsets
public DisplacementMapRed.TileOffsets getYOffsets(int yTile)
-
filterBL
public void filterBL(java.awt.image.Raster off, java.awt.image.WritableRaster dst, int[] xTile, int[] xOff, int[] yTile, int[] yOff)
-
filterBLPre
public void filterBLPre(java.awt.image.Raster off, java.awt.image.WritableRaster dst, int[] xTile, int[] xOff, int[] yTile, int[] yOff)
-
filterNN
public 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- 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.
-
-