Package org.robolectric.shadows
Class ShadowBitmap
- java.lang.Object
-
- org.robolectric.shadows.ShadowBitmap
-
- Direct Known Subclasses:
ShadowLegacyBitmap,ShadowNativeBitmap
@Implements(value=android.graphics.Bitmap.class, shadowPicker=Picker.class) public abstract class ShadowBitmap extends Object
Base class forBitmapshadows.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classShadowBitmap.PickerShadow picker forBitmap.
-
Constructor Summary
Constructors Constructor Description ShadowBitmap()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidappendDescription(String s)abstract BitmapgetCreatedFromBitmap()Reference to original Bitmap from which this Bitmap was created.abstract byte[]getCreatedFromBytes()Bytes from which this Bitmap was created.abstract int[]getCreatedFromColors()Color array from which this Bitmap was created.abstract booleangetCreatedFromFilter()trueif this Bitmap was created with filtering.abstract intgetCreatedFromHeight()Height fromgetCreatedFromX()withingetCreatedFromBitmap()of this Bitmap's content, or -1.abstract MatrixgetCreatedFromMatrix()Matrix from which this Bitmap's content was transformed, ornull.abstract StringgetCreatedFromPath()Path from which this Bitmap was created.abstract intgetCreatedFromResId()Resource ID from which this Bitmap was created.abstract InputStreamgetCreatedFromStream()InputStreamfrom which this Bitmap was created.abstract intgetCreatedFromWidth()Width fromgetCreatedFromX()withingetCreatedFromBitmap()of this Bitmap's content, or -1.abstract intgetCreatedFromX()Horizontal offset withingetCreatedFromBitmap()of this Bitmap's content, or -1.abstract intgetCreatedFromY()Vertical offset withingetCreatedFromBitmap()of this Bitmap's content, or -1.abstract StringgetDescription()abstract voidsetDescription(String s)abstract voidsetMutable(boolean mutable)static Stringvisualize(Bitmap bitmap)Returns a textual representation of the appearance of the object.
-
-
-
Method Detail
-
visualize
public static String visualize(Bitmap bitmap)
Returns a textual representation of the appearance of the object.- Parameters:
bitmap- the bitmap to visualize- Returns:
- Textual representation of the appearance of the object.
-
getCreatedFromBitmap
public abstract Bitmap getCreatedFromBitmap()
Reference to original Bitmap from which this Bitmap was created.nullif this Bitmap was not copied from another instance.- Returns:
- Original Bitmap from which this Bitmap was created.
-
getCreatedFromResId
public abstract int getCreatedFromResId()
Resource ID from which this Bitmap was created.0if this Bitmap was not created from a resource.- Returns:
- Resource ID from which this Bitmap was created.
-
getCreatedFromPath
public abstract String getCreatedFromPath()
Path from which this Bitmap was created.nullif this Bitmap was not create from a path.- Returns:
- Path from which this Bitmap was created.
-
getCreatedFromStream
public abstract InputStream getCreatedFromStream()
InputStreamfrom which this Bitmap was created.nullif this Bitmap was not created from a stream.- Returns:
- InputStream from which this Bitmap was created.
-
getCreatedFromBytes
public abstract byte[] getCreatedFromBytes()
Bytes from which this Bitmap was created.nullif this Bitmap was not created from bytes.- Returns:
- Bytes from which this Bitmap was created.
-
getCreatedFromX
public abstract int getCreatedFromX()
Horizontal offset withingetCreatedFromBitmap()of this Bitmap's content, or -1.- Returns:
- Horizontal offset within
getCreatedFromBitmap().
-
getCreatedFromY
public abstract int getCreatedFromY()
Vertical offset withingetCreatedFromBitmap()of this Bitmap's content, or -1.- Returns:
- Vertical offset within
getCreatedFromBitmap()of this Bitmap's content, or -1.
-
getCreatedFromWidth
public abstract int getCreatedFromWidth()
Width fromgetCreatedFromX()withingetCreatedFromBitmap()of this Bitmap's content, or -1.- Returns:
- Width from
getCreatedFromX()withingetCreatedFromBitmap()of this Bitmap's content, or -1.
-
getCreatedFromHeight
public abstract int getCreatedFromHeight()
Height fromgetCreatedFromX()withingetCreatedFromBitmap()of this Bitmap's content, or -1.- Returns:
- Height from
getCreatedFromX()withingetCreatedFromBitmap()of this Bitmap's content, or -1.
-
getCreatedFromColors
public abstract int[] getCreatedFromColors()
Color array from which this Bitmap was created.nullif this Bitmap was not created from a color array.- Returns:
- Color array from which this Bitmap was created.
-
getCreatedFromMatrix
public abstract Matrix getCreatedFromMatrix()
Matrix from which this Bitmap's content was transformed, ornull.- Returns:
- Matrix from which this Bitmap's content was transformed, or
null.
-
getCreatedFromFilter
public abstract boolean getCreatedFromFilter()
trueif this Bitmap was created with filtering.- Returns:
trueif this Bitmap was created with filtering.
-
setMutable
public abstract void setMutable(boolean mutable)
-
appendDescription
public abstract void appendDescription(String s)
-
getDescription
public abstract String getDescription()
-
setDescription
public abstract void setDescription(String s)
-
-