Package org.robolectric.nativeruntime
Class ImageDecoderNatives
java.lang.Object
org.robolectric.nativeruntime.ImageDecoderNatives
public final class ImageDecoderNatives extends Object
Native methods for
ImageDecoder
JNI registration.
Native method signatures are derived from https://cs.android.com/android/platform/superproject/+/android-12.0.0_r1:frameworks/base/graphics/java/android/graphics/ImageDecoder.java
-
Method Summary
Modifier and Type Method Description static void
nClose(long nativePtr)
static ImageDecoder
nCreate(byte[] data, int offset, int length, boolean preferAnimation, ImageDecoder.Source src)
static ImageDecoder
nCreate(long asset, boolean preferAnimation, ImageDecoder.Source src)
static ImageDecoder
nCreate(FileDescriptor fd, long length, boolean preferAnimation, ImageDecoder.Source src)
static ImageDecoder
nCreate(InputStream is, byte[] storage, boolean preferAnimation, ImageDecoder.Source src)
static ImageDecoder
nCreate(ByteBuffer buffer, int position, int limit, boolean preferAnimation, ImageDecoder.Source src)
static Bitmap
nDecodeBitmap(long nativePtr, ImageDecoder decoder, boolean doPostProcess, int width, int height, Rect cropRect, boolean mutable, int allocator, boolean unpremulRequired, boolean conserveMemory, boolean decodeAsAlphaMask, long desiredColorSpace, boolean extended)
static ColorSpace
nGetColorSpace(long nativePtr)
static String
nGetMimeType(long nativePtr)
static void
nGetPadding(long nativePtr, Rect outRect)
static Size
nGetSampledSize(long nativePtr, int sampleSize)
-
Method Details
-
nCreate
public static ImageDecoder nCreate(long asset, boolean preferAnimation, ImageDecoder.Source src) throws IOException- Throws:
IOException
-
nCreate
public static ImageDecoder nCreate(ByteBuffer buffer, int position, int limit, boolean preferAnimation, ImageDecoder.Source src) throws IOException- Throws:
IOException
-
nCreate
public static ImageDecoder nCreate(byte[] data, int offset, int length, boolean preferAnimation, ImageDecoder.Source src) throws IOException- Throws:
IOException
-
nCreate
public static ImageDecoder nCreate(InputStream is, byte[] storage, boolean preferAnimation, ImageDecoder.Source src) throws IOException- Throws:
IOException
-
nCreate
public static ImageDecoder nCreate(FileDescriptor fd, long length, boolean preferAnimation, ImageDecoder.Source src) throws IOException- Throws:
IOException
-
nDecodeBitmap
public static Bitmap nDecodeBitmap(long nativePtr, ImageDecoder decoder, boolean doPostProcess, int width, int height, Rect cropRect, boolean mutable, int allocator, boolean unpremulRequired, boolean conserveMemory, boolean decodeAsAlphaMask, long desiredColorSpace, boolean extended) throws IOException- Throws:
IOException
-
nGetSampledSize
-
nGetPadding
-
nClose
public static void nClose(long nativePtr) -
nGetMimeType
-
nGetColorSpace
-