public enum DecodeFormat extends Enum<DecodeFormat>
Bitmap.getConfig()
for
Bitmap
s returned by ResourceDecoder
s.
Note - In some cases it may not be possible to obey the requested setting, not all
Downsampler
s 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.
Enum Constant and Description |
---|
PREFER_ARGB_8888
Bitmaps returned by the
ResourceDecoder . |
PREFER_ARGB_8888_DISALLOW_HARDWARE
Deprecated.
If you must disable hardware bitmaps, set
Downsampler.ALLOW_HARDWARE_CONFIG to false
instead. |
PREFER_RGB_565
Bitmaps decoded from image formats that support and/or use alpha (some types of PNGs, GIFs etc)
should return
Bitmap.Config.ARGB_8888 for
Bitmap.getConfig() . |
Modifier and Type | Field and Description |
---|---|
static DecodeFormat |
DEFAULT
The default value for DecodeFormat.
|
Modifier and Type | Method and Description |
---|---|
static DecodeFormat |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DecodeFormat[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final DecodeFormat PREFER_ARGB_8888
ResourceDecoder
.
should return Bitmap.Config.ARGB_8888
for
Bitmap.getConfig()
when possible.
On Android O+, this format will will use ARGB_8888 only when it's not possible to use
Bitmap.Config.HARDWARE
.
GIF images decoded by BitmapFactory
currently use an internal
hidden format that is returned as null from Bitmap.getConfig()
. Since
we cannot force BitmapFactory
to always return our desired config,
this setting is a preference, not a promise.
@Deprecated public static final DecodeFormat PREFER_ARGB_8888_DISALLOW_HARDWARE
Downsampler.ALLOW_HARDWARE_CONFIG
to false
instead.PREFER_ARGB_8888
but prevents Glide from using Bitmap.Config.HARDWARE
on Android O+.public static final DecodeFormat PREFER_RGB_565
Bitmap.Config.ARGB_8888
for
Bitmap.getConfig()
. Bitmaps decoded from formats that don't support or
use alpha should return Bitmap.Config.RGB_565
for
Bitmap.getConfig()
.
On Android O+, this format will will use ARGB_8888 only when it's not possible to use
Bitmap.Config.HARDWARE
.
public static final DecodeFormat DEFAULT
public static DecodeFormat[] values()
for (DecodeFormat c : DecodeFormat.values()) System.out.println(c);
public static DecodeFormat valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null