public enum Config {
* Each pixel is stored as a single translucency (alpha) channel.
* This is very useful to efficiently store masks for instance.
* No color information is stored.
* With this configuration, each pixel requires 1 byte of memory.
*/
ALPHA_8 (1),
* bit的空间,对应的存储值最大分别是32, 64, 32
* Each pixel is stored on 2 bytes and only the RGB channels are
* encoded: red is stored with 5 bits of precision (32 possible
* values), green is 6(64 possible values) and blue is 5.
*
* This configuration can produce slight visual artifacts depending
* on the configuration of the source.
* 这个配置通常用于对颜色要求不高的非透明的图片.
* This configuration may be useful when using opaque bitmaps
* that do not require high color fidelity.
*/
RGB_565 (3),
* Each pixel is stored on 2 bytes. The three RGB color channels
* and the alpha channel (translucency) are stored with a 4 bits
* precision (16 possible values.)
* 当应用需要存储透明度值,同时又需要节约内存的时候,使用该配置。
* 建议使用ARGB_8888代替该配置
* Note: KITKAT版本之后,使用该配置时,系统将自动使用ARGB_8888配置替换。
*/
@Deprecated
ARGB_4444 (4),
* Each pixel is stored on 4 bytes. Each channel (RGB and alpha
* for translucency) is stored with 8 bits of precision (256
* possible values.)
* 推荐使用该配置。
* This configuration is very flexible and offers the best
* quality. It should be used whenever possible.
*/
ARGB_8888 (5),
* Each pixels is stored on 8 bytes. Each channel (RGB and alpha
* for translucency) is stored as a
* {@link android.util.Half half-precision floating point value}.
* 适合用于存储高密度的图片
* This configuration is particularly suited for wide-gamut and
* HDR content.
*/
RGBA_F16 (6),
* Special configuration, when bitmap is stored only in graphic memory.
* Bitmaps in this configuration are always immutable.
* 当一个图片只需要用于显示在screen上,这是最佳的配置。
*/
HARDWARE (7);
private static Config sConfigs[] = {
null, ALPHA_8, null, RGB_565, ARGB_4444, ARGB_8888, RGBA_F16, HARDWARE
};
}