Class DisplacementMapRable8Bit

All Implemented Interfaces:
RenderableImage, DisplacementMapRable, Filter, FilterColorInterpolation

public class DisplacementMapRable8Bit extends AbstractColorInterpolationRable implements DisplacementMapRable
Implements a DisplacementMap operation, which takes pixel values from another image to spatially displace the input image
Version:
$Id: DisplacementMapRable8Bit.java 1733416 2016-03-03 07:07:13Z gadams $
  • Field Details

    • scale

      private double scale
      Displacement scale factor
    • xChannelSelector

      private ARGBChannel xChannelSelector
      Defines which channel in the second source is used to displace along the x axis
    • yChannelSelector

      private ARGBChannel yChannelSelector
      Defines which channel in the second source is used to displace along the y axis.
  • Constructor Details

    • DisplacementMapRable8Bit

      public DisplacementMapRable8Bit(List sources, double scale, ARGBChannel xChannelSelector, ARGBChannel yChannelSelector)
  • Method Details

    • getBounds2D

      public Rectangle2D getBounds2D()
      Description copied from interface: Filter
      Returns the bounds of the current image. This should be 'in sync' with getMinX, getMinY, getWidth, getHeight
      Specified by:
      getBounds2D in interface Filter
      Overrides:
      getBounds2D in class AbstractRable
    • setScale

      public void setScale(double scale)
      The displacement scale factor
      Specified by:
      setScale in interface DisplacementMapRable
      Parameters:
      scale - can be any number.
    • getScale

      public double getScale()
      Returns the displacement scale factor
      Specified by:
      getScale in interface DisplacementMapRable
    • setSources

      public void setSources(List sources)
      Sets this filter sources.
      Specified by:
      setSources in interface DisplacementMapRable
      Parameters:
      sources - The list of images used in the operation.
    • setXChannelSelector

      public void setXChannelSelector(ARGBChannel xChannelSelector)
      Select which component values will be used for displacement along the X axis
      Specified by:
      setXChannelSelector in interface DisplacementMapRable
      Parameters:
      xChannelSelector - value is among R, G, B and A.
    • getXChannelSelector

      public ARGBChannel getXChannelSelector()
      Returns the xChannelSelector
      Specified by:
      getXChannelSelector in interface DisplacementMapRable
    • setYChannelSelector

      public void setYChannelSelector(ARGBChannel yChannelSelector)
      Select which component values will be used for displacement along the Y axis
      Specified by:
      setYChannelSelector in interface DisplacementMapRable
      Parameters:
      yChannelSelector - value is among R, G, B and A.
    • getYChannelSelector

      public ARGBChannel getYChannelSelector()
      Returns the yChannelSelector
      Specified by:
      getYChannelSelector in interface DisplacementMapRable
    • createRendering

      public RenderedImage createRendering(RenderContext rc)
      Specified by:
      createRendering in interface RenderableImage
    • getDependencyRegion

      public Shape getDependencyRegion(int srcIndex, Rectangle2D outputRgn)
      Returns the region of input data is is required to generate outputRgn.
      Specified by:
      getDependencyRegion in interface Filter
      Overrides:
      getDependencyRegion in class AbstractRable
      Parameters:
      srcIndex - The source to do the dependency calculation for.
      outputRgn - The region of output you are interested in generating dependencies for. The is given in the user coordiate system for this node.
      Returns:
      The region of input required. This is in the user coordinate system for the source indicated by srcIndex.
    • getDirtyRegion

      public Shape getDirtyRegion(int srcIndex, Rectangle2D inputRgn)
      This calculates the region of output that is affected by a change in a region of input.
      Specified by:
      getDirtyRegion in interface Filter
      Overrides:
      getDirtyRegion in class AbstractRable
      Parameters:
      srcIndex - The input that inputRgn reflects changes in.
      inputRgn - the region of input that has changed, used to calculate the returned shape. This is given in the user coordinate system of the source indicated by srcIndex.
      Returns:
      The region of output that would be invalid given a change to inputRgn of the source selected by srcIndex. this is in the user coordinate system of this node.