-
- All Implemented Interfaces:
-
com.facebook.imagepipeline.animated.base.AnimatedImage,com.facebook.imagepipeline.animated.factory.AnimatedImageDecoder
@ThreadSafe() public class WebPImage implements AnimatedImage, AnimatedImageDecoderA representation of a WebP image. An instance of this class will hold a copy of the encoded data in memory along with the parsed header data. Frames are decoded on demand via WebPFrame.
-
-
Constructor Summary
Constructors Constructor Description WebPImage()
-
Method Summary
Modifier and Type Method Description voiddispose()static WebPImagecreateFromByteArray(Array<byte> source, @Nullable() ImageDecodeOptions options)Creates a WebPImage from the specified encoded data. static WebPImagecreateFromByteBuffer(ByteBuffer byteBuffer, @Nullable() ImageDecodeOptions options)Creates a WebPImage from a ByteBuffer containing the image. static WebPImagecreateFromNativeMemory(long nativePtr, int sizeInBytes, @Nullable() ImageDecodeOptions options)AnimatedImagedecodeFromNativeMemory(long nativePtr, int sizeInBytes, ImageDecodeOptions options)AnimatedImagedecodeFromByteBuffer(ByteBuffer byteBuffer, ImageDecodeOptions options)intgetWidth()intgetHeight()intgetFrameCount()intgetDuration()Array<int>getFrameDurations()intgetLoopCount()WebPFramegetFrame(int frameNumber)intgetSizeInBytes()booleandoesRenderSupportScaling()AnimatedDrawableFrameInfogetFrameInfo(int frameNumber)Bitmap.ConfiggetAnimatedBitmapConfig()-
Methods inherited from class com.facebook.imagepipeline.animated.base.AnimatedImage
dispose, doesRenderSupportScaling, getAnimatedBitmapConfig, getDuration, getFrame, getFrameCount, getFrameDurations, getFrameInfo, getHeight, getLoopCount, getSizeInBytes, getWidth -
Methods inherited from class com.facebook.imagepipeline.animated.factory.AnimatedImageDecoder
decodeFromByteBuffer, decodeFromNativeMemory -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
dispose
void dispose()
-
createFromByteArray
static WebPImage createFromByteArray(Array<byte> source, @Nullable() ImageDecodeOptions options)
Creates a WebPImage from the specified encoded data. This will throw if it fails tocreate. This is meant to be called on a worker thread.
- Parameters:
source- the data to the image (a copy will be made)
-
createFromByteBuffer
static WebPImage createFromByteBuffer(ByteBuffer byteBuffer, @Nullable() ImageDecodeOptions options)
Creates a WebPImage from a ByteBuffer containing the image. This will throw if it failsto create.
- Parameters:
byteBuffer- the ByteBuffer containing the image
-
createFromNativeMemory
static WebPImage createFromNativeMemory(long nativePtr, int sizeInBytes, @Nullable() ImageDecodeOptions options)
-
decodeFromNativeMemory
AnimatedImage decodeFromNativeMemory(long nativePtr, int sizeInBytes, ImageDecodeOptions options)
-
decodeFromByteBuffer
AnimatedImage decodeFromByteBuffer(ByteBuffer byteBuffer, ImageDecodeOptions options)
-
getWidth
int getWidth()
-
getHeight
int getHeight()
-
getFrameCount
int getFrameCount()
-
getDuration
int getDuration()
-
getFrameDurations
Array<int> getFrameDurations()
-
getLoopCount
int getLoopCount()
-
getSizeInBytes
int getSizeInBytes()
-
doesRenderSupportScaling
boolean doesRenderSupportScaling()
-
getFrameInfo
AnimatedDrawableFrameInfo getFrameInfo(int frameNumber)
-
getAnimatedBitmapConfig
@Nullable() Bitmap.Config getAnimatedBitmapConfig()
-
-
-
-