public final class GifBitmapProvider extends Object implements GifDecoder.BitmapProvider
GifDecoder.BitmapProvider
by wrapping Glide's
BitmapPool
.Constructor and Description |
---|
GifBitmapProvider(BitmapPool bitmapPool)
Constructs an instance without a shared byte array pool.
|
GifBitmapProvider(BitmapPool bitmapPool,
ArrayPool arrayPool)
Constructs an instance with a shared array pool.
|
Modifier and Type | Method and Description |
---|---|
Bitmap |
obtain(int width,
int height,
Bitmap.Config config)
Returns an
Bitmap with exactly the given dimensions and config. |
byte[] |
obtainByteArray(int size)
Returns a byte array used for decoding and generating the frame bitmap.
|
int[] |
obtainIntArray(int size)
Returns an int array used for decoding/generating the frame bitmaps.
|
void |
release(Bitmap bitmap)
Releases the given Bitmap back to the pool.
|
void |
release(byte[] bytes)
Releases the given byte array back to the pool.
|
void |
release(int[] array)
Release the given array back to the pool.
|
public GifBitmapProvider(BitmapPool bitmapPool)
public GifBitmapProvider(BitmapPool bitmapPool, ArrayPool arrayPool)
@NonNull public Bitmap obtain(int width, int height, Bitmap.Config config)
GifDecoder.BitmapProvider
Bitmap
with exactly the given dimensions and config.obtain
in interface GifDecoder.BitmapProvider
width
- The width in pixels of the desired Bitmap
.height
- The height in pixels of the desired Bitmap
.config
- The Bitmap.Config
of the desired Bitmap
.public void release(Bitmap bitmap)
GifDecoder.BitmapProvider
release
in interface GifDecoder.BitmapProvider
public byte[] obtainByteArray(int size)
GifDecoder.BitmapProvider
obtainByteArray
in interface GifDecoder.BitmapProvider
size
- the size of the byte array to obtainpublic void release(byte[] bytes)
GifDecoder.BitmapProvider
release
in interface GifDecoder.BitmapProvider
public int[] obtainIntArray(int size)
GifDecoder.BitmapProvider
obtainIntArray
in interface GifDecoder.BitmapProvider
public void release(int[] array)
GifDecoder.BitmapProvider
release
in interface GifDecoder.BitmapProvider