Back to Fresco

DefaultDecoder

docs/javadoc/reference/com/facebook/imagepipeline/platform/DefaultDecoder.html

3.6.021.2 KB
Original Source

Fresco

|

|

Packages | Classes

Interfaces

Classes

Packages | Classes

Summary: Ctors | Methods | Protected Methods | Inherited Methods | [Expand All]

public abstract class

DefaultDecoder

extends Object
implements PlatformDecoder

| java.lang.Object | | ↳ | com.facebook.imagepipeline.platform.DefaultDecoder |

| Known Direct Subclasses

ArtDecoder, OreoDecoder

| ArtDecoder | Bitmap decoder for ART VM (Lollipop and up). | | OreoDecoder | Bitmap decoder for ART VM (Android O and up). |

|

Class Overview

Bitmap decoder for ART VM (Lollipop and up).

Summary

Public Constructors
Public Methods
CloseableReference<Bitmap>
Creates a bitmap from encoded bytes.
CloseableReference<Bitmap>
Creates a bitmap from encoded bytes.
CloseableReference<Bitmap>
Creates a bitmap from encoded JPEG bytes.
CloseableReference<Bitmap>
Creates a bitmap from encoded JPEG bytes.
abstract int
Protected Methods
CloseableReference<Bitmap>
This method is needed because of dependency issues.

| [Expand] Inherited Methods | | --- | | From class java.lang.Object

| Object | clone() | | boolean | equals(Object arg0) | | void | finalize() | | final Class<?> | getClass() | | int | hashCode() | | final void | notify() | | final void | notifyAll() | | String | toString() | | final void | wait(long arg0, int arg1) | | final void | wait(long arg0) | | final void | wait() |

| | From interface com.facebook.imagepipeline.platform.PlatformDecoder

| abstract CloseableReference<Bitmap> | decodeFromEncodedImage(EncodedImage encodedImage, Bitmap.Config bitmapConfig, Rect regionToDecode) Creates a bitmap from encoded bytes. | | abstract CloseableReference<Bitmap> | decodeFromEncodedImageWithColorSpace(EncodedImage encodedImage, Bitmap.Config bitmapConfig, Rect regionToDecode, ColorSpace colorSpace) Creates a bitmap from encoded bytes. | | abstract CloseableReference<Bitmap> | decodeJPEGFromEncodedImage(EncodedImage encodedImage, Bitmap.Config bitmapConfig, Rect regionToDecode, int length) Creates a bitmap from encoded JPEG bytes. | | abstract CloseableReference<Bitmap> | decodeJPEGFromEncodedImageWithColorSpace(EncodedImage encodedImage, Bitmap.Config bitmapConfig, Rect regionToDecode, int length, ColorSpace colorSpace) Creates a bitmap from encoded JPEG bytes. |

|

Public Constructors

public DefaultDecoder(BitmapPool bitmapPool, int maxNumThreads, SynchronizedPool decodeBuffers)

Public Methods

public CloseableReference<Bitmap> decodeFromEncodedImage(EncodedImage encodedImage, Bitmap.Config bitmapConfig, Rect regionToDecode)

Creates a bitmap from encoded bytes. Supports JPEG but callers should use decodeJPEGFromEncodedImage(EncodedImage, Bitmap.Config, Rect, int) for partial JPEGs. In addition, a region to decode can be supplied in order to minimize memory usage. NOTE: Not all platform decoders necessarily support supplying specific regions.

Note: This needs to be kept because of dependencies issues.

Parameters

| encodedImage | the reference to the encoded image with the reference to the encoded bytes | | bitmapConfig | the android.graphics.Bitmap.Config used to create the decoded Bitmap | | regionToDecode | optional image region to decode or null to decode the whole image |

Returns
  • the bitmap

public CloseableReference<Bitmap> decodeFromEncodedImageWithColorSpace(EncodedImage encodedImage, Bitmap.Config bitmapConfig, Rect regionToDecode, ColorSpace colorSpace)

Creates a bitmap from encoded bytes.

Parameters

| encodedImage | the encoded image with a reference to the encoded bytes | | bitmapConfig | the android.graphics.Bitmap.Config used to create the decoded Bitmap | | regionToDecode | optional image region to decode or null to decode the whole image | | colorSpace | the target color space of the decoded bitmap, must be one of the named color space in android.graphics.ColorSpace.Named. If null, then SRGB color space is assumed if the SDK version >= 26. |

Returns
  • the bitmap
Throws

| OutOfMemoryError | if the Bitmap cannot be allocated |

public CloseableReference<Bitmap> decodeJPEGFromEncodedImage(EncodedImage encodedImage, Bitmap.Config bitmapConfig, Rect regionToDecode, int length)

Creates a bitmap from encoded JPEG bytes. Supports a partial JPEG image. In addition, a region to decode can be supplied in order to minimize memory usage. NOTE: Not all platform decoders necessarily support supplying specific regions.

Note: This needs to be kept because of dependencies issues.

Parameters

| encodedImage | the reference to the encoded image with the reference to the encoded bytes | | bitmapConfig | the android.graphics.Bitmap.Config used to create the decoded Bitmap | | regionToDecode | optional image region to decode or null to decode the whole image. | | length | the number of encoded bytes in the buffer |

Returns
  • the bitmap

public CloseableReference<Bitmap> decodeJPEGFromEncodedImageWithColorSpace(EncodedImage encodedImage, Bitmap.Config bitmapConfig, Rect regionToDecode, int length, ColorSpace colorSpace)

Creates a bitmap from encoded JPEG bytes. Supports a partial JPEG image.

Parameters

| encodedImage | the encoded image with reference to the encoded bytes | | bitmapConfig | the android.graphics.Bitmap.Config used to create the decoded Bitmap | | regionToDecode | optional image region to decode or null to decode the whole image | | length | the number of encoded bytes in the buffer | | colorSpace | the target color space of the decoded bitmap, must be one of the named color space in android.graphics.ColorSpace.Named. If null, then SRGB color space is assumed if the SDK version >= 26. |

Returns
  • the bitmap
Throws

| OutOfMemoryError | if the Bitmap cannot be allocated |

public abstract int getBitmapSize(int width, int height, BitmapFactory.Options options)

Protected Methods

protected CloseableReference<Bitmap> decodeStaticImageFromStream(InputStream inputStream, BitmapFactory.Options options, Rect regionToDecode)

This method is needed because of dependency issues.

Parameters

| inputStream | the InputStream | | options | the android.graphics.BitmapFactory.Options used to decode the stream | | regionToDecode | optional image region to decode or null to decode the whole image |

Returns
  • the bitmap

+Generated by Doclava. +