android-components / mozilla.components.browser.icons.decoder / IconDecoder

IconDecoder

interface IconDecoder (source)

An icon decoder that can decode a ByteArray into a Bitmap.

Depending on the image format the decoder may internally decode the ByteArray into multiple Bitmap. It is up to the decoder implementation to return the best Bitmap to use.

Types

Name Summary
ImageMagicNumbers enum class ImageMagicNumbers

Functions

Name Summary
decode abstract fun decode(data: ByteArray, desiredSize: DesiredSize): <ERROR CLASS>?
Decodes the given data into a a Bitmap or null.

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.

Inheritors

Name Summary
AndroidIconDecoder class AndroidIconDecoder : IconDecoder
IconDecoder that will use Android’s BitmapFactory in order to decode the byte data.
ICOIconDecoder class ICOIconDecoder : IconDecoder
IconDecoder implementation for decoding ICO files.