public class SkiaImageRegionDecoder extends java.lang.Object implements ImageRegionDecoder
com.davemorrissey.labs.subscaleview.decoder.ImageRegionDecoder
using Android's BitmapRegionDecoder
, based on the Skia library. This
works well in most circumstances and has reasonable performance due to the cached decoder instance,
however it has some problems with grayscale, indexed and CMYK images.构造器和说明 |
---|
SkiaImageRegionDecoder() |
限定符和类型 | 方法和说明 |
---|---|
android.graphics.Bitmap |
decodeRegion(android.graphics.Rect sRect,
int sampleSize)
Decode a region of the image with the given sample size.
|
android.graphics.Point |
init(android.content.Context context,
android.net.Uri uri)
Initialise the decoder.
|
boolean |
isReady()
Status check.
|
void |
recycle()
This method will be called when the decoder is no longer required.
|
public android.graphics.Point init(android.content.Context context, android.net.Uri uri) throws java.lang.Exception
ImageRegionDecoder
init
在接口中 ImageRegionDecoder
context
- Application context. A reference may be held, but must be cleared on recycle.uri
- URI of the image.java.lang.Exception
- if initialisation fails.public android.graphics.Bitmap decodeRegion(android.graphics.Rect sRect, int sampleSize)
ImageRegionDecoder
AsyncTask
running in a single
threaded executor, and while a synchronization lock is held on this object, so will never be called concurrently
even if the decoder implementation supports it.decodeRegion
在接口中 ImageRegionDecoder
sRect
- Source image rectangle to decode.sampleSize
- Sample size.public boolean isReady()
ImageRegionDecoder
isReady
在接口中 ImageRegionDecoder
public void recycle()
ImageRegionDecoder
recycle
在接口中 ImageRegionDecoder