public interface

AnimatedImage

com.facebook.imagepipeline.animated.base.AnimatedImage
Known Indirect Subclasses

Class Overview

Common interface for an animated image.

Summary

Constants
int LOOP_COUNT_INFINITE
Public Methods
abstract void dispose()
Disposes the instance.
abstract boolean doesRenderSupportScaling()
Returns whether renderFrame(int, int, Bitmap) supports scaling to arbitrary sizes or whether scaling must be done externally.
abstract int getDuration()
Gets the duration of the animated image.
abstract AnimatedImageFrame getFrame(int frameNumber)
Creates an AnimatedImageFrame at the specified index.
abstract int getFrameCount()
Gets the number of frames in the image.
abstract int[] getFrameDurations()
Gets the duration of each frame of the animated image.
abstract AnimatedDrawableFrameInfo getFrameInfo(int frameNumber)
Gets the frame info for the specified frame.
abstract int getHeight()
Gets the height of the image (also known as the canvas in WebP nomenclature).
abstract int getLoopCount()
Gets the number of loops to run the animation for.
abstract int getSizeInBytes()
Gets the size of bytes of the encoded image data (which is the data kept in memory for the image).
abstract int getWidth()
Gets the width of the image (also known as the canvas in WebP nomenclature).

Constants

public static final int LOOP_COUNT_INFINITE

Constant Value: 0 (0x00000000)

Public Methods

public abstract void dispose ()

Disposes the instance. This will free native resources held by this instance. Once called, other methods on this instance may throw. Note, the underlying native resources may not actually be freed until all associated instances of AnimatedImageFrame are disposed or finalized as well.

public abstract boolean doesRenderSupportScaling ()

Returns whether renderFrame(int, int, Bitmap) supports scaling to arbitrary sizes or whether scaling must be done externally.

Returns
  • whether rendering supports scaling

public abstract int getDuration ()

Gets the duration of the animated image.

Returns
  • the duration of the animated image in milliseconds

public abstract AnimatedImageFrame getFrame (int frameNumber)

Creates an AnimatedImageFrame at the specified index.

Parameters
frameNumber the index of the frame
Returns

public abstract int getFrameCount ()

Gets the number of frames in the image.

Returns
  • the number of frames in the image

public abstract int[] getFrameDurations ()

Gets the duration of each frame of the animated image.

Returns
  • an array that is the size of the number of frames containing the duration of each frame in milliseconds

public abstract AnimatedDrawableFrameInfo getFrameInfo (int frameNumber)

Gets the frame info for the specified frame.

Parameters
frameNumber the frame to get the info for
Returns
  • the frame info

public abstract int getHeight ()

Gets the height of the image (also known as the canvas in WebP nomenclature).

Returns
  • the height of the image

public abstract int getLoopCount ()

Gets the number of loops to run the animation for.

Returns
  • the number of loops, or 0 to indicate infinite

public abstract int getSizeInBytes ()

Gets the size of bytes of the encoded image data (which is the data kept in memory for the image).

Returns
  • the size in bytes of the encoded image data

public abstract int getWidth ()

Gets the width of the image (also known as the canvas in WebP nomenclature).

Returns
  • the width of the image