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 class
DisplacementMapRed.TileOffsets
-
Field Summary
Fields Modifier and Type Field 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 axisprivate float
scaleY
The displacement scale factor along the y axisprivate 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
-
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.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 interpolationjava.awt.image.Raster
getTile(int tileX, int tileY)
DisplacementMapRed.TileOffsets
getXOffsets(int xTile)
DisplacementMapRed.TileOffsets
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 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:
getTile
in interfacejava.awt.image.RenderedImage
- Overrides:
getTile
in 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.
-
-