com.bumptech.glide.load
Enum DecodeFormat

java.lang.Object
  extended by java.lang.Enum<DecodeFormat>
      extended by com.bumptech.glide.load.DecodeFormat
All Implemented Interfaces:
Serializable, Comparable<DecodeFormat>

public enum DecodeFormat
extends Enum<DecodeFormat>

Options for setting the value of Bitmap.getConfig() for Bitmaps returned by a BitmapDecoder.

Note - In some cases it may not be possible to obey the requested setting, not all BitmapDecoders 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
ALWAYS_ARGB_8888
          All bitmaps returned by the BitmapDecoder should return Bitmap.Config.ARGB_8888 for Bitmap.getConfig().
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().
 
Method Summary
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.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ALWAYS_ARGB_8888

public static final DecodeFormat ALWAYS_ARGB_8888
All bitmaps returned by the BitmapDecoder should return Bitmap.Config.ARGB_8888 for Bitmap.getConfig().


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 return 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().

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(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null