pub unsafe extern "C" fn OH_ImageSourceNative_CreatePixelmapUsingAllocator(
source: *mut OH_ImageSourceNative,
options: *mut OH_DecodingOptions,
allocator: IMAGE_ALLOCATOR_TYPE,
pixelmap: *mut *mut OH_PixelmapNative,
) -> ImageResultAvailable on crate features
api-12 and image-source and api-15 only.Expand description
Creates a PixelMap based on decoding parameters OH_DecodingOptions, the memory type used by the
PixelMap can be specified by allocatorType IMAGE_ALLOCATOR_TYPE. By default, the system selects the memory
type based on the image type, image size, platform capability, etc. When processing the PixelMap returned by this
interface, please always consider the impact of stride.
§Arguments
-
source- Image Source. -
options- Decoding parameters, such as the size, pixel format, and color space of the pixelMap. For details, seeOH_DecodingOptions. -
allocator- Indicate which memory type will be used by the returned PixelMap. -
pixelmap- Decoded Pixelmap object.
§Returns
- Error code.
[
IMAGE_SUCCESS] if the execution is successful. [IMAGE_BAD_PARAMETER] source is nullptr, or picture is nullptr. [IMAGE_BAD_SOURCE] data source exception. [IMAGE_SOURCE_UNSUPPORTED_MIME_TYPE] unsupported mime type. [IMAGE_SOURCE_TOO_LARGE] image to large. [IMAGE_SOURCE_UNSUPPORTED_ALLOCATOR_TYPE] unsupported allocator type, e.g., use share memory to decode a HDR image as only DMA supported hdr metadata. [IMAGE_SOURCE_UNSUPPORTED_OPTIONS] unsupported options, e.g, cannot convert image into desired pixel format. [IMAGE_DECODE_FAILED] decode failed. [IMAGE_SOURCE_ALLOC_FAILED] memory allocation failed.
Available since API-level: 15