Back to Fresco

AnimatedDrawableBackendImpl

docs/javadoc/reference/com/facebook/imagepipeline/animated/impl/AnimatedDrawableBackendImpl.html

3.6.024.5 KB
Original Source

Fresco

|

|

Packages | Classes

Interfaces

Classes

Packages | Classes

Summary: Ctors | Methods | Inherited Methods | [Expand All]

public class

AnimatedDrawableBackendImpl

extends Object
implements AnimatedDrawableBackend

| java.lang.Object | | ↳ | com.facebook.imagepipeline.animated.impl.AnimatedDrawableBackendImpl |

Class Overview

An AnimatedDrawableBackend that renders AnimatedImage.

Summary

Public Constructors
Public Methods
synchronized void
Instructs the backend to drop its caches.
AnimatedDrawableBackend
Creates a new AnimatedDrawableBackend with the same parameters but with a new bounds.
AnimatedImageResult
Gets the original result of the decode.
int
Gets the duration of the animation.
int
Gets the duration of the specified frame.
int
Gets the number of frames in the animation.
int
Gets the frame number to use for the preview frame.
int
Gets the frame index for specified timestamp.
AnimatedDrawableFrameInfo
Gets info about the specified frame.
int
Gets the height of the image.
int
Gets the number of loops to run the animation for.
synchronized int
Gets the number of bytes currently used by the backend for caching (for debugging)
CloseableReference<Bitmap>
Gets a pre-decoded frame.
int
Gets the rendered height of the image.
int
Gets the rendered width of the image.
int
Gets the timestamp relative to the first frame that this frame number starts at.
int
Gets the width of the image.
boolean
Gets whether it has the decoded frame.
void
Renders the specified frame onto the canvas.

| [Expand] Inherited Methods | | --- | | From class java.lang.Object

| Object | clone() | | boolean | equals(Object arg0) | | void | finalize() | | final Class<?> | getClass() | | int | hashCode() | | final void | notify() | | final void | notifyAll() | | String | toString() | | final void | wait(long arg0, int arg1) | | final void | wait(long arg0) | | final void | wait() |

| | From interface com.facebook.imagepipeline.animated.base.AnimatedDrawableBackend

| abstract void | dropCaches() Instructs the backend to drop its caches. | | abstract AnimatedDrawableBackend | forNewBounds(Rect bounds) Creates a new AnimatedDrawableBackend with the same parameters but with a new bounds. | | abstract AnimatedImageResult | getAnimatedImageResult() Gets the original result of the decode. | | abstract int | getDurationMs() Gets the duration of the animation. | | abstract int | getDurationMsForFrame(int frameNumber) Gets the duration of the specified frame. | | abstract int | getFrameCount() Gets the number of frames in the animation. | | abstract int | getFrameForPreview() Gets the frame number to use for the preview frame. | | abstract int | getFrameForTimestampMs(int timestampMs) Gets the frame index for specified timestamp. | | abstract AnimatedDrawableFrameInfo | getFrameInfo(int frameNumber) Gets info about the specified frame. | | abstract int | getHeight() Gets the height of the image. | | abstract int | getLoopCount() Gets the number of loops to run the animation for. | | abstract int | getMemoryUsage() Gets the number of bytes currently used by the backend for caching (for debugging) | | abstract CloseableReference<Bitmap> | getPreDecodedFrame(int frameNumber) Gets a pre-decoded frame. | | abstract int | getRenderedHeight() Gets the rendered height of the image. | | abstract int | getRenderedWidth() Gets the rendered width of the image. | | abstract int | getTimestampMsForFrame(int frameNumber) Gets the timestamp relative to the first frame that this frame number starts at. | | abstract int | getWidth() Gets the width of the image. | | abstract boolean | hasPreDecodedFrame(int frameNumber) Gets whether it has the decoded frame. | | abstract void | renderFrame(int frameNumber, Canvas canvas) Renders the specified frame onto the canvas. |

|

Public Constructors

public AnimatedDrawableBackendImpl(AnimatedDrawableUtil animatedDrawableUtil, AnimatedImageResult animatedImageResult, Rect bounds, boolean downscaleFrameToDrawableDimensions)

Public Methods

public synchronized void dropCaches()

Instructs the backend to drop its caches.

public AnimatedDrawableBackend forNewBounds(Rect bounds)

Creates a new AnimatedDrawableBackend with the same parameters but with a new bounds.

Parameters

| bounds | the bounds |

Returns
  • an AnimatedDrawableBackend with the new bounds (this may be the same instance if the bounds don't require a new backend)

public AnimatedImageResult getAnimatedImageResult()

Gets the original result of the decode.

Returns
  • the original result of the code

public int getDurationMs()

Gets the duration of the animation.

Returns
  • the duration of the animation in milliseconds

public int getDurationMsForFrame(int frameNumber)

Gets the duration of the specified frame.

Parameters

| frameNumber | the frame number |

Returns
  • the time in milliseconds

public int getFrameCount()

Gets the number of frames in the animation.

Returns
  • the number of frames in the animation

public int getFrameForPreview()

Gets the frame number to use for the preview frame.

Returns
  • the frame number to use for the preview frame

public int getFrameForTimestampMs(int timestampMs)

Gets the frame index for specified timestamp.

Parameters

| timestampMs | the timestamp |

Returns
  • the frame index for the timestamp or the last frame number if the timestamp is outside the duration of the entire animation

public AnimatedDrawableFrameInfo getFrameInfo(int frameNumber)

Gets info about the specified frame.

Parameters

| frameNumber | the frame number (0-based) |

Returns
  • the frame info

public int getHeight()

Gets the height of the image.

Returns
  • the height of the image

public int getLoopCount()

Gets the number of loops to run the animation for.

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

public synchronized int getMemoryUsage()

Gets the number of bytes currently used by the backend for caching (for debugging)

Returns
  • the number of bytes currently used by the backend for caching

public CloseableReference<Bitmap> getPreDecodedFrame(int frameNumber)

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

Parameters

| frameNumber | 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 getRenderedHeight()

Gets the rendered height of the image. This may be smaller than the underlying image height if the image is being rendered to a small bounds or to reduce memory requirements.

Returns
  • the rendered height of the image

public int getRenderedWidth()

Gets the rendered width of the image. This may be smaller than the underlying image width if the image is being rendered to a small bounds or to reduce memory requirements.

Returns
  • the rendered width of the image

public int getTimestampMsForFrame(int frameNumber)

Gets the timestamp relative to the first frame that this frame number starts at.

Parameters

| frameNumber | the frame number |

Returns
  • the time in milliseconds

public int getWidth()

Gets the width of the image.

Returns
  • the width of the image

public boolean hasPreDecodedFrame(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 void renderFrame(int frameNumber, Canvas canvas)

Renders the specified frame onto the canvas.

Parameters

| frameNumber | the frame number (0-based) | | canvas | the canvas to render onto |

+Generated by Doclava. +