Options

class Options(context: Context, config: Bitmap.Config, colorSpace: ColorSpace?, scale: Scale, allowInexactSize: Boolean, allowRgb565: Boolean, premultipliedAlpha: Boolean, headers: Headers, parameters: Parameters, memoryCachePolicy: CachePolicy, diskCachePolicy: CachePolicy, networkCachePolicy: CachePolicy)

A set of configuration options for fetching and decoding an image.

Fetchers and Decoders should respect these options as best as possible.

Parameters

context

The Context used to execute this request.

config

The requested config for any Bitmaps.

colorSpace

The preferred color space for any Bitmaps. If null, components should typically default to ColorSpace.Rgb.

scale

The scaling algorithm for how to fit the source image's dimensions into the target's dimensions.

allowInexactSize

True if the output image does not need to fit/fill the target's dimensions exactly. For instance, if true BitmapFactoryDecoder will not decode an image at a larger size than its source dimensions as an optimization.

allowRgb565

True if a component is allowed to use Bitmap.Config.RGB_565 as an optimization. As RGB_565 does not have an alpha channel, components should only use RGB_565 if the image is guaranteed to not use alpha.

premultipliedAlpha

True if the color (RGB) channels of the decoded image should be pre-multiplied by the alpha channel. The default behavior is to enable pre-multiplication but in some environments it can be necessary to disable this feature to leave the source pixels unmodified.

headers

The header fields to use for any network requests.

parameters

A map of custom parameters. These are used to pass custom data to a component.

memoryCachePolicy

Determines if this request is allowed to read/write from/to memory.

diskCachePolicy

Determines if this request is allowed to read/write from/to disk.

networkCachePolicy

Determines if this request is allowed to read from the network.

Constructors

Options
Link copied to clipboard
fun Options(context: Context, config: Bitmap.Config, colorSpace: ColorSpace?, scale: Scale, allowInexactSize: Boolean, allowRgb565: Boolean, headers: Headers, parameters: Parameters, memoryCachePolicy: CachePolicy, diskCachePolicy: CachePolicy, networkCachePolicy: CachePolicy)
Options
Link copied to clipboard
fun Options(context: Context, config: Bitmap.Config = Bitmap.Config.ARGB_8888, colorSpace: ColorSpace? = NULL_COLOR_SPACE, scale: Scale = Scale.FIT, allowInexactSize: Boolean = false, allowRgb565: Boolean = false, premultipliedAlpha: Boolean = true, headers: Headers = EMPTY_HEADERS, parameters: Parameters = Parameters.EMPTY, memoryCachePolicy: CachePolicy = CachePolicy.ENABLED, diskCachePolicy: CachePolicy = CachePolicy.ENABLED, networkCachePolicy: CachePolicy = CachePolicy.ENABLED)
The Context used to execute this request.

Functions

copy
Link copied to clipboard
fun copy(context: Context = this.context, config: Bitmap.Config = this.config, colorSpace: ColorSpace? = this.colorSpace, scale: Scale = this.scale, allowInexactSize: Boolean = this.allowInexactSize, allowRgb565: Boolean = this.allowRgb565, headers: Headers = this.headers, parameters: Parameters = this.parameters, memoryCachePolicy: CachePolicy = this.memoryCachePolicy, diskCachePolicy: CachePolicy = this.diskCachePolicy, networkCachePolicy: CachePolicy = this.networkCachePolicy): Options
fun copy(context: Context = this.context, config: Bitmap.Config = this.config, colorSpace: ColorSpace? = this.colorSpace, scale: Scale = this.scale, allowInexactSize: Boolean = this.allowInexactSize, allowRgb565: Boolean = this.allowRgb565, premultipliedAlpha: Boolean = this.premultipliedAlpha, headers: Headers = this.headers, parameters: Parameters = this.parameters, memoryCachePolicy: CachePolicy = this.memoryCachePolicy, diskCachePolicy: CachePolicy = this.diskCachePolicy, networkCachePolicy: CachePolicy = this.networkCachePolicy): Options
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
open override fun hashCode(): Int
toString
Link copied to clipboard
open override fun toString(): String

Properties

allowInexactSize
Link copied to clipboard
val allowInexactSize: Boolean = false
True if the output image does not need to fit/fill the target's dimensions exactly.
allowRgb565
Link copied to clipboard
val allowRgb565: Boolean = false
True if a component is allowed to use Bitmap.Config.RGB_565 as an optimization.
colorSpace
Link copied to clipboard
val colorSpace: ColorSpace?
The preferred color space for any Bitmaps.
config
Link copied to clipboard
val config: Bitmap.Config
The requested config for any Bitmaps.
context
Link copied to clipboard
val context: Context
The Context used to execute this request.
diskCachePolicy
Link copied to clipboard
val diskCachePolicy: CachePolicy
Determines if this request is allowed to read/write from/to disk.
headers
Link copied to clipboard
val headers: Headers
The header fields to use for any network requests.
memoryCachePolicy
Link copied to clipboard
val memoryCachePolicy: CachePolicy
Determines if this request is allowed to read/write from/to memory.
networkCachePolicy
Link copied to clipboard
val networkCachePolicy: CachePolicy
Determines if this request is allowed to read from the network.
parameters
Link copied to clipboard
val parameters: Parameters
A map of custom parameters.
premultipliedAlpha
Link copied to clipboard
val premultipliedAlpha: Boolean = true
True if the color (RGB) channels of the decoded image should be pre-multiplied by the alpha channel.
scale
Link copied to clipboard
val scale: Scale
The scaling algorithm for how to fit the source image's dimensions into the target's dimensions.