diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index c7ea3eb576f3ceb7f028f68ca88907fe5f878aed..719a29517041d9d4d3f9b55ed7d401765705ef3a 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -901,6 +901,32 @@ Image_ErrorCode OH_PixelmapNative_SetColorSpaceNative(OH_PixelmapNative *pixelma */ Image_ErrorCode OH_PixelmapNative_SetMemoryName(OH_PixelmapNative *pixelmap, char *name, size_t *size); +/** + * @brief Get the total number of bytes occupied by all pixels in the Pixelmap, without any padding. + * + * @param pixelmap The Pixelmap pointer to be operated. + * @param byteCount The total number of bytes to be retrieved. + * @return Function result code: + * {@link IMAGE_SUCCESS} If the operation is successful. + * {@link IMAGE_BAD_PARAMETER} If invalid parameter, pixelmap or byteCount are invalid. + * @see OH_PixelmapNative + * @since 16 + */ +Image_ErrorCode OH_PixelmapNative_GetByteCount(OH_PixelmapNative *pixelmap, uint32_t *byteCount); + +/** + * @brief Get the capacity of the Pixelmap, which is the number of bytes allocated by the Pixelmap. + * + * @param pixelmap The Pixelmap pointer to be operated. + * @param capacity The capacity to be retrieved. + * @return Function result code: + * {@link IMAGE_SUCCESS} If the operation is successful. + * {@link IMAGE_BAD_PARAMETER} If invalid parameter, pixelmap or byteCount are invalid. + * @see OH_PixelmapNative + * @since 16 + */ +Image_ErrorCode OH_PixelmapNative_GetCapacity(OH_PixelmapNative *pixelmap, uint32_t *capacity); + #ifdef __cplusplus }; #endif diff --git a/multimedia/image_framework/libpixelmap.ndk.json b/multimedia/image_framework/libpixelmap.ndk.json index 4c103c8aea0f003b44d024d9e8c13cbe9506311b..df5893bb54f7b95c93d18516455922fae4158f5e 100644 --- a/multimedia/image_framework/libpixelmap.ndk.json +++ b/multimedia/image_framework/libpixelmap.ndk.json @@ -182,5 +182,13 @@ { "first_introduced": "13", "name": "OH_PixelmapNative_SetMemoryName" + }, + { + "first_introduced": "16", + "name": "OH_PixelmapNative_GetByteCount" + }, + { + "first_introduced": "16", + "name": "OH_PixelmapNative_GetCapacity" } ] \ No newline at end of file