struct OhosPixelMapCreateOps {...} This struct defines the options for creating a PixelMap, including the image width and height, pixel format, whether it is editable, alpha type, and scale type. It is used to specify initialization properties for creating a PixelMap at the native layer.
Since: 10
Related module: Image
Header file: image_pixel_map_mdk.h
| Name | Description |
|---|---|
| uint32_t width | Image width, in pixels. The value must be greater than 0. If 0 is passed, the PixelMap fails to be created. |
| uint32_t height | Image height, in pixels. The value must be greater than 0. If 0 is passed, the PixelMap fails to be created. |
| int32_t pixelFormat | Pixel format of the image. Value range: 0: unknown format. 2: RGB_565. 3: RGBA_8888. 4: BGRA_8888. 5: RGB_888. 6: ALPHA_8. 7: RGBA_F16. 8: NV21. 9: NV12. |
| uint32_t editable | Whether the image is editable. The value 1 means the image pixels are editable, and 0 means not editable. |
| uint32_t alphaType | Alpha type of the image. Value range: 0: Unknown alpha type. 1: No alpha channel or the image is opaque. 2: Premultiplied alpha. 3: Non-premultiplied alpha. |
| uint32_t scaleMode | Scale mode of the image. The options are as follows: 1: scales the image to fill the target image area and crops the portion outside the area with center alignment. 0: scales the image proportionally to fit the target image size (maintaining the aspect ratio). |