Package com.batch.android.messaging.gif
Class BasicBitmapProvider
- java.lang.Object
-
- com.batch.android.messaging.gif.BasicBitmapProvider
-
- All Implemented Interfaces:
GifDecoder.BitmapProvider
public class BasicBitmapProvider extends java.lang.Object implements GifDecoder.BitmapProvider
Simple BitmapProvider that doesn't pool bitmaps
-
-
Constructor Summary
Constructors Constructor Description BasicBitmapProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description android.graphics.Bitmapobtain(int width, int height, android.graphics.Bitmap.Config config)Returns anBitmapwith 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.voidrelease(byte[] bytes)Releases the given byte array back to the pool.voidrelease(int[] array)Release the given array back to the pool.voidrelease(android.graphics.Bitmap bitmap)Releases the given Bitmap back to the pool.
-
-
-
Method Detail
-
obtain
@NonNull public android.graphics.Bitmap obtain(int width, int height, @NonNull android.graphics.Bitmap.Config config)Description copied from interface:GifDecoder.BitmapProviderReturns anBitmapwith exactly the given dimensions and config.- Specified by:
obtainin interfaceGifDecoder.BitmapProvider- Parameters:
width- The width in pixels of the desiredBitmap.height- The height in pixels of the desiredBitmap.config- TheBitmap.Configof the desiredBitmap.
-
release
public void release(@NonNull android.graphics.Bitmap bitmap)Description copied from interface:GifDecoder.BitmapProviderReleases the given Bitmap back to the pool.- Specified by:
releasein interfaceGifDecoder.BitmapProvider
-
obtainByteArray
@NonNull public byte[] obtainByteArray(int size)
Description copied from interface:GifDecoder.BitmapProviderReturns a byte array used for decoding and generating the frame bitmap.- Specified by:
obtainByteArrayin interfaceGifDecoder.BitmapProvider- Parameters:
size- the size of the byte array to obtain
-
release
public void release(@NonNull byte[] bytes)Description copied from interface:GifDecoder.BitmapProviderReleases the given byte array back to the pool.- Specified by:
releasein interfaceGifDecoder.BitmapProvider
-
obtainIntArray
@NonNull public int[] obtainIntArray(int size)
Description copied from interface:GifDecoder.BitmapProviderReturns an int array used for decoding/generating the frame bitmaps.- Specified by:
obtainIntArrayin interfaceGifDecoder.BitmapProvider
-
release
public void release(@NonNull int[] array)Description copied from interface:GifDecoder.BitmapProviderRelease the given array back to the pool.- Specified by:
releasein interfaceGifDecoder.BitmapProvider
-
-