public class

NativeBlurFilter

extends Object
java.lang.Object
   ↳ com.facebook.imagepipeline.nativecode.NativeBlurFilter

Class Overview

A fast native blur filter. See iterativeBoxBlur(Bitmap, int, int)

Summary

Public Constructors
NativeBlurFilter()
Public Methods
static void iterativeBoxBlur(Bitmap bitmap, int iterations, int blurRadius)
This is a fast, native implementation of an iterative box blur.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public NativeBlurFilter ()

Public Methods

public static void iterativeBoxBlur (Bitmap bitmap, int iterations, int blurRadius)

This is a fast, native implementation of an iterative box blur. The algorithm runs in-place on the provided bitmap and therefore has a very small memory footprint.

The iterative box blur has the nice property that it approximates the Gaussian blur very quickly. Usually iterations=3 is sufficient such that the casual observer cannot tell the difference.

The edge pixels are repeated such that the bitmap still has a well-defined border.

Asymptotic runtime: O(width * height * iterations)

Asymptotic memory: O(radius + max(width, height))

Parameters
bitmap The targeted bitmap that will be blurred in-place. Each dimension must not be greater than 65536.
iterations The number of iterations to run. Must be greater than 0 and not greater than 65536.
blurRadius The given blur radius. Must be greater than 0 and not greater than 65536.