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 booleannativeCompress(long nativeBitmap, int format, int quality, OutputStream stream, byte[] tempStorage) static ColorSpacenativeComputeColorSpace(long nativePtr) static intnativeConfig(long nativeBitmap) static BitmapnativeCopy(long nativeSrcBitmap, int nativeConfig, boolean isMutable) static BitmapnativeCopyAshmem(long nativeSrcBitmap) static BitmapnativeCopyAshmemConfig(long nativeSrcBitmap, int nativeConfig) static voidnativeCopyColorSpaceP(long srcBitmap, long dstBitmap) static voidnativeCopyPixelsFromBuffer(long nativeBitmap, Buffer src) static voidnativeCopyPixelsToBuffer(long nativeBitmap, Buffer dst) static BitmapnativeCopyPreserveInternalConfig(long nativeBitmap) static BitmapnativeCreate(int[] colors, int offset, int stride, int width, int height, int nativeConfig, boolean mutable, long nativeColorSpace) static Bitmapstatic voidnativeErase(long nativeBitmap, int color) static voidnativeErase(long nativeBitmap, long colorSpacePtr, long color) static BitmapnativeExtractAlpha(long nativeBitmap, long nativePaint, int[] offsetXY) static intnativeGenerationId(long nativeBitmap) static intnativeGetAllocationByteCount(long nativeBitmap) static longnativeGetColor(long nativeBitmap, int x, int y) static HardwareBuffernativeGetHardwareBuffer(long nativeBitmap) static longstatic intnativeGetPixel(long nativeBitmap, int x, int y) static voidnativeGetPixels(long nativeBitmap, int[] pixels, int offset, int stride, int x, int y, int width, int height) static booleannativeHasAlpha(long nativeBitmap) static booleannativeHasMipMap(long nativeBitmap) static booleannativeIsBackedByAshmem(long nativePtr) static booleannativeIsImmutable(long nativePtr) static booleannativeIsPremultiplied(long nativeBitmap) static booleannativeIsSRGB(long nativePtr) static booleannativeIsSRGBLinear(long nativePtr) static voidnativePrepareToDraw(long nativeBitmap) static voidnativeReconfigure(long nativeBitmap, int width, int height, int config, boolean isPremultiplied) static voidnativeRecycle(long nativeBitmap) static intnativeRowBytes(long nativeBitmap) static booleannativeSameAs(long nativeBitmap0, long nativeBitmap1) static voidnativeSetColorSpace(long nativePtr, long nativeColorSpace) static voidnativeSetHasAlpha(long nativeBitmap, boolean hasAlpha, boolean requestPremul) static voidnativeSetHasMipMap(long nativeBitmap, boolean hasMipMap) static voidnativeSetImmutable(long nativePtr) static voidnativeSetPixel(long nativeBitmap, int x, int y, int color) static voidnativeSetPixels(long nativeBitmap, int[] colors, int offset, int stride, int x, int y, int width, int height) static voidnativeSetPremultiplied(long nativeBitmap, boolean isPremul) static BitmapnativeWrapHardwareBufferBitmap(HardwareBuffer buffer, long nativeColorSpace) static booleannativeWriteToParcel(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) -
nativeCopyColorSpaceP
public static void nativeCopyColorSpaceP(long srcBitmap, long dstBitmap)
-