com.davemorrissey.labs.subscaleview.decoder

## Class SkiaImageDecoder

- java.lang.Object
- - com.davemorrissey.labs.subscaleview.decoder.SkiaImageDecoder

All Implemented Interfaces:
  ImageDecoder

    public class SkiaImageDecoder
    extends Object
    implements ImageDecoder

Default implementation of `ImageDecoder` using Android's `BitmapFactory`, based on the Skia library. This works well in most circumstances and has reasonable performance, however it has some problems with grayscale, indexed and CMYK images.

### Constructor Summary

Constructors
Constructor and Description
`SkiaImageDecoder()`
`SkiaImageDecoder(Bitmap.Config bitmapConfig)`

### Method Summary

All Methods Instance Methods Concrete Methods
`Bitmap` `decode(Context context, Uri uri)` Decode an image.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### SkiaImageDecoder

    public SkiaImageDecoder()

#### SkiaImageDecoder

    public SkiaImageDecoder(@Nullable
                            Bitmap.Config bitmapConfig)

### Method Detail

#### decode

    @NonNull
    public Bitmap decode(Context context,
                                  @NonNull
                                  Uri uri)
                           throws Exception

Description copied from interface: `ImageDecoder`
Decode an image. The URI can be in one of the following formats:
File: `file:///scard/picture.jpg`
Asset: `file:///android_asset/picture.png`
Resource: `android.resource://com.example.app/drawable/picture`

Specified by:
  `decode` in interface `ImageDecoder`
Parameters:
  `context` - Application context
  `uri` - URI of the image
Returns:
  the decoded bitmap
Throws:
  `Exception` - if decoding fails.