Package org.robolectric.shadows
Class ShadowNativeBitmap
java.lang.Object
org.robolectric.shadows.ShadowBitmap
org.robolectric.shadows.ShadowNativeBitmap
@Implements(value=android.graphics.Bitmap.class,
looseSignatures=true,
minSdk=26,
isInAndroidSdk=false)
public class ShadowNativeBitmap
extends ShadowBitmap
Shadow for
Bitmap that is backed by native code-
Nested Class Summary
Nested classes/interfaces inherited from class org.robolectric.shadows.ShadowBitmap
ShadowBitmap.BitmapReflector, ShadowBitmap.Picker -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidReference to original Bitmap from which this Bitmap was created.byte[]Bytes from which this Bitmap was created.int[]Color array from which this Bitmap was created.booleantrueif this Bitmap was created with filtering.intHeight fromShadowBitmap.getCreatedFromX()withinShadowBitmap.getCreatedFromBitmap()of this Bitmap's content, or -1.Matrix from which this Bitmap's content was transformed, ornull.Path from which this Bitmap was created.intResource ID from which this Bitmap was created.InputStreamfrom which this Bitmap was created.intWidth fromShadowBitmap.getCreatedFromX()withinShadowBitmap.getCreatedFromBitmap()of this Bitmap's content, or -1.intHorizontal offset withinShadowBitmap.getCreatedFromBitmap()of this Bitmap's content, or -1.intVertical offset withinShadowBitmap.getCreatedFromBitmap()of this Bitmap's content, or -1.protected static booleannativeCompress(long nativeBitmap, int format, int quality, OutputStream stream, byte[] tempStorage) protected static ColorSpacenativeComputeColorSpace(long nativePtr) protected static intnativeConfig(long nativeBitmap) protected static BitmapnativeCopy(long nativeSrcBitmap, int nativeConfig, boolean isMutable) protected static BitmapnativeCopyAshmem(long nativeSrcBitmap) protected static BitmapnativeCopyAshmemConfig(long nativeSrcBitmap, int nativeConfig) protected static voidnativeCopyPixelsFromBuffer(long nativeBitmap, Buffer src) protected static voidnativeCopyPixelsToBuffer(long nativeBitmap, Buffer dst) protected static BitmapnativeCopyPreserveInternalConfig(long nativeBitmap) protected static BitmapnativeCreate(int[] colors, int offset, int stride, int width, int height, int nativeConfig, boolean mutable, float[] xyzD50, ColorSpace.Rgb.TransferParameters p) protected static BitmapnativeCreate(int[] colors, int offset, int stride, int width, int height, int nativeConfig, boolean mutable, long nativeColorSpace) protected static Bitmapprotected static voidnativeErase(long nativeBitmap, int color) protected static voidnativeErase(long nativeBitmap, long colorSpacePtr, long color) protected static BitmapnativeExtractAlpha(long nativeBitmap, long nativePaint, int[] offsetXY) protected static intnativeGenerationId(long nativeBitmap) protected static intnativeGetAllocationByteCount(long nativeBitmap) protected static longnativeGetColor(long nativeBitmap, int x, int y) protected static booleannativeGetColorSpace(long nativePtr, float[] xyz, float[] params) protected static HardwareBuffernativeGetHardwareBuffer(long nativeBitmap) protected static longprotected static intnativeGetPixel(long nativeBitmap, int x, int y) protected static voidnativeGetPixels(long nativeBitmap, int[] pixels, int offset, int stride, int x, int y, int width, int height) protected static booleannativeHasAlpha(long nativeBitmap) protected static booleannativeHasMipMap(long nativeBitmap) protected static booleannativeIsBackedByAshmem(long nativePtr) protected static booleannativeIsImmutable(long nativePtr) protected static booleannativeIsPremultiplied(long nativeBitmap) protected static booleannativeIsSRGB(long nativePtr) protected static booleannativeIsSRGBLinear(long nativePtr) protected static voidnativePrepareToDraw(long nativeBitmap) protected static voidnativeReconfigure(long nativeBitmap, int width, int height, int config, boolean isPremultiplied) protected static ObjectnativeRecycle(Object nativeBitmap) protected static intnativeRowBytes(long nativeBitmap) protected static booleannativeSameAs(long nativeBitmap0, long nativeBitmap1) protected static voidnativeSetColorSpace(long nativePtr, long nativeColorSpace) protected static voidnativeSetHasAlpha(long nativeBitmap, boolean hasAlpha, boolean requestPremul) protected static voidnativeSetHasMipMap(long nativeBitmap, boolean hasMipMap) protected static voidnativeSetImmutable(long nativePtr) protected static voidnativeSetPixel(long nativeBitmap, int x, int y, int color) protected static voidnativeSetPixels(long nativeBitmap, int[] colors, int offset, int stride, int x, int y, int width, int height) protected static voidnativeSetPremultiplied(long nativeBitmap, boolean isPremul) protected static BitmapnativeWrapHardwareBufferBitmap(HardwareBuffer buffer, long nativeColorSpace) static voidreset()voidvoidsetMutable(boolean mutable) protected voidwriteToParcel(Parcel p, int flags) Methods inherited from class org.robolectric.shadows.ShadowBitmap
hasGainmap, setGainmap, visualize
-
Constructor Details
-
ShadowNativeBitmap
public ShadowNativeBitmap()
-
-
Method Details
-
nativeCreate
@Implementation(minSdk=29) protected static Bitmap nativeCreate(int[] colors, int offset, int stride, int width, int height, int nativeConfig, boolean mutable, long nativeColorSpace) -
nativeCreate
@Implementation(minSdk=26, maxSdk=28) protected static Bitmap nativeCreate(int[] colors, int offset, int stride, int width, int height, int nativeConfig, boolean mutable, float[] xyzD50, ColorSpace.Rgb.TransferParameters p) -
nativeCopy
@Implementation(minSdk=21) protected static Bitmap nativeCopy(long nativeSrcBitmap, int nativeConfig, boolean isMutable) -
nativeCopyAshmem
-
nativeCopyAshmemConfig
@Implementation(minSdk=24) protected static Bitmap nativeCopyAshmemConfig(long nativeSrcBitmap, int nativeConfig) -
nativeGetNativeFinalizer
-
nativeRecycle
-
nativeReconfigure
@Implementation(minSdk=26) protected static void nativeReconfigure(long nativeBitmap, int width, int height, int config, boolean isPremultiplied) -
nativeCompress
@Implementation(minSdk=21) protected static boolean nativeCompress(long nativeBitmap, int format, int quality, OutputStream stream, byte[] tempStorage) -
nativeErase
-
nativeErase
@Implementation(minSdk=29) protected static void nativeErase(long nativeBitmap, long colorSpacePtr, long color) -
nativeRowBytes
-
nativeConfig
-
nativeGetPixel
-
nativeGetColor
-
nativeGetPixels
@Implementation(minSdk=21) protected static void nativeGetPixels(long nativeBitmap, int[] pixels, int offset, int stride, int x, int y, int width, int height) -
nativeSetPixel
@Implementation(minSdk=21) protected static void nativeSetPixel(long nativeBitmap, int x, int y, int color) -
nativeSetPixels
@Implementation(minSdk=21) protected static void nativeSetPixels(long nativeBitmap, int[] colors, int offset, int stride, int x, int y, int width, int height) -
nativeCopyPixelsToBuffer
-
nativeCopyPixelsFromBuffer
-
nativeGenerationId
-
nativeExtractAlpha
@Implementation protected static Bitmap nativeExtractAlpha(long nativeBitmap, long nativePaint, int[] offsetXY) -
nativeHasAlpha
-
nativeIsPremultiplied
-
nativeSetPremultiplied
@Implementation(minSdk=21) protected static void nativeSetPremultiplied(long nativeBitmap, boolean isPremul) -
nativeSetHasAlpha
@Implementation(minSdk=21) protected static void nativeSetHasAlpha(long nativeBitmap, boolean hasAlpha, boolean requestPremul) -
nativeHasMipMap
-
nativeSetHasMipMap
@Implementation(minSdk=17) protected static void nativeSetHasMipMap(long nativeBitmap, boolean hasMipMap) -
nativeSameAs
-
nativePrepareToDraw
-
nativeGetAllocationByteCount
-
nativeCopyPreserveInternalConfig
@Implementation(minSdk=26) protected static Bitmap nativeCopyPreserveInternalConfig(long nativeBitmap) -
nativeWrapHardwareBufferBitmap
@Implementation(minSdk=29) protected static Bitmap nativeWrapHardwareBufferBitmap(HardwareBuffer buffer, long nativeColorSpace) -
nativeGetHardwareBuffer
@Implementation(minSdk=30) protected static HardwareBuffer nativeGetHardwareBuffer(long nativeBitmap) -
nativeGetColorSpace
@Implementation(minSdk=26, maxSdk=28) protected static boolean nativeGetColorSpace(long nativePtr, float[] xyz, float[] params) -
nativeComputeColorSpace
-
nativeSetColorSpace
@Implementation(minSdk=29) protected static void nativeSetColorSpace(long nativePtr, long nativeColorSpace) -
nativeIsSRGB
-
nativeIsSRGBLinear
-
nativeSetImmutable
-
nativeIsImmutable
-
nativeIsBackedByAshmem
-
writeToParcel
-
nativeCreateFromParcel
-
getCreatedFromBitmap
Description copied from class:ShadowBitmapReference to original Bitmap from which this Bitmap was created.nullif this Bitmap was not copied from another instance.- Specified by:
getCreatedFromBitmapin classShadowBitmap- Returns:
- Original Bitmap from which this Bitmap was created.
-
getCreatedFromResId
public int getCreatedFromResId()Resource ID from which this Bitmap was created.- Specified by:
getCreatedFromResIdin classShadowBitmap- Returns:
- Resource ID from which this Bitmap was created, or
0if this Bitmap was not created from a resource.
-
getCreatedFromPath
Description copied from class:ShadowBitmapPath from which this Bitmap was created.nullif this Bitmap was not create from a path.- Specified by:
getCreatedFromPathin classShadowBitmap- Returns:
- Path from which this Bitmap was created.
-
getCreatedFromStream
Description copied from class:ShadowBitmapInputStreamfrom which this Bitmap was created.nullif this Bitmap was not created from a stream.- Specified by:
getCreatedFromStreamin classShadowBitmap- Returns:
- InputStream from which this Bitmap was created.
-
getCreatedFromBytes
public byte[] getCreatedFromBytes()Description copied from class:ShadowBitmapBytes from which this Bitmap was created.nullif this Bitmap was not created from bytes.- Specified by:
getCreatedFromBytesin classShadowBitmap- Returns:
- Bytes from which this Bitmap was created.
-
getCreatedFromX
public int getCreatedFromX()Description copied from class:ShadowBitmapHorizontal offset withinShadowBitmap.getCreatedFromBitmap()of this Bitmap's content, or -1.- Specified by:
getCreatedFromXin classShadowBitmap- Returns:
- Horizontal offset within
ShadowBitmap.getCreatedFromBitmap().
-
getCreatedFromY
public int getCreatedFromY()Description copied from class:ShadowBitmapVertical offset withinShadowBitmap.getCreatedFromBitmap()of this Bitmap's content, or -1.- Specified by:
getCreatedFromYin classShadowBitmap- Returns:
- Vertical offset within
ShadowBitmap.getCreatedFromBitmap()of this Bitmap's content, or -1.
-
getCreatedFromWidth
public int getCreatedFromWidth()Description copied from class:ShadowBitmapWidth fromShadowBitmap.getCreatedFromX()withinShadowBitmap.getCreatedFromBitmap()of this Bitmap's content, or -1.- Specified by:
getCreatedFromWidthin classShadowBitmap- Returns:
- Width from
ShadowBitmap.getCreatedFromX()withinShadowBitmap.getCreatedFromBitmap()of this Bitmap's content, or -1.
-
getCreatedFromHeight
public int getCreatedFromHeight()Description copied from class:ShadowBitmapHeight fromShadowBitmap.getCreatedFromX()withinShadowBitmap.getCreatedFromBitmap()of this Bitmap's content, or -1.- Specified by:
getCreatedFromHeightin classShadowBitmap- Returns:
- Height from
ShadowBitmap.getCreatedFromX()withinShadowBitmap.getCreatedFromBitmap()of this Bitmap's content, or -1.
-
getCreatedFromColors
public int[] getCreatedFromColors()Description copied from class:ShadowBitmapColor array from which this Bitmap was created.nullif this Bitmap was not created from a color array.- Specified by:
getCreatedFromColorsin classShadowBitmap- Returns:
- Color array from which this Bitmap was created.
-
getCreatedFromMatrix
Description copied from class:ShadowBitmapMatrix from which this Bitmap's content was transformed, ornull.- Specified by:
getCreatedFromMatrixin classShadowBitmap- Returns:
- Matrix from which this Bitmap's content was transformed, or
null.
-
getCreatedFromFilter
public boolean getCreatedFromFilter()Description copied from class:ShadowBitmaptrueif this Bitmap was created with filtering.- Specified by:
getCreatedFromFilterin classShadowBitmap- Returns:
trueif this Bitmap was created with filtering.
-
setMutable
public void setMutable(boolean mutable) - Specified by:
setMutablein classShadowBitmap
-
appendDescription
- Specified by:
appendDescriptionin classShadowBitmap
-
getDescription
- Specified by:
getDescriptionin classShadowBitmap
-
setDescription
- Specified by:
setDescriptionin classShadowBitmap
-
reset
-