@Implements(value=android.graphics.Bitmap.class) public class ShadowBitmap extends Object
Bitmap.| Constructor and Description |
|---|
ShadowBitmap() |
| Modifier and Type | Method and Description |
|---|---|
void |
appendDescription(String s) |
boolean |
compress(android.graphics.Bitmap.CompressFormat format,
int quality,
OutputStream stream) |
android.graphics.Bitmap |
copy(android.graphics.Bitmap.Config config,
boolean isMutable) |
android.graphics.Bitmap |
createAshmemBitmap() |
static android.graphics.Bitmap |
createBitmap(android.graphics.Bitmap src) |
static android.graphics.Bitmap |
createBitmap(android.graphics.Bitmap src,
int x,
int y,
int width,
int height) |
static android.graphics.Bitmap |
createBitmap(android.graphics.Bitmap src,
int x,
int y,
int width,
int height,
android.graphics.Matrix matrix,
boolean filter) |
static android.graphics.Bitmap |
createBitmap(android.util.DisplayMetrics displayMetrics,
int width,
int height,
android.graphics.Bitmap.Config config) |
static android.graphics.Bitmap |
createBitmap(android.util.DisplayMetrics displayMetrics,
int width,
int height,
android.graphics.Bitmap.Config config,
boolean hasAlpha) |
static android.graphics.Bitmap |
createBitmap(int[] colors,
int width,
int height,
android.graphics.Bitmap.Config config) |
static android.graphics.Bitmap |
createBitmap(int width,
int height,
android.graphics.Bitmap.Config config) |
static android.graphics.Bitmap |
createScaledBitmap(android.graphics.Bitmap src,
int dstWidth,
int dstHeight,
boolean filter) |
void |
eraseColor(int c) |
int |
getByteCount() |
static int |
getBytesPerPixel(android.graphics.Bitmap.Config config) |
android.graphics.Bitmap.Config |
getConfig() |
android.graphics.Bitmap |
getCreatedFromBitmap()
Reference to original Bitmap from which this Bitmap was created.
|
byte[] |
getCreatedFromBytes()
Bytes from which this Bitmap was created.
|
int[] |
getCreatedFromColors()
Color array from which this Bitmap was created.
|
boolean |
getCreatedFromFilter()
true if this Bitmap was created with filtering. |
int |
getCreatedFromHeight()
Height from
getCreatedFromX() within getCreatedFromBitmap() of this Bitmap's
content, or -1. |
android.graphics.Matrix |
getCreatedFromMatrix()
Matrix from which this Bitmap's content was transformed, or
null. |
String |
getCreatedFromPath()
Path from which this Bitmap was created.
|
int |
getCreatedFromResId()
Resource ID from which this Bitmap was created.
|
InputStream |
getCreatedFromStream()
InputStream from which this Bitmap was created. |
int |
getCreatedFromWidth()
Width from
getCreatedFromX() within getCreatedFromBitmap() of this Bitmap's
content, or -1. |
int |
getCreatedFromX()
Horizontal offset within
getCreatedFromBitmap() of this Bitmap's content, or -1. |
int |
getCreatedFromY()
Vertical offset within
getCreatedFromBitmap() of this Bitmap's content, or -1. |
int |
getDensity() |
String |
getDescription() |
int |
getGenerationId() |
int |
getHeight() |
int |
getPixel(int x,
int y) |
void |
getPixels(int[] pixels,
int offset,
int stride,
int x,
int y,
int width,
int height)
Note that this method will return a RuntimeException unless:
-
pixels has the same length as the number of pixels of the bitmap. |
android.graphics.Bitmap |
getRealBitmap() |
int |
getRowBytes() |
int |
getWidth() |
boolean |
hasAlpha() |
boolean |
hasMipMap() |
boolean |
isMutable() |
boolean |
isRecycled() |
static android.graphics.Bitmap |
nativeCreateFromParcel(android.os.Parcel p) |
void |
recycle() |
void |
setConfig(android.graphics.Bitmap.Config config) |
void |
setCreatedFromResId(int resId,
org.robolectric.res.ResName resName) |
void |
setDensity(int density) |
void |
setDescription(String s) |
void |
setHasAlpha(boolean hasAlpha) |
void |
setHasMipMap(boolean hasMipMap) |
void |
setHeight(int height) |
void |
setMutable(boolean mutable) |
void |
setPixel(int x,
int y,
int color) |
void |
setPixels(int[] pixels,
int offset,
int stride,
int x,
int y,
int width,
int height) |
void |
setWidth(int width) |
String |
toString() |
static String |
visualize(android.graphics.Bitmap bitmap)
Returns a textual representation of the appearance of the object.
|
void |
writeToParcel(android.os.Parcel p,
int flags) |
public static String visualize(android.graphics.Bitmap bitmap)
bitmap - the bitmap to visualizepublic android.graphics.Bitmap getCreatedFromBitmap()
null if this Bitmap
was not copied from another instance.public int getCreatedFromResId()
0 if this Bitmap was not created
from a resource.public String getCreatedFromPath()
null if this Bitmap was not create from a
path.public InputStream getCreatedFromStream()
InputStream from which this Bitmap was created. null if this Bitmap was not
created from a stream.public byte[] getCreatedFromBytes()
null if this Bitmap was not created from
bytes.public int getCreatedFromX()
getCreatedFromBitmap() of this Bitmap's content, or -1.getCreatedFromBitmap().public int getCreatedFromY()
getCreatedFromBitmap() of this Bitmap's content, or -1.getCreatedFromBitmap() of this Bitmap's content, or -1.public int getCreatedFromWidth()
getCreatedFromX() within getCreatedFromBitmap() of this Bitmap's
content, or -1.getCreatedFromX() within getCreatedFromBitmap() of this Bitmap's
content, or -1.public int getCreatedFromHeight()
getCreatedFromX() within getCreatedFromBitmap() of this Bitmap's
content, or -1.getCreatedFromX() within getCreatedFromBitmap() of this Bitmap's
content, or -1.public int[] getCreatedFromColors()
null if this Bitmap was not created
from a color array.public android.graphics.Matrix getCreatedFromMatrix()
null.null.public boolean getCreatedFromFilter()
true if this Bitmap was created with filtering.true if this Bitmap was created with filtering.@Implementation
public boolean compress(android.graphics.Bitmap.CompressFormat format,
int quality,
OutputStream stream)
@Implementation
public static android.graphics.Bitmap createBitmap(int width,
int height,
android.graphics.Bitmap.Config config)
@Implementation
public static android.graphics.Bitmap createBitmap(android.util.DisplayMetrics displayMetrics,
int width,
int height,
android.graphics.Bitmap.Config config,
boolean hasAlpha)
@Implementation
public static android.graphics.Bitmap createBitmap(android.util.DisplayMetrics displayMetrics,
int width,
int height,
android.graphics.Bitmap.Config config)
@Implementation public static android.graphics.Bitmap createBitmap(android.graphics.Bitmap src)
@Implementation
public static android.graphics.Bitmap createScaledBitmap(android.graphics.Bitmap src,
int dstWidth,
int dstHeight,
boolean filter)
@Implementation
public static android.graphics.Bitmap createBitmap(android.graphics.Bitmap src,
int x,
int y,
int width,
int height)
@Implementation
public void setPixels(int[] pixels,
int offset,
int stride,
int x,
int y,
int width,
int height)
@Implementation
public static android.graphics.Bitmap createBitmap(android.graphics.Bitmap src,
int x,
int y,
int width,
int height,
android.graphics.Matrix matrix,
boolean filter)
@Implementation
public static android.graphics.Bitmap createBitmap(int[] colors,
int width,
int height,
android.graphics.Bitmap.Config config)
@Implementation
public int getPixel(int x,
int y)
@Implementation
public void setPixel(int x,
int y,
int color)
@Implementation
public void getPixels(int[] pixels,
int offset,
int stride,
int x,
int y,
int width,
int height)
pixels has the same length as the number of pixels of the bitmap.
- x = 0
- y = 0
- width and height height match the current bitmap's dimensions.@Implementation public int getRowBytes()
@Implementation public int getByteCount()
@Implementation public void recycle()
@Implementation public final boolean isRecycled()
@Implementation
public android.graphics.Bitmap copy(android.graphics.Bitmap.Config config,
boolean isMutable)
@Implementation public final android.graphics.Bitmap.Config getConfig()
@Implementation public void setConfig(android.graphics.Bitmap.Config config)
@Implementation public final boolean isMutable()
public void setMutable(boolean mutable)
public void appendDescription(String s)
public void setDescription(String s)
public String getDescription()
@Implementation public final boolean hasAlpha()
@Implementation public void setHasAlpha(boolean hasAlpha)
@Implementation public final boolean hasMipMap()
@Implementation public final void setHasMipMap(boolean hasMipMap)
@Implementation public void setWidth(int width)
@Implementation public int getWidth()
@Implementation public void setHeight(int height)
@Implementation public int getHeight()
@Implementation public void setDensity(int density)
@Implementation public int getDensity()
@Implementation public int getGenerationId()
@Implementation public android.graphics.Bitmap createAshmemBitmap()
@Implementation public void eraseColor(int c)
@Implementation
public void writeToParcel(android.os.Parcel p,
int flags)
@Implementation public static android.graphics.Bitmap nativeCreateFromParcel(android.os.Parcel p)
public android.graphics.Bitmap getRealBitmap()
public static int getBytesPerPixel(android.graphics.Bitmap.Config config)
public void setCreatedFromResId(int resId,
org.robolectric.res.ResName resName)
Copyright © 2016. All rights reserved.