@Implements(android.graphics.Bitmap.class) public class ShadowBitmap extends Object
Constructor | Description |
---|---|
ShadowBitmap() |
Modifier and Type | Method | Description |
---|---|---|
void |
appendDescription(String s) |
|
protected boolean |
compress(Bitmap.CompressFormat format,
int quality,
OutputStream stream) |
|
protected Bitmap |
copy(Bitmap.Config config,
boolean isMutable) |
|
protected void |
copyPixelsFromBuffer(Buffer dst) |
|
protected void |
copyPixelsToBuffer(Buffer dst) |
|
protected Bitmap |
createAshmemBitmap() |
|
protected static Bitmap |
createBitmap(int[] colors,
int width,
int height,
Bitmap.Config config) |
|
protected static Bitmap |
createBitmap(int width,
int height,
Bitmap.Config config) |
|
protected static Bitmap |
createBitmap(Bitmap src) |
|
protected static Bitmap |
createBitmap(Bitmap src,
int x,
int y,
int width,
int height) |
|
protected static Bitmap |
createBitmap(Bitmap src,
int x,
int y,
int width,
int height,
Matrix matrix,
boolean filter) |
|
protected static Bitmap |
createBitmap(DisplayMetrics displayMetrics,
int width,
int height,
Bitmap.Config config) |
|
protected static Bitmap |
createBitmap(DisplayMetrics displayMetrics,
int width,
int height,
Bitmap.Config config,
boolean hasAlpha) |
|
protected static Bitmap |
createScaledBitmap(Bitmap src,
int dstWidth,
int dstHeight,
boolean filter) |
|
protected void |
eraseColor(int color) |
|
protected Bitmap |
extractAlpha() |
|
protected Bitmap |
extractAlpha(Paint paint,
int[] offsetXY) |
This shadow implementation ignores the given paint and offsetXY and simply calls
extractAlpha() . |
protected int |
getAllocationByteCount() |
|
protected int |
getByteCount() |
|
static int |
getBytesPerPixel(Bitmap.Config config) |
|
protected Bitmap.Config |
getConfig() |
|
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. |
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. |
protected int |
getDensity() |
|
String |
getDescription() |
|
protected int |
getGenerationId() |
|
protected int |
getHeight() |
|
protected int |
getPixel(int x,
int y) |
|
protected 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. |
Bitmap |
getRealBitmap() |
|
protected int |
getRowBytes() |
|
protected int |
getWidth() |
|
protected boolean |
hasAlpha() |
|
protected boolean |
hasMipMap() |
|
protected boolean |
isMutable() |
|
protected boolean |
isPremultiplied() |
|
protected boolean |
isRecycled() |
|
protected static Bitmap |
nativeCreateFromParcel(Parcel p) |
|
protected void |
reconfigure(int width,
int height,
Bitmap.Config config) |
|
protected void |
recycle() |
|
protected boolean |
sameAs(Bitmap other) |
|
protected void |
setConfig(Bitmap.Config config) |
|
void |
setCreatedFromResId(int resId,
String description) |
|
protected void |
setDensity(int density) |
|
void |
setDescription(String s) |
|
protected void |
setHasAlpha(boolean hasAlpha) |
|
protected void |
setHasMipMap(boolean hasMipMap) |
|
protected void |
setHeight(int height) |
|
void |
setMutable(boolean mutable) |
|
protected void |
setPixel(int x,
int y,
int color) |
|
protected void |
setPixels(int[] pixels,
int offset,
int stride,
int x,
int y,
int width,
int height) |
|
protected void |
setPremultiplied(boolean isPremultiplied) |
|
protected void |
setWidth(int width) |
|
static String |
visualize(Bitmap bitmap) |
Returns a textual representation of the appearance of the object.
|
protected void |
writeToParcel(Parcel p,
int flags) |
public static String visualize(Bitmap bitmap)
bitmap
- the bitmap to visualizepublic 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 Matrix getCreatedFromMatrix()
null
.null
.public boolean getCreatedFromFilter()
true
if this Bitmap was created with filtering.true
if this Bitmap was created with filtering.@Implementation protected boolean compress(Bitmap.CompressFormat format, int quality, OutputStream stream)
@Implementation protected static Bitmap createBitmap(int width, int height, Bitmap.Config config)
@Implementation(minSdk=17) protected static Bitmap createBitmap(DisplayMetrics displayMetrics, int width, int height, Bitmap.Config config, boolean hasAlpha)
@Implementation(minSdk=17) protected static Bitmap createBitmap(DisplayMetrics displayMetrics, int width, int height, Bitmap.Config config)
@Implementation protected static Bitmap createBitmap(Bitmap src)
@Implementation protected static Bitmap createScaledBitmap(Bitmap src, int dstWidth, int dstHeight, boolean filter)
@Implementation protected static Bitmap createBitmap(Bitmap src, int x, int y, int width, int height)
@Implementation protected void setPixels(int[] pixels, int offset, int stride, int x, int y, int width, int height)
@Implementation protected static Bitmap createBitmap(Bitmap src, int x, int y, int width, int height, Matrix matrix, boolean filter)
@Implementation protected static Bitmap createBitmap(int[] colors, int width, int height, Bitmap.Config config)
@Implementation protected int getPixel(int x, int y)
@Implementation protected void setPixel(int x, int y, int color)
@Implementation protected 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 protected int getRowBytes()
@Implementation protected int getByteCount()
@Implementation protected void recycle()
@Implementation protected final boolean isRecycled()
@Implementation protected Bitmap copy(Bitmap.Config config, boolean isMutable)
@Implementation(minSdk=19) protected final int getAllocationByteCount()
@Implementation protected final Bitmap.Config getConfig()
@Implementation(minSdk=19) protected void setConfig(Bitmap.Config config)
@Implementation protected final boolean isMutable()
public void setMutable(boolean mutable)
public void appendDescription(String s)
public void setDescription(String s)
public String getDescription()
@Implementation protected final boolean hasAlpha()
@Implementation protected void setHasAlpha(boolean hasAlpha)
@Implementation protected Bitmap extractAlpha()
@Implementation protected Bitmap extractAlpha(Paint paint, int[] offsetXY)
extractAlpha()
.@Implementation(minSdk=17) protected final boolean hasMipMap()
@Implementation(minSdk=17) protected final void setHasMipMap(boolean hasMipMap)
@Implementation(minSdk=19) protected void setWidth(int width)
@Implementation protected int getWidth()
@Implementation(minSdk=19) protected void setHeight(int height)
@Implementation protected int getHeight()
@Implementation protected void setDensity(int density)
@Implementation protected int getDensity()
@Implementation protected int getGenerationId()
@Implementation(minSdk=23) protected Bitmap createAshmemBitmap()
@Implementation protected void eraseColor(int color)
@Implementation protected void writeToParcel(Parcel p, int flags)
@Implementation protected static Bitmap nativeCreateFromParcel(Parcel p)
@Implementation protected void copyPixelsFromBuffer(Buffer dst)
@Implementation protected void copyPixelsToBuffer(Buffer dst)
@Implementation(minSdk=19) protected void reconfigure(int width, int height, Bitmap.Config config)
@Implementation(minSdk=19) protected void setPremultiplied(boolean isPremultiplied)
@Implementation(minSdk=19) protected boolean isPremultiplied()
@Implementation protected boolean sameAs(Bitmap other)
public Bitmap getRealBitmap()
public static int getBytesPerPixel(Bitmap.Config config)
public void setCreatedFromResId(int resId, String description)