public class

AnimatedImageResult

extends Object
java.lang.Object
   ↳ com.facebook.imagepipeline.animated.base.AnimatedImageResult

Class Overview

The result of decoding an animated image. Contains the AnimatedImage as well as additional data.

Summary

Public Methods
synchronized void dispose()
Disposes the result, which releases the reference to any bitmaps.
static AnimatedImageResult forAnimatedImage(AnimatedImage image)
Creates an AnimatedImageResult with no additional options.
synchronized CloseableReference<Bitmap> getDecodedFrame(int index)
Gets a decoded frame.
int getFrameForPreview()
Gets the frame that should be used for the preview image.
AnimatedImage getImage()
Gets the underlying image.
synchronized CloseableReference<Bitmap> getPreviewBitmap()
Gets the bitmap for the preview frame.
synchronized boolean hasDecodedFrame(int index)
Gets whether it has the decoded frame.
static AnimatedImageResultBuilder newBuilder(AnimatedImage image)
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public synchronized void dispose ()

Disposes the result, which releases the reference to any bitmaps.

public static AnimatedImageResult forAnimatedImage (AnimatedImage image)

Creates an AnimatedImageResult with no additional options.

Parameters
image the image
Returns
  • the result

public synchronized CloseableReference<Bitmap> getDecodedFrame (int index)

Gets a decoded frame. This will only return non-null if the ImageDecodeOptions were configured to decode all frames at decode time.

Parameters
index the index of the frame to get
Returns
  • a reference to the preview bitmap which must be released by the caller when done or null if there is no preview bitmap set

public int getFrameForPreview ()

Gets the frame that should be used for the preview image. If the preview bitmap was fetched, this is the frame that it's for.

Returns
  • the frame that should be used for the preview image

public AnimatedImage getImage ()

Gets the underlying image.

Returns
  • the underlying image

public synchronized CloseableReference<Bitmap> getPreviewBitmap ()

Gets the bitmap for the preview frame. This will only return non-null if the ImageDecodeOptions were configured to decode the preview frame.

Returns
  • a reference to the preview bitmap which must be released by the caller when done or null if there is no preview bitmap set

public synchronized boolean hasDecodedFrame (int index)

Gets whether it has the decoded frame. This will only return true if the ImageDecodeOptions were configured to decode all frames at decode time.

Parameters
index the index of the frame to get
Returns
  • true if the result has the decoded frame

public static AnimatedImageResultBuilder newBuilder (AnimatedImage image)

Parameters
image the image
Returns
  • the builder