Class LightFilter

All Implemented Interfaces:
BufferedImageOp, Cloneable
Direct Known Subclasses:
ChromeFilter

public class LightFilter extends WholeImageFilter
A filter which produces lighting and embossing effects.
  • Field Details

    • COLORS_FROM_IMAGE

      public static final int COLORS_FROM_IMAGE
      Take the output colors from the input image.
      See Also:
    • COLORS_CONSTANT

      public static final int COLORS_CONSTANT
      Use constant material color.
      See Also:
    • BUMPS_FROM_IMAGE

      public static final int BUMPS_FROM_IMAGE
      Use the input image brightness as the bump map.
      See Also:
    • BUMPS_FROM_IMAGE_ALPHA

      public static final int BUMPS_FROM_IMAGE_ALPHA
      Use the input image alpha as the bump map.
      See Also:
    • BUMPS_FROM_MAP

      public static final int BUMPS_FROM_MAP
      Use a separate image alpha channel as the bump map.
      See Also:
    • BUMPS_FROM_BEVEL

      public static final int BUMPS_FROM_BEVEL
      Use a custom function as the bump map.
      See Also:
    • r255

      protected static final float r255
      See Also:
    • AMBIENT

      public static final int AMBIENT
      See Also:
    • DISTANT

      public static final int DISTANT
      See Also:
    • POINT

      public static final int POINT
      See Also:
    • SPOT

      public static final int SPOT
      See Also:
  • Constructor Details

    • LightFilter

      public LightFilter()
  • Method Details

    • setMaterial

      public void setMaterial(LightFilter.Material material)
    • getMaterial

      public LightFilter.Material getMaterial()
    • setBumpFunction

      public void setBumpFunction(Function2D bumpFunction)
    • getBumpFunction

      public Function2D getBumpFunction()
    • setBumpHeight

      public void setBumpHeight(float bumpHeight)
    • getBumpHeight

      public float getBumpHeight()
    • setBumpSoftness

      public void setBumpSoftness(float bumpSoftness)
    • getBumpSoftness

      public float getBumpSoftness()
    • setViewDistance

      public void setViewDistance(float viewDistance)
    • getViewDistance

      public float getViewDistance()
    • setEnvironmentMap

      public void setEnvironmentMap(BufferedImage environmentMap)
    • getEnvironmentMap

      public Image getEnvironmentMap()
    • setColorSource

      public void setColorSource(int colorSource)
    • getColorSource

      public int getColorSource()
    • setBumpSource

      public void setBumpSource(int bumpSource)
    • getBumpSource

      public int getBumpSource()
    • setDiffuseColor

      public void setDiffuseColor(int diffuseColor)
    • getDiffuseColor

      public int getDiffuseColor()
    • addLight

      public void addLight(LightFilter.Light light)
    • removeLight

      public void removeLight(LightFilter.Light light)
    • getLights

      public Vector getLights()
    • setFromRGB

      protected void setFromRGB(Color4f c, int argb)
    • filterPixels

      protected int[] filterPixels(int width, int height, int[] inPixels, Rectangle transformedSpace)
      Description copied from class: WholeImageFilter
      Actually filter the pixels.
      Specified by:
      filterPixels in class WholeImageFilter
      Parameters:
      width - the image width
      height - the image height
      inPixels - the image pixels
      transformedSpace - the output bounds
      Returns:
      the output pixels
    • phongShade

      protected Color4f phongShade(Vector3f position, Vector3f viewpoint, Vector3f normal, Color4f diffuseColor, Color4f specularColor, LightFilter.Material material, LightFilter.Light[] lightsArray)
    • toString

      public String toString()
      Overrides:
      toString in class Object