Methods Summary |
---|
private void | checkRecycled(java.lang.String errorMessage)Called by methods that want to throw an exception if the bitmap
has already been recycled.
if (mRecycled) {
throw new IllegalStateException(errorMessage);
}
|
public Bitmap | decodeRegion(Rect rect, BitmapFactory.Options options)Decodes a rectangle region in the image specified by rect.
checkRecycled("decodeRegion called on recycled large bitmap");
if (rect.left < 0 || rect.top < 0 || rect.right > getWidth() || rect.bottom > getHeight())
throw new IllegalArgumentException("rectangle is not inside the image");
return nativeDecodeRegion(mNativeLargeBitmap, rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top, options);
|
protected void | finalize()
recycle();
|
public int | getHeight()Returns the original image's height
checkRecycled("getHeight called on recycled large bitmap");
return nativeGetHeight(mNativeLargeBitmap);
|
public int | getWidth()Returns the original image's width
checkRecycled("getWidth called on recycled large bitmap");
return nativeGetWidth(mNativeLargeBitmap);
|
public final boolean | isRecycled()Returns true if this large bitmap has been recycled.
If so, then it is an error to try use its method.
return mRecycled;
|
private static native void | nativeClean(long nativeLbm)
|
private static native Bitmap | nativeDecodeRegion(long nativeLbm, int start_x, int start_y, int width, int height, BitmapFactory.Options options)
|
private static native int | nativeGetHeight(long nativeLbm)
|
private static native int | nativeGetWidth(long nativeLbm)
|
public void | recycle()Frees up the memory associated with this large bitmap, and mark the
large bitmap as "dead", meaning it will throw an exception if decodeRegion(),
getWidth() or getHeight() is called.
This operation cannot be reversed, so it should only be called if you are
sure there are no further uses for the large bitmap. This is an advanced call,
and normally need not be called, since the normal GC process will free up this
memory when there are no more references to this bitmap.
if (!mRecycled) {
nativeClean(mNativeLargeBitmap);
mRecycled = true;
}
|