-
public class GifDecoderGifDecoder allows lightweight access to GIF frames, without wrappers like Drawable or View. Bitmap with size equal to or greater than size of the GIF is needed. For access only metadata (size, number of frames etc.) without pixels see GifAnimationMetaData.
-
-
Constructor Summary
Constructors Constructor Description GifDecoder(InputSource inputSource)Constructs new GifDecoder. GifDecoder(InputSource inputSource, GifOptions options)Constructs new GifDecoder
-
Method Summary
Modifier and Type Method Description StringgetComment()See getComment intgetLoopCount()See getLoopCount longgetSourceLength()See getInputSourceByteCount voidseekToTime(@IntRange(from = 0, to = Integer.MAX_VALUE) int position, @NonNull() Bitmap buffer)See seekTo voidseekToFrame(@IntRange(from = 0, to = Integer.MAX_VALUE) int frameIndex, @NonNull() Bitmap buffer)See seekToFrame longgetAllocationByteCount()See getAllocationByteCount intgetFrameDuration(@IntRange(from = 0) int index)See getFrameDuration intgetDuration()See getDuration intgetWidth()intgetHeight()intgetNumberOfFrames()booleanisAnimated()voidrecycle()See recycle -
-
Constructor Detail
-
GifDecoder
GifDecoder(InputSource inputSource)
Constructs new GifDecoder.- Parameters:
inputSource- source
-
GifDecoder
GifDecoder(InputSource inputSource, GifOptions options)
Constructs new GifDecoder- Parameters:
inputSource- sourceoptions- null-ok; options controlling subsampling and opacity
-
-
Method Detail
-
getComment
String getComment()
See getComment
-
getLoopCount
int getLoopCount()
See getLoopCount
-
getSourceLength
long getSourceLength()
-
seekToTime
void seekToTime(@IntRange(from = 0, to = Integer.MAX_VALUE) int position, @NonNull() Bitmap buffer)
See seekTo
- Parameters:
position- position to seek to in millisecondsbuffer- the frame buffer
-
seekToFrame
void seekToFrame(@IntRange(from = 0, to = Integer.MAX_VALUE) int frameIndex, @NonNull() Bitmap buffer)
See seekToFrame
- Parameters:
frameIndex- position to seek to in millisecondsbuffer- the frame buffer
-
getAllocationByteCount
long getAllocationByteCount()
-
getFrameDuration
int getFrameDuration(@IntRange(from = 0) int index)
See getFrameDuration
- Parameters:
index- index of the frame
-
getDuration
int getDuration()
See getDuration
-
getWidth
int getWidth()
-
getHeight
int getHeight()
-
getNumberOfFrames
int getNumberOfFrames()
-
isAnimated
boolean isAnimated()
-
-
-
-