Class RMEmbossEffect

All Implemented Interfaces:
Archivable, DeepChangeListener, RMPropertyChanger, PropertyChangeListener, Cloneable, EventListener
Direct Known Subclasses:
RMChiselEffect

public class RMEmbossEffect extends RMImageEffect
Renders a given shape with an emboss effect.
  • Constructor Details

    • RMEmbossEffect

      public RMEmbossEffect()
      Creates a new emboss effect.
    • RMEmbossEffect

      public RMEmbossEffect(float altitude, float azimuth, int radius)
      Creates a new emboss effect with given altitude, azimuth and radius.
  • Method Details

    • getAltitude

      public float getAltitude()
      Returns altitude of light source.
    • getAzimuth

      public float getAzimuth()
      Returns angle of light source.
    • getRadius

      public int getRadius()
      Returns radius of edge rounding.
    • deriveEffect

      public RMEmbossEffect deriveEffect(float newAltitude, float newAzimuth)
      Derive with new altitude and azimuth.
    • deriveEffect

      public RMEmbossEffect deriveEffect(int newRadius)
      Derive with new radius.
    • getImage

      public BufferedImage getImage(RMShape aShape)
      Creates effect image
      Specified by:
      getImage in class RMImageEffect
    • emboss

      public void emboss(BufferedImage source, BufferedImage bump)
      Emboss a 24 bit source image according to a bump map. Bump map is assumed to to be (2*_radius x 2*_radius) pixels larger than the source to compensate for edge conditions of both the blur and the emboss convolutions.
    • isolateHeightSample

      public void isolateHeightSample(int[] bumpPixels, int w, int h)
      Converts the argb bumpSamples into an array of signed ints representing the height. Height values should be in the range 0-255
    • paint

      public void paint(RMShapePainter aPntr, RMShape aShape)
      Render this fill in a shape painter.
      Overrides:
      paint in class RMEffect
    • equals

      public boolean equals(Object anObj)
      Standard equals implementation.
      Overrides:
      equals in class Object
    • toXML

      public RXElement toXML(RXArchiver anArchiver)
      XML archival.
      Specified by:
      toXML in interface Archivable
      Overrides:
      toXML in class RMEffect
    • fromXML

      public Object fromXML(RXArchiver anArchiver, RXElement anElement)
      XML unarchival.
      Specified by:
      fromXML in interface Archivable
      Overrides:
      fromXML in class RMEffect