public final class GifBitmapProvider extends Object implements GifDecoder.BitmapProvider
GifDecoder.BitmapProvider
by wrapping Glide's
BitmapPool
.构造器和说明 |
---|
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.
|
限定符和类型 | 方法和说明 |
---|---|
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, @Nullable ArrayPool arrayPool)
@NonNull public Bitmap obtain(int width, int height, @NonNull Bitmap.Config config)
GifDecoder.BitmapProvider
Bitmap
with exactly the given dimensions and config.obtain
在接口中 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(@NonNull Bitmap bitmap)
GifDecoder.BitmapProvider
release
在接口中 GifDecoder.BitmapProvider
@NonNull public byte[] obtainByteArray(int size)
GifDecoder.BitmapProvider
obtainByteArray
在接口中 GifDecoder.BitmapProvider
size
- the size of the byte array to obtainpublic void release(@NonNull byte[] bytes)
GifDecoder.BitmapProvider
release
在接口中 GifDecoder.BitmapProvider
@NonNull public int[] obtainIntArray(int size)
GifDecoder.BitmapProvider
obtainIntArray
在接口中 GifDecoder.BitmapProvider
public void release(@NonNull int[] array)
GifDecoder.BitmapProvider
release
在接口中 GifDecoder.BitmapProvider