public class

BlurPostProcessor

extends BasePostprocessor
java.lang.Object
   ↳ com.facebook.imagepipeline.request.BasePostprocessor
     ↳ com.facebook.imagepipeline.postprocessors.BlurPostProcessor

Class Overview

A java implementation of a blur post processor. This provide two different blurring algorithm, one Gaussian blur using ScriptIntrinsicBlur for Android version >= 4.2 and the other one is an in-place iterative box blur algorithm that runs faster than a traditional box blur.

Summary

[Expand]
Inherited Fields
From class com.facebook.imagepipeline.request.BasePostprocessor
Public Constructors
BlurPostProcessor(int blurRadius, Context context, int iterations)
Creates an instance of BlurPostProcessor.
BlurPostProcessor(int blurRadius, Context context)
Creates an instance of BlurPostProcessor.
Public Methods
CacheKey getPostprocessorCacheKey()
The default implementation of the CacheKey for a Postprocessor is null
void process(Bitmap destBitmap, Bitmap sourceBitmap)
Clients should override this method if the post-processing cannot be done in place.
void process(Bitmap bitmap)
Clients should override this method if the post-processing can be done in place.
[Expand]
Inherited Methods
From class com.facebook.imagepipeline.request.BasePostprocessor
From class java.lang.Object
From interface com.facebook.imagepipeline.request.Postprocessor

Public Constructors

public BlurPostProcessor (int blurRadius, Context context, int iterations)

Creates an instance of BlurPostProcessor.

Parameters
blurRadius The radius of the blur in range 0 < radius <= BLUR_MAX_RADIUS.
context A valid Context.
iterations The number of iterations of the blurring algorithm > 0.

public BlurPostProcessor (int blurRadius, Context context)

Creates an instance of BlurPostProcessor.

Parameters
blurRadius The radius of the blur in range 0 < radius <= BLUR_MAX_RADIUS.
context A valid Context.

Public Methods

public CacheKey getPostprocessorCacheKey ()

The default implementation of the CacheKey for a Postprocessor is null

Returns
  • The CacheKey to use for caching. Not used if null

public void process (Bitmap destBitmap, Bitmap sourceBitmap)

Clients should override this method if the post-processing cannot be done in place. If the post-processing can be done in place, clients should override the process(Bitmap) method.

The provided destination bitmap is of the same size as the source bitmap. There are no guarantees on the initial content of the destination bitmap, so the implementation has to make sure that it properly populates it.

The source bitmap must not be modified as it may be shared by the other clients. The implementation must use the provided destination bitmap as its output.

Parameters
destBitmap the destination bitmap to be used as output
sourceBitmap the source bitmap to be used as input

public void process (Bitmap bitmap)

Clients should override this method if the post-processing can be done in place.

The provided bitmap is a copy of the source bitmap and the implementation is free to modify it.

Parameters
bitmap the bitmap to be used both as input and as output