Class BloomFilter

  • All Implemented Interfaces:
    java.awt.image.BufferedImageOp

    public class BloomFilter
    extends BlurFilter
    An image filter that applies a bloom effect to images. Bloom adds bright, blurry fringes around the bright areas of an image.

    In-place filtering: This class supports in-place filtering (the source and destination images can be the same).

    Since:
    3.0
    Author:
    Chris Jennings
    • Constructor Detail

      • BloomFilter

        public BloomFilter()
    • Method Detail

      • getStrength

        public float getStrength()
        Returns the strength of the bloom effect, between 0 and 1.
        Returns:
        the strength of the bloom glow
      • setStrength

        public void setStrength​(float strength)
        Sets the strength of the bloom effect. The bloom strength must be between 0 and 1 inclusive. The higher the value, the brighter the glow caused by the bloom.
        Parameters:
        strength - the bloom strength, between 0 to 1
      • getThreshold

        public float getThreshold()
        Returns the brightness threshold for applying bloom effect. This is a value between 0 and 1 that defines the minimum brightness of a pixel before the bloom effect will show through.
        Returns:
        the brightness threshold, from 0 to 1
      • setThreshold

        public void setThreshold​(float threshold)
        Sets the brightness threshold for applying bloom effect. This is a value between 0 and 1 that defines the minimum brightness of a pixel before the bloom effect will show through. For pixels above the threshold, the strength of the bloom effect is proportional to the amount that the brightness exceeds the threshold.
        Parameters:
        threshold - the brightness threshold, from 0 to 1
      • filter

        public java.awt.image.BufferedImage filter​(java.awt.image.BufferedImage src,
                                                   java.awt.image.BufferedImage dst)
        Applies the bloom filter to an image, storing the result in the specified destination.
        Specified by:
        filter in interface java.awt.image.BufferedImageOp
        Overrides:
        filter in class BlurFilter
        Parameters:
        src - the source image to blur
        dst - the destination image to copy the result to, or null
        Returns:
        the destination image