-
public class GifDecoder
GifDecoder 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 String
getComment()
See getComment int
getLoopCount()
See getLoopCount long
getSourceLength()
See getInputSourceByteCount void
seekToTime(@IntRange(from = 0, to = Integer.MAX_VALUE) int position, @NonNull() Bitmap buffer)
See seekTo void
seekToFrame(@IntRange(from = 0, to = Integer.MAX_VALUE) int frameIndex, @NonNull() Bitmap buffer)
See seekToFrame long
getAllocationByteCount()
See getAllocationByteCount int
getFrameDuration(@IntRange(from = 0) int index)
See getFrameDuration int
getDuration()
See getDuration int
getWidth()
int
getHeight()
int
getNumberOfFrames()
boolean
isAnimated()
void
recycle()
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()
-
-
-
-