public class GifDecoder extends Object
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 and Description |
|---|
GifDecoder(InputSource inputSource)
Constructs new GifDecoder.
|
GifDecoder(InputSource inputSource,
GifOptions options)
Constructs new GifDecoder
|
| Modifier and Type | Method and Description |
|---|---|
long |
getAllocationByteCount()
|
String |
getComment()
|
int |
getDuration()
|
int |
getFrameDuration(int index)
|
int |
getHeight() |
int |
getLoopCount()
|
int |
getNumberOfFrames() |
long |
getSourceLength()
|
int |
getWidth() |
boolean |
isAnimated() |
void |
recycle()
|
void |
seekToFrame(int frameIndex,
android.graphics.Bitmap buffer)
|
void |
seekToTime(int position,
android.graphics.Bitmap buffer)
|
public GifDecoder(@NonNull
InputSource inputSource)
throws IOException
GifDecoder(InputSource, GifOptions) with null optionsinputSource - sourceIOException - when creation failspublic GifDecoder(@NonNull
InputSource inputSource,
@Nullable
GifOptions options)
throws IOException
inputSource - sourceoptions - null-ok; options controlling subsampling and opacityIOException - when creation failspublic String getComment()
public int getLoopCount()
public long getSourceLength()
public void seekToTime(int position,
@NonNull
android.graphics.Bitmap buffer)
position - position to seek to in millisecondsbuffer - the frame bufferIllegalArgumentException - if position < 0 or buffer is recycledpublic void seekToFrame(int frameIndex,
@NonNull
android.graphics.Bitmap buffer)
frameIndex - position to seek to in millisecondsbuffer - the frame bufferIllegalArgumentException - if frameIndex < 0 or buffer is recycledpublic long getAllocationByteCount()
public int getFrameDuration(int index)
index - index of the frameIndexOutOfBoundsException - if index < 0 || index >= <number of frames>public int getDuration()
public int getWidth()
public int getHeight()
public int getNumberOfFrames()
public boolean isAnimated()
public void recycle()