Class BitmapFactory.Options
- Enclosing class:
BitmapFactory
Unlike Android (with its Skia graphics engine), it is not necessary to
pre-multiply alpha of image data in Modern UI framework. We allow images
to be directly drawn by the view system or through a Canvas
either
pre-multiplied or non-pre-multiplied. Although pre-multiplied alpha can
help draw-time blending, but it results in precision loss since images
are 8-bit per channel in memory. Instead, Modern UI will pre-multiply alpha
in the shading pipeline.
-
Field Summary
Modifier and TypeFieldDescriptionboolean
If set to true, the decoder will populate the mimetype of the decoded image.boolean
If false, decode methods will always return a mutable Bitmap instead of an immutable one.If this is non-null, the decoder will try to decode into this color space.If this is non-null, the decoder will try to decode into this internal format.If known, the color space the decoded bitmap will have.If known, the config the decoded bitmap will have.int
The height of the bitmap.If known, this string is set to the mimetype of the decoded image.int
The width of the bitmap. -
Constructor Summary
-
Method Summary
-
Field Details
-
inImmutable
public boolean inImmutableIf false, decode methods will always return a mutable Bitmap instead of an immutable one. This can be used for instance to programmatically apply effects to a Bitmap loaded through BitmapFactory. -
inDecodeMimeType
public boolean inDecodeMimeTypeIf set to true, the decoder will populate the mimetype of the decoded image.- See Also:
-
inPreferredFormat
If this is non-null, the decoder will try to decode into this internal format. If it is null, or the request cannot be met, the decoder will try to pick the best matching format based on the system's screen depth, and characteristics of the original image such as if it has per-pixel alpha (requiring a format that also does). -
inPreferredColorSpace
If this is non-null, the decoder will try to decode into this color space. If it is null, or the request cannot be met, the decoder will pick either the color space embedded in the image or the color space best suited for the requested image format (for instancesRGB
forBitmap.Format.RGBA_8888
format.Only
ColorSpace.Model.RGB
color spaces are currently supported. AnIllegalArgumentException
will be thrown by the decode methods when setting a non-RGB color space such asLab
.The specified color space's transfer function must be an
ICC parametric curve
. AnIllegalArgumentException
will be thrown by the decode methods if callingColorSpace.Rgb.getTransferParameters()
on the specified color space returns null.After decode, the bitmap's color space is stored in
outColorSpace
. -
outWidth
public int outWidthThe width of the bitmap. If there is an error, it is undefined. -
outHeight
public int outHeightThe height of the bitmap. If there is an error, it is undefined. -
outMimeType
If known, this string is set to the mimetype of the decoded image. If not known, or there is an error, it is undefined.Set only when
inDecodeMimeType
is true. -
outFormat
If known, the config the decoded bitmap will have. If not known, or there is an error, it is undefined. -
outColorSpace
If known, the color space the decoded bitmap will have. Note that the output color space is not guaranteed to be the color space the bitmap is encoded with. If not known, or there is an error, it is undefined.
-
-
Constructor Details
-
Options
public Options()
-