public static interface

AnimatedImageCompositor.Callback

com.facebook.imagepipeline.animated.impl.AnimatedImageCompositor.Callback

Class Overview

Callback for caching.

Summary

Public Methods
abstract CloseableReference<Bitmap> getCachedBitmap(int frameNumber)
Called from within renderFrame(int, Bitmap) to ask the caller for a cached bitmap for the specified frame number.
abstract void onIntermediateResult(int frameNumber, Bitmap bitmap)
Called from within renderFrame(int, Bitmap) to let the caller know that while trying generate the requested frame, an earlier frame was generated.

Public Methods

public abstract CloseableReference<Bitmap> getCachedBitmap (int frameNumber)

Called from within renderFrame(int, Bitmap) to ask the caller for a cached bitmap for the specified frame number. If the caller has the bitmap cached, it can greatly reduce the work required to render the requested frame.

Parameters
frameNumber the frame number to get
Returns
  • a reference to the bitmap. The ownership of the reference is passed to the caller who must close it.

public abstract void onIntermediateResult (int frameNumber, Bitmap bitmap)

Called from within renderFrame(int, Bitmap) to let the caller know that while trying generate the requested frame, an earlier frame was generated. This allows the caller to optionally cache the intermediate result. The caller must copy the Bitmap if it wishes to cache it as renderFrame(int, Bitmap) will continue using it generate the requested frame.

Parameters
frameNumber the frame number of the intermediate result
bitmap the bitmap which must not be modified or directly cached