Package org.robolectric.nativeruntime
Class BitmapNatives
java.lang.Object
org.robolectric.nativeruntime.BitmapNatives
Native methods for Bitmap 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/Bitmap.java
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
nativeCompress
(long nativeBitmap, int format, int quality, OutputStream stream, byte[] tempStorage) static ColorSpace
nativeComputeColorSpace
(long nativePtr) static int
nativeConfig
(long nativeBitmap) static Bitmap
nativeCopy
(long nativeSrcBitmap, int nativeConfig, boolean isMutable) static Bitmap
nativeCopyAshmem
(long nativeSrcBitmap) static Bitmap
nativeCopyAshmemConfig
(long nativeSrcBitmap, int nativeConfig) static void
nativeCopyPixelsFromBuffer
(long nativeBitmap, Buffer src) static void
nativeCopyPixelsToBuffer
(long nativeBitmap, Buffer dst) static Bitmap
nativeCopyPreserveInternalConfig
(long nativeBitmap) static Bitmap
nativeCreate
(int[] colors, int offset, int stride, int width, int height, int nativeConfig, boolean mutable, long nativeColorSpace) static Bitmap
static void
nativeErase
(long nativeBitmap, int color) static void
nativeErase
(long nativeBitmap, long colorSpacePtr, long color) static Bitmap
nativeExtractAlpha
(long nativeBitmap, long nativePaint, int[] offsetXY) static int
nativeGenerationId
(long nativeBitmap) static int
nativeGetAllocationByteCount
(long nativeBitmap) static long
nativeGetColor
(long nativeBitmap, int x, int y) static HardwareBuffer
nativeGetHardwareBuffer
(long nativeBitmap) static long
static int
nativeGetPixel
(long nativeBitmap, int x, int y) static void
nativeGetPixels
(long nativeBitmap, int[] pixels, int offset, int stride, int x, int y, int width, int height) static boolean
nativeHasAlpha
(long nativeBitmap) static boolean
nativeHasMipMap
(long nativeBitmap) static boolean
nativeIsBackedByAshmem
(long nativePtr) static boolean
nativeIsImmutable
(long nativePtr) static boolean
nativeIsPremultiplied
(long nativeBitmap) static boolean
nativeIsSRGB
(long nativePtr) static boolean
nativeIsSRGBLinear
(long nativePtr) static void
nativePrepareToDraw
(long nativeBitmap) static void
nativeReconfigure
(long nativeBitmap, int width, int height, int config, boolean isPremultiplied) static void
nativeRecycle
(long nativeBitmap) static int
nativeRowBytes
(long nativeBitmap) static boolean
nativeSameAs
(long nativeBitmap0, long nativeBitmap1) static void
nativeSetColorSpace
(long nativePtr, long nativeColorSpace) static void
nativeSetHasAlpha
(long nativeBitmap, boolean hasAlpha, boolean requestPremul) static void
nativeSetHasMipMap
(long nativeBitmap, boolean hasMipMap) static void
nativeSetImmutable
(long nativePtr) static void
nativeSetPixel
(long nativeBitmap, int x, int y, int color) static void
nativeSetPixels
(long nativeBitmap, int[] colors, int offset, int stride, int x, int y, int width, int height) static void
nativeSetPremultiplied
(long nativeBitmap, boolean isPremul) static Bitmap
nativeWrapHardwareBufferBitmap
(HardwareBuffer buffer, long nativeColorSpace) static boolean
nativeWriteToParcel
(long nativeBitmap, int density, Parcel p)
-
Method Details
-
nativeCreate
public static Bitmap nativeCreate(int[] colors, int offset, int stride, int width, int height, int nativeConfig, boolean mutable, long nativeColorSpace) -
nativeCopy
-
nativeCopyAshmem
-
nativeCopyAshmemConfig
-
nativeGetNativeFinalizer
public static long nativeGetNativeFinalizer() -
nativeRecycle
public static void nativeRecycle(long nativeBitmap) -
nativeReconfigure
public static void nativeReconfigure(long nativeBitmap, int width, int height, int config, boolean isPremultiplied) -
nativeCompress
public static boolean nativeCompress(long nativeBitmap, int format, int quality, OutputStream stream, byte[] tempStorage) -
nativeErase
public static void nativeErase(long nativeBitmap, int color) -
nativeErase
public static void nativeErase(long nativeBitmap, long colorSpacePtr, long color) -
nativeRowBytes
public static int nativeRowBytes(long nativeBitmap) -
nativeConfig
public static int nativeConfig(long nativeBitmap) -
nativeGetPixel
public static int nativeGetPixel(long nativeBitmap, int x, int y) -
nativeGetColor
public static long nativeGetColor(long nativeBitmap, int x, int y) -
nativeGetPixels
public static void nativeGetPixels(long nativeBitmap, int[] pixels, int offset, int stride, int x, int y, int width, int height) -
nativeSetPixel
public static void nativeSetPixel(long nativeBitmap, int x, int y, int color) -
nativeSetPixels
public static void nativeSetPixels(long nativeBitmap, int[] colors, int offset, int stride, int x, int y, int width, int height) -
nativeCopyPixelsToBuffer
-
nativeCopyPixelsFromBuffer
-
nativeGenerationId
public static int nativeGenerationId(long nativeBitmap) -
nativeCreateFromParcel
-
nativeWriteToParcel
-
nativeExtractAlpha
-
nativeHasAlpha
public static boolean nativeHasAlpha(long nativeBitmap) -
nativeIsPremultiplied
public static boolean nativeIsPremultiplied(long nativeBitmap) -
nativeSetPremultiplied
public static void nativeSetPremultiplied(long nativeBitmap, boolean isPremul) -
nativeSetHasAlpha
public static void nativeSetHasAlpha(long nativeBitmap, boolean hasAlpha, boolean requestPremul) -
nativeHasMipMap
public static boolean nativeHasMipMap(long nativeBitmap) -
nativeSetHasMipMap
public static void nativeSetHasMipMap(long nativeBitmap, boolean hasMipMap) -
nativeSameAs
public static boolean nativeSameAs(long nativeBitmap0, long nativeBitmap1) -
nativePrepareToDraw
public static void nativePrepareToDraw(long nativeBitmap) -
nativeGetAllocationByteCount
public static int nativeGetAllocationByteCount(long nativeBitmap) -
nativeCopyPreserveInternalConfig
-
nativeWrapHardwareBufferBitmap
-
nativeGetHardwareBuffer
-
nativeComputeColorSpace
-
nativeSetColorSpace
public static void nativeSetColorSpace(long nativePtr, long nativeColorSpace) -
nativeIsSRGB
public static boolean nativeIsSRGB(long nativePtr) -
nativeIsSRGBLinear
public static boolean nativeIsSRGBLinear(long nativePtr) -
nativeSetImmutable
public static void nativeSetImmutable(long nativePtr) -
nativeIsImmutable
public static boolean nativeIsImmutable(long nativePtr) -
nativeIsBackedByAshmem
public static boolean nativeIsBackedByAshmem(long nativePtr)
-