Enum Class DecodeFormat
- All Implemented Interfaces:
Serializable,Comparable<DecodeFormat>,java.lang.constant.Constable
Bitmap.getConfig() for Bitmaps returned by ResourceDecoders.
Note - In some cases it may not be possible to obey the requested setting, not all Downsamplers support setting formats and certain images
may not be able to be loaded as certain configurations. Therefore this class represents a
preference rather than a requirement.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionBitmaps returned by theResourceDecoder.Bitmaps decoded from image formats that support and/or use alpha (some types of PNGs, GIFs etc) should returnBitmap.Config.ARGB_8888forBitmap.getConfig(). -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic DecodeFormatReturns the enum constant of this class with the specified name.static DecodeFormat[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
PREFER_ARGB_8888
Bitmaps returned by theResourceDecoder. should returnBitmap.Config.ARGB_8888forBitmap.getConfig()when possible.On Android O+, this format will use ARGB_8888 only when it's not possible to use
Bitmap.Config.HARDWARE. More information is available about hardware Bitmaps here: https://goo.gl/tn2A6k. If you need to disable hardware Bitmaps for a particular request, useBaseRequestOptions.disallowHardwareConfig().GIF images decoded by
BitmapFactorycurrently use an internal hidden format that is returned as null fromBitmap.getConfig(). Since we cannot forceBitmapFactoryto always return our desired config, this setting is a preference, not a promise. -
PREFER_RGB_565
Bitmaps decoded from image formats that support and/or use alpha (some types of PNGs, GIFs etc) should returnBitmap.Config.ARGB_8888forBitmap.getConfig(). Bitmaps decoded from formats that don't support or use alpha should returnBitmap.Config.RGB_565forBitmap.getConfig().On Android O+, this format will use RGB_565 only when it's not possible to use
Bitmap.Config.HARDWARE.
-
-
Field Details
-
DEFAULT
The default value for DecodeFormat.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-