类 BoxBlurFilter

  • 所有已实现的接口:
    BufferedImageOp, Cloneable

    public class BoxBlurFilter
    extends AbstractBufferedImageOp
    A filter which performs a box blur on an image. The horizontal and vertical blurs can be specified separately and a number of iterations can be given which allows an approximation to Gaussian blur.
    • 构造器详细资料

      • BoxBlurFilter

        public BoxBlurFilter()
        Construct a default BoxBlurFilter.
      • BoxBlurFilter

        public BoxBlurFilter​(float hRadius,
                             float vRadius,
                             int iterations)
        Construct a BoxBlurFilter.
        参数:
        hRadius - the horizontal radius of blur
        vRadius - the vertical radius of blur
        iterations - the number of time to iterate the blur
    • 方法详细资料

      • setPremultiplyAlpha

        public void setPremultiplyAlpha​(boolean premultiplyAlpha)
        Set whether to premultiply the alpha channel.
        参数:
        premultiplyAlpha - true to premultiply the alpha
        另请参阅:
        getPremultiplyAlpha()
      • getPremultiplyAlpha

        public boolean getPremultiplyAlpha()
        Get whether to premultiply the alpha channel.
        返回:
        true to premultiply the alpha
        另请参阅:
        setPremultiplyAlpha(boolean)
      • blur

        public static void blur​(int[] in,
                                int[] out,
                                int width,
                                int height,
                                float radius)
        Blur and transpose a block of ARGB pixels.
        参数:
        in - the input pixels
        out - the output pixels
        width - the width of the pixel array
        height - the height of the pixel array
        radius - the radius of blur
      • blurFractional

        public static void blurFractional​(int[] in,
                                          int[] out,
                                          int width,
                                          int height,
                                          float radius)
      • setHRadius

        public void setHRadius​(float hRadius)
        Set the horizontal size of the blur.
        参数:
        hRadius - the radius of the blur in the horizontal direction
        另请参阅:
        getHRadius()
      • getHRadius

        public float getHRadius()
        Get the horizontal size of the blur.
        返回:
        the radius of the blur in the horizontal direction
        另请参阅:
        setHRadius(float)
      • setVRadius

        public void setVRadius​(float vRadius)
        Set the vertical size of the blur.
        参数:
        vRadius - the radius of the blur in the vertical direction
        另请参阅:
        getVRadius()
      • getVRadius

        public float getVRadius()
        Get the vertical size of the blur.
        返回:
        the radius of the blur in the vertical direction
        另请参阅:
        setVRadius(float)
      • setRadius

        public void setRadius​(float radius)
        Set both the horizontal and vertical sizes of the blur.
        参数:
        radius - the radius of the blur in both directions
        另请参阅:
        getRadius()
      • getRadius

        public float getRadius()
        Get the size of the blur.
        返回:
        the radius of the blur in the horizontal direction
        另请参阅:
        setRadius(float)
      • setIterations

        public void setIterations​(int iterations)
        Set the number of iterations the blur is performed.
        参数:
        iterations - the number of iterations
        另请参阅:
        getIterations()
      • getIterations

        public int getIterations()
        Get the number of iterations the blur is performed.
        返回:
        the number of iterations
        另请参阅:
        setIterations(int)