public class

DefaultImageDecoder

extends Object
implements ImageDecoder
java.lang.Object
   ↳ com.facebook.imagepipeline.decoder.DefaultImageDecoder

Class Overview

Decodes images.

ImageDecoder implements image type recognition and passes decode requests to specialized methods implemented by subclasses. On dalvik, it produces 'pinned' purgeable bitmaps.

Pinned purgeables behave as specified in inPurgeable with one modification. The bitmap is 'pinned' so is never purged.

For API 21 and higher, this class produces standard Bitmaps, as purgeability is not supported on the most recent versions of Android.

Summary

Public Constructors
DefaultImageDecoder(ImageDecoder animatedGifDecoder, ImageDecoder animatedWebPDecoder, PlatformDecoder platformDecoder)
DefaultImageDecoder(ImageDecoder animatedGifDecoder, ImageDecoder animatedWebPDecoder, PlatformDecoder platformDecoder, Map<ImageFormatImageDecoder> customDecoders)
Public Methods
CloseableImage decode(EncodedImage encodedImage, int length, QualityInfo qualityInfo, ImageDecodeOptions options)
Decodes image.
CloseableImage decodeAnimatedWebp(EncodedImage encodedImage, int length, QualityInfo qualityInfo, ImageDecodeOptions options)
Decode a webp animated image into a CloseableImage.
CloseableImage decodeGif(EncodedImage encodedImage, int length, QualityInfo qualityInfo, ImageDecodeOptions options)
Decodes gif into CloseableImage.
CloseableStaticBitmap decodeJpeg(EncodedImage encodedImage, int length, QualityInfo qualityInfo, ImageDecodeOptions options)
Decodes a partial jpeg.
CloseableStaticBitmap decodeStaticImage(EncodedImage encodedImage, ImageDecodeOptions options)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.facebook.imagepipeline.decoder.ImageDecoder

Public Constructors

public DefaultImageDecoder (ImageDecoder animatedGifDecoder, ImageDecoder animatedWebPDecoder, PlatformDecoder platformDecoder)

public DefaultImageDecoder (ImageDecoder animatedGifDecoder, ImageDecoder animatedWebPDecoder, PlatformDecoder platformDecoder, Map<ImageFormatImageDecoder> customDecoders)

Public Methods

public CloseableImage decode (EncodedImage encodedImage, int length, QualityInfo qualityInfo, ImageDecodeOptions options)

Decodes image.

Parameters
encodedImage input image (encoded bytes plus meta data)
length if image type supports decoding incomplete image then determines where the image data should be cut for decoding.
qualityInfo quality information for the image
options options that cange decode behavior

public CloseableImage decodeAnimatedWebp (EncodedImage encodedImage, int length, QualityInfo qualityInfo, ImageDecodeOptions options)

Decode a webp animated image into a CloseableImage.

The image is decoded into a 'pinned' purgeable bitmap.

Parameters
encodedImage input image (encoded bytes plus meta data)
Returns

public CloseableImage decodeGif (EncodedImage encodedImage, int length, QualityInfo qualityInfo, ImageDecodeOptions options)

Decodes gif into CloseableImage.

Parameters
encodedImage input image (encoded bytes plus meta data)
Returns
  • a CloseableImage

public CloseableStaticBitmap decodeJpeg (EncodedImage encodedImage, int length, QualityInfo qualityInfo, ImageDecodeOptions options)

Decodes a partial jpeg.

Parameters
encodedImage input image (encoded bytes plus meta data)
length amount of currently available data in bytes
qualityInfo quality info for the image
Returns
  • a CloseableStaticBitmap

public CloseableStaticBitmap decodeStaticImage (EncodedImage encodedImage, ImageDecodeOptions options)

Parameters
encodedImage input image (encoded bytes plus meta data)
Returns
  • a CloseableStaticBitmap