Enum DecodeFormat
- java.lang.Object
-
- java.lang.Enum<DecodeFormat>
-
- com.bumptech.glide.load.DecodeFormat
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<DecodeFormat>
public enum DecodeFormat extends java.lang.Enum<DecodeFormat>
Options for setting the value ofBitmap.getConfig()forBitmaps returned byResourceDecoders.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.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description PREFER_ARGB_8888Bitmaps returned by theResourceDecoder.PREFER_RGB_565Bitmaps 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 Modifier and Type Field Description static DecodeFormatDEFAULTThe default value for DecodeFormat.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DecodeFormatvalueOf(java.lang.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.
-
-
-
Enum Constant Detail
-
PREFER_ARGB_8888
public static final DecodeFormat 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
public static final DecodeFormat 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 Detail
-
DEFAULT
public static final DecodeFormat DEFAULT
The default value for DecodeFormat.
-
-
Method Detail
-
values
public static DecodeFormat[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DecodeFormat c : DecodeFormat.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DecodeFormat valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
-