java.lang.Object | |
↳ | com.facebook.imagepipeline.animated.impl.AnimatedDrawableBackendImpl |
An AnimatedDrawableBackend
that renders AnimatedImage
.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AnimatedDrawableBackendImpl(AnimatedDrawableUtil animatedDrawableUtil, AnimatedImageResult animatedImageResult, Rect bounds, boolean downscaleFrameToDrawableDimensions) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
synchronized void |
dropCaches()
Instructs the backend to drop its caches.
| ||||||||||
AnimatedDrawableBackend |
forNewBounds(Rect bounds)
Creates a new
AnimatedDrawableBackend with the same parameters but with a new bounds. | ||||||||||
AnimatedImageResult |
getAnimatedImageResult()
Gets the original result of the decode.
| ||||||||||
int |
getDurationMs()
Gets the duration of the animation.
| ||||||||||
int |
getDurationMsForFrame(int frameNumber)
Gets the duration of the specified frame.
| ||||||||||
int |
getFrameCount()
Gets the number of frames in the animation.
| ||||||||||
int |
getFrameForPreview()
Gets the frame number to use for the preview frame.
| ||||||||||
int |
getFrameForTimestampMs(int timestampMs)
Gets the frame index for specified timestamp.
| ||||||||||
AnimatedDrawableFrameInfo |
getFrameInfo(int frameNumber)
Gets info about the specified frame.
| ||||||||||
int |
getHeight()
Gets the height of the image.
| ||||||||||
int |
getLoopCount()
Gets the number of loops to run the animation for.
| ||||||||||
synchronized int |
getMemoryUsage()
Gets the number of bytes currently used by the backend for caching (for debugging)
| ||||||||||
CloseableReference<Bitmap> |
getPreDecodedFrame(int frameNumber)
Gets a pre-decoded frame.
| ||||||||||
int |
getRenderedHeight()
Gets the rendered height of the image.
| ||||||||||
int |
getRenderedWidth()
Gets the rendered width of the image.
| ||||||||||
int |
getTimestampMsForFrame(int frameNumber)
Gets the timestamp relative to the first frame that this frame number starts at.
| ||||||||||
int |
getWidth()
Gets the width of the image.
| ||||||||||
boolean |
hasPreDecodedFrame(int index)
Gets whether it has the decoded frame.
| ||||||||||
void |
renderFrame(int frameNumber, Canvas canvas)
Renders the specified frame onto the canvas.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.facebook.imagepipeline.animated.base.AnimatedDrawableBackend
|
Instructs the backend to drop its caches.
Creates a new AnimatedDrawableBackend
with the same parameters but with a new bounds.
bounds | the bounds |
---|
AnimatedDrawableBackend
with the new bounds (this may be the same instance
if the bounds don't require a new backend)
Gets the original result of the decode.
Gets the duration of the animation.
Gets the duration of the specified frame.
frameNumber | the frame number |
---|
Gets the number of frames in the animation.
Gets the frame number to use for the preview frame.
Gets the frame index for specified timestamp.
timestampMs | the timestamp |
---|
Gets info about the specified frame.
frameNumber | the frame number (0-based) |
---|
Gets the height of the image.
Gets the number of loops to run the animation for.
Gets the number of bytes currently used by the backend for caching (for debugging)
Gets a pre-decoded frame. This will only return non-null if the ImageDecodeOptions
were
configured to decode all frames at decode time.
frameNumber | the index of the frame to get |
---|
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.
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.
Gets the timestamp relative to the first frame that this frame number starts at.
frameNumber | the frame number |
---|
Gets the width of the image.
Gets whether it has the decoded frame. This will only return true if the ImageDecodeOptions
were configured to decode all frames at decode time.
index | the index of the frame to get |
---|
Renders the specified frame onto the canvas.
frameNumber | the frame number (0-based) |
---|---|
canvas | the canvas to render onto |