-
- All Implemented Interfaces:
-
com.facebook.imagepipeline.animated.base.AnimatedImage,com.facebook.imagepipeline.animated.factory.AnimatedImageDecoder
@ThreadSafe() public class GifImage implements AnimatedImage, AnimatedImageDecoderA representation of a GIF 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 GifFrame.
-
-
Constructor Summary
Constructors Constructor Description GifImage()
-
Method Summary
Modifier and Type Method Description static GifImagecreateFromByteArray(Array<byte> source)Creates a GifImage from the specified encoded data. static GifImagecreateFromByteBuffer(ByteBuffer byteBuffer)Creates a GifImage from a ByteBuffer containing the image. static GifImagecreateFromByteBuffer(ByteBuffer byteBuffer, ImageDecodeOptions options)Creates a GifImage from a ByteBuffer containing the image. static GifImagecreateFromNativeMemory(long nativePtr, int sizeInBytes, ImageDecodeOptions options)static GifImagecreateFromFileDescriptor(int fileDescriptor, ImageDecodeOptions options)Creates a GifImage from a file descriptor containing the image. AnimatedImagedecodeFromNativeMemory(long nativePtr, int sizeInBytes, ImageDecodeOptions options)AnimatedImagedecodeFromByteBuffer(ByteBuffer byteBuffer, ImageDecodeOptions options)voiddispose()intgetWidth()intgetHeight()intgetFrameCount()intgetDuration()Array<int>getFrameDurations()intgetLoopCount()GifFramegetFrame(int frameNumber)booleandoesRenderSupportScaling()intgetSizeInBytes()booleanisAnimated()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
-
createFromByteArray
static GifImage createFromByteArray(Array<byte> source)
Creates a GifImage 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 GifImage createFromByteBuffer(ByteBuffer byteBuffer)
Creates a GifImage from a ByteBuffer containing the image. This will throw if it failsto create.
- Parameters:
byteBuffer- the ByteBuffer containing the image (a copy will be made)
-
createFromByteBuffer
static GifImage createFromByteBuffer(ByteBuffer byteBuffer, ImageDecodeOptions options)
Creates a GifImage from a ByteBuffer containing the image. This will throw if it failsto create.
- Parameters:
byteBuffer- the ByteBuffer containing the image (a copy will be made)
-
createFromNativeMemory
static GifImage createFromNativeMemory(long nativePtr, int sizeInBytes, ImageDecodeOptions options)
-
createFromFileDescriptor
static GifImage createFromFileDescriptor(int fileDescriptor, ImageDecodeOptions options)
Creates a GifImage from a file descriptor containing the image. This will throw if itfails to create.
- Parameters:
fileDescriptor- the file descriptor containing the image (a copy will be made)
-
decodeFromNativeMemory
AnimatedImage decodeFromNativeMemory(long nativePtr, int sizeInBytes, ImageDecodeOptions options)
-
decodeFromByteBuffer
AnimatedImage decodeFromByteBuffer(ByteBuffer byteBuffer, ImageDecodeOptions options)
-
dispose
void dispose()
-
getWidth
int getWidth()
-
getHeight
int getHeight()
-
getFrameCount
int getFrameCount()
-
getDuration
int getDuration()
-
getFrameDurations
Array<int> getFrameDurations()
-
getLoopCount
int getLoopCount()
-
doesRenderSupportScaling
boolean doesRenderSupportScaling()
-
getSizeInBytes
int getSizeInBytes()
-
isAnimated
boolean isAnimated()
-
getFrameInfo
AnimatedDrawableFrameInfo getFrameInfo(int frameNumber)
-
getAnimatedBitmapConfig
@Nullable() Bitmap.Config getAnimatedBitmapConfig()
-
-
-
-