From 62371b7b14e7c41c078a6568f6533a97660cc3dd Mon Sep 17 00:00:00 2001 From: caochuan Date: Mon, 4 Mar 2024 15:38:00 +0800 Subject: [PATCH] =?UTF-8?q?Feature:=20=E6=94=AF=E6=8C=81=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: caochuan --- .../include/image_pixel_map_mdk.h | 16 ++++++++++++++++ .../include/image_source_mdk.h | 19 +++++++++++++++++++ .../libimage_pixelmap_napi.ndk.json | 4 ++++ .../libimage_source_ndk.ndk.json | 4 ++++ 4 files changed, 43 insertions(+) diff --git a/multimedia/image_framework/include/image_pixel_map_mdk.h b/multimedia/image_framework/include/image_pixel_map_mdk.h index b5cf58c3a..327054732 100644 --- a/multimedia/image_framework/include/image_pixel_map_mdk.h +++ b/multimedia/image_framework/include/image_pixel_map_mdk.h @@ -547,6 +547,22 @@ int32_t OH_PixelMap_Crop(const NativePixelMap* native, int32_t x, int32_t y, int */ int32_t OH_PixelMap_GetImageInfo(const NativePixelMap* native, OhosPixelMapInfos *info); +/** + * @brief Obtains the image encodedformat of a PixelMap object. + * + * @param native Indicates the pointer to a NativePixelMap object. + * @param format Indicates a pointer to the string of image encodedformat obtained. + * @return Returns {@link IRNdkErrCode} IMAGE_RESULT_SUCCESS - if the operation is successful. + * returns {@link IRNdkErrCode} IMAGE_RESULT_BAD_PARAMETER - if bad parameter. + * returns {@link IRNdkErrCode} IMAGE_RESULT_JNI_ENV_ABNORMAL - if Abnormal JNI environment. + * returns {@link IRNdkErrCode} IMAGE_RESULT_INVALID_PARAMETER - if invalid parameter. + * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_FAILED - if decode fail. + * returns {@link IRNdkErrCode} IMAGE_RESULT_CHECK_FORMAT_ERROR - if decode fail. + * @since 12 + * @version 5.0 + */ +int32_t OH_PixelMap_GetEncodedFormat(const NativePixelMap* native, char* format); + /** * @brief Obtains the memory address of a NativePixelMap object and locks the memory. * diff --git a/multimedia/image_framework/include/image_source_mdk.h b/multimedia/image_framework/include/image_source_mdk.h index 437e4816a..111e8d21d 100644 --- a/multimedia/image_framework/include/image_source_mdk.h +++ b/multimedia/image_framework/include/image_source_mdk.h @@ -814,6 +814,25 @@ int32_t OH_ImageSource_GetFrameCount(const ImageSourceNative* native, uint32_t * int32_t OH_ImageSource_GetImageInfo(const ImageSourceNative* native, int32_t index, struct OhosImageSourceInfo* info); +/** + * @brief Obtains the encodedformat of image from an ImageSource object. + * + * @param native Indicates a pointer to the {@link ImageSourceNative} object at the C++ native layer. + * @param format Indicates a pointer to the string of image encodedformat obtained. + * @return Returns {@link IRNdkErrCode} IMAGE_RESULT_SUCCESS - if the operation is successful. + * returns {@link IRNdkErrCode} IMAGE_RESULT_BAD_PARAMETER - if bad parameter. + * returns {@link IRNdkErrCode} IMAGE_RESULT_JNI_ENV_ABNORMAL - if Abnormal JNI environment. + * returns {@link IRNdkErrCode} IMAGE_RESULT_INVALID_PARAMETER - if invalid parameter. + * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_FAILED - if decode fail. + * returns {@link IRNdkErrCode} IMAGE_RESULT_CHECK_FORMAT_ERROR - if decode fail. + * @see {@link ImageSourceNative} + * + * @Syscap SystemCapability.Multimedia.Image + * @since 12 + * @version 5.0 + */ +int32_t OH_ImageSource_GetEncodedFormat(const ImageSourceNative* native, char* format); + /** * @brief Obtains the value of an image property from an ImageSource object. * diff --git a/multimedia/image_framework/libimage_pixelmap_napi.ndk.json b/multimedia/image_framework/libimage_pixelmap_napi.ndk.json index 64800fe82..77e631c99 100644 --- a/multimedia/image_framework/libimage_pixelmap_napi.ndk.json +++ b/multimedia/image_framework/libimage_pixelmap_napi.ndk.json @@ -62,5 +62,9 @@ }, { "name": "OH_PixelMap_UnAccessPixels" + }, + { + "first_introduced": "12", + "name": "OH_PixelMap_GetEncodedFormat" } ] \ No newline at end of file diff --git a/multimedia/image_framework/libimage_source_ndk.ndk.json b/multimedia/image_framework/libimage_source_ndk.ndk.json index 04f0e2331..af6c358e5 100644 --- a/multimedia/image_framework/libimage_source_ndk.ndk.json +++ b/multimedia/image_framework/libimage_source_ndk.ndk.json @@ -58,5 +58,9 @@ { "first_introduced": "11", "name": "OH_ImageSource_CreateIncrementalFromData" + }, + { + "first_introduced": "12", + "name": "OH_ImageSource_GetEncodedFormat" } ] \ No newline at end of file -- Gitee