-
- All Implemented Interfaces:
-
com.facebook.imagepipeline.decoder.ImageDecoder
public class DefaultImageDecoder implements ImageDecoderDecodes 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 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.
-
-
Constructor Summary
Constructors Constructor Description DefaultImageDecoder(ImageDecoder animatedGifDecoder, ImageDecoder animatedWebPDecoder, PlatformDecoder platformDecoder)DefaultImageDecoder(ImageDecoder animatedGifDecoder, ImageDecoder animatedWebPDecoder, PlatformDecoder platformDecoder, Map<ImageFormat, ImageDecoder> customDecoders)DefaultImageDecoder(ImageDecoder animatedGifDecoder, ImageDecoder animatedWebPDecoder, PlatformDecoder platformDecoder, Map<ImageFormat, ImageDecoder> customDecoders, Supplier<Boolean> enableEncodedImageColorSpaceUsage)
-
Method Summary
Modifier and Type Method Description CloseableImagedecode(EncodedImage encodedImage, int length, QualityInfo qualityInfo, ImageDecodeOptions options)Decodes image. CloseableImagedecodeGif(EncodedImage encodedImage, int length, QualityInfo qualityInfo, ImageDecodeOptions options)Decodes gif into CloseableImage. CloseableStaticBitmapdecodeStaticImage(EncodedImage encodedImage, ImageDecodeOptions options)CloseableStaticBitmapdecodeJpeg(EncodedImage encodedImage, int length, QualityInfo qualityInfo, ImageDecodeOptions options, @Nullable() ColorSpace colorSpace)Decodes a partial jpeg. CloseableImagedecodeAnimatedWebp(EncodedImage encodedImage, int length, QualityInfo qualityInfo, ImageDecodeOptions options)Decode a webp animated image into a CloseableImage. -
-
Constructor Detail
-
DefaultImageDecoder
DefaultImageDecoder(ImageDecoder animatedGifDecoder, ImageDecoder animatedWebPDecoder, PlatformDecoder platformDecoder)
-
DefaultImageDecoder
DefaultImageDecoder(ImageDecoder animatedGifDecoder, ImageDecoder animatedWebPDecoder, PlatformDecoder platformDecoder, Map<ImageFormat, ImageDecoder> customDecoders)
-
DefaultImageDecoder
DefaultImageDecoder(ImageDecoder animatedGifDecoder, ImageDecoder animatedWebPDecoder, PlatformDecoder platformDecoder, Map<ImageFormat, ImageDecoder> customDecoders, Supplier<Boolean> enableEncodedImageColorSpaceUsage)
-
-
Method Detail
-
decode
@Nullable() 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 imagedata should be cut for decoding.qualityInfo- quality information for the imageoptions- options that can change decode behavior
-
decodeGif
@Nullable() CloseableImage decodeGif(EncodedImage encodedImage, int length, QualityInfo qualityInfo, ImageDecodeOptions options)
Decodes gif into CloseableImage.
- Parameters:
encodedImage- input image (encoded bytes plus meta data)
-
decodeStaticImage
CloseableStaticBitmap decodeStaticImage(EncodedImage encodedImage, ImageDecodeOptions options)
- Parameters:
encodedImage- input image (encoded bytes plus meta data)
-
decodeJpeg
CloseableStaticBitmap decodeJpeg(EncodedImage encodedImage, int length, QualityInfo qualityInfo, ImageDecodeOptions options, @Nullable() ColorSpace colorSpace)
Decodes a partial jpeg.
- Parameters:
encodedImage- input image (encoded bytes plus meta data)length- amount of currently available data in bytesqualityInfo- quality info for the image
-
decodeAnimatedWebp
@Nullable() 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)
-
-
-
-