public static class ImageSource.DecodingOptions extends Object
The options include the pixel format, color space, and parameters for cropping, scaling, and rotating an image.
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
AllocatorType |
allocator |
Indicates the memory allocation type for decoded image data.
|
boolean |
allowPartialImage |
Indicates whether to allow partial image decoding.
|
static int |
DEFAULT_SAMPLE_SIZE |
Indicates the default sampling size.
|
ColorSpace |
desiredColorSpace |
Indicates the color space of a decoded image, which is defined by
ColorSpace. |
PixelFormat |
desiredPixelFormat |
Indicates the pixel format of a decoded image, which is defined by
PixelFormat. |
Rect |
desiredRegion |
Indicates an image area to be decoded.
|
Size |
desiredSize |
Indicates the expected output size.
|
boolean |
editable |
Specifies whether pixel values of the pixel map to be decoded can be edited.
|
int |
fitDensity |
Indicates the pixel density of the decoded image.
|
float |
rotateDegrees |
Indicates the rotation angle, ranging from 0 to 360.
|
int |
sampleSize |
Indicates the sampling size based on which an image is scaled down.
|
| 构造器 | 说明 |
|---|---|
DecodingOptions() |
public static final int DEFAULT_SAMPLE_SIZE
public AllocatorType allocator
public boolean allowPartialImage
When this option is set to false and an incomplete image is partially decoded, the decoding
fails.
public ColorSpace desiredColorSpace
ColorSpace.
If this color space is supported, the decoder will decode the image to one with this color space. Otherwise, the decoder will select the most suitable color space for the image.
public PixelFormat desiredPixelFormat
PixelFormat.
If this format is supported, the decoder will decode the image to the target format. Otherwise, the decoder will select the most suitable format for the image.
public Rect desiredRegion
If area decoding is not supported, the entire image is decoded and then cropped with a rectangle. The area to be decoded is specified based on the original image instead of an edited image.
public Size desiredSize
If the opted size is different from the original image size, the image is output
after being scaled up or down. If both sampleSize and this option are set, this option prevails. This
variable specifies the final size of an output image. If this variable, desiredRegion, and
rotateDegrees are all set, the expected image area will be decoded, rotated, and then scaled to the expected
size.
public boolean editable
true means that
the values can be edited, and false means the opposite. The default value is false.public int fitDensity
public float rotateDegrees
public int sampleSize