added in API level 28


public static abstract class ImageDecoder.Source
extends Object


Source of encoded image data.

References the data that will be used to decode a Drawable or Bitmap in decodeDrawable or decodeBitmap. Constructing a Source (with one of the overloads of createSource) can be done on any thread because the construction simply captures values. The real work is done in decodeDrawable or decodeBitmap.

A Source object can be reused to create multiple versions of the same image. For example, to decode a full size image and its thumbnail, the same Source can be used once with no OnHeaderDecodedListener and once with an implementation of onHeaderDecoded that calls ImageDecoder.setTargetSize(int, int) with smaller dimensions. One Source even used simultaneously in multiple threads.


Inherited methods