diff --git a/zh-cn/native_sdk/multimedia/image_framework/include/image/image_common.h b/zh-cn/native_sdk/multimedia/image_framework/include/image/image_common.h index ae96bb681bb600224cae73810d1493274f1aa088..3329efd1a7f245130e14408edfe477520763cb80 100644 --- a/zh-cn/native_sdk/multimedia/image_framework/include/image/image_common.h +++ b/zh-cn/native_sdk/multimedia/image_framework/include/image/image_common.h @@ -26,7 +26,9 @@ * @file image_common.h * * @brief 声明图像接口使用的公共枚举和结构体。 - * + * + * @library libimage_common.so + * @kit ImageKit * @syscap SystemCapability.Multimedia.Image.Core * @since 12 */ @@ -1291,6 +1293,63 @@ static const char *OHOS_IMAGE_PROPERTY_SCENE_POINTER = "HwMnoteScenePointer"; */ static const char *OHOS_IMAGE_PROPERTY_SCENE_VERSION = "HwMnoteSceneVersion"; +/** + * @brief 是否支持XMAGE。 + * + * @since 12 + */ + static const char *OHOS_IMAGE_PROPERTY_IS_XMAGE_SUPPORTED = "HwMnoteIsXmageSupported"; + + /** + * @brief XMAGE水印模式。 + * + * @since 12 + */ + static const char *OHOS_IMAGE_PROPERTY_XMAGE_MODE = "HwMnoteXmageMode"; + + /** + * @brief 水印区域X1坐标。 + * + * @since 12 + */ + static const char *OHOS_IMAGE_PROPERTY_XMAGE_LEFT = "HwMnoteXmageLeft"; + + /** + * @brief 水印区域Y1坐标。 + * + * @since 12 + */ + static const char *OHOS_IMAGE_PROPERTY_XMAGE_TOP = "HwMnoteXmageTop"; + + /** + * @brief 水印区域X2坐标 + * + * @since 12 + */ + static const char *OHOS_IMAGE_PROPERTY_XMAGE_RIGHT = "HwMnoteXmageRight"; + + /** + * @brief 水印区域Y2坐标。 + * + * @since 12 + */ + static const char *OHOS_IMAGE_PROPERTY_XMAGE_BOTTOM = "HwMnoteXmageBottom"; + + /** + * @brief 云增强模式。 + * + * @since 12 + */ + static const char *OHOS_IMAGE_PROPERTY_CLOUD_ENHANCEMENT_MODE = "HwMnoteCloudEnhancementMode"; + + /** + * @brief 运动快拍模式。 + * + * @since 12 + */ + static const char *OHOS_IMAGE_PROPERTY_WIND_SNAPSHOT_MODE = "HwMnoteWindSnapshotMode"; + + /** * @brief GIF图片循环次数 * diff --git a/zh-cn/native_sdk/multimedia/image_framework/include/image/image_native.h b/zh-cn/native_sdk/multimedia/image_framework/include/image/image_native.h index 1bfafd3bb9c77dff1dd5b0178f0da31bc8582f1c..e8e903a3a1784546e4deb4cf6688a32606f750d8 100644 --- a/zh-cn/native_sdk/multimedia/image_framework/include/image/image_native.h +++ b/zh-cn/native_sdk/multimedia/image_framework/include/image/image_native.h @@ -28,6 +28,7 @@ * @brief 声明图像的剪辑矩形、大小和组件数据的接口函数。 * * @library libohimage.so + * @kit ImageKit * @syscap SystemCapability.Multimedia.Image.Core * @since 12 */ diff --git a/zh-cn/native_sdk/multimedia/image_framework/include/image/image_packer_native.h b/zh-cn/native_sdk/multimedia/image_framework/include/image/image_packer_native.h index 0dd4e109483dc52a20400d0679b7de8da1ec7364..004dff08685ae92a25a7adce0260519f742507e8 100644 --- a/zh-cn/native_sdk/multimedia/image_framework/include/image/image_packer_native.h +++ b/zh-cn/native_sdk/multimedia/image_framework/include/image/image_packer_native.h @@ -28,6 +28,7 @@ * @brief 图片编码API。 * * @library libimage_packer.so + * @kit ImageKit * @syscap SystemCapability.Multimedia.Image.ImagePacker * @since 12 */ @@ -61,14 +62,14 @@ typedef struct OH_PackingOptions OH_PackingOptions; /** * @brief 图像序列编码选项。 * - * @since 12 + * @since 18 */ struct OH_PackingOptionsForSequence; /** * @brief 图像序列编码选项。 * - * @since 12 + * @since 18 */ typedef struct OH_PackingOptionsForSequence OH_PackingOptionsForSequence; @@ -146,6 +147,30 @@ Image_ErrorCode OH_PackingOptions_GetQuality(OH_PackingOptions *options, Image_ErrorCode OH_PackingOptions_SetQuality(OH_PackingOptions *options, uint32_t quality); +/** + * @brief 获取OH_PackingOptions结构体的needsPackProperties参数。 + * + * @param options 被操作的OH_PackingOptions指针。 + * @param needsPackProperties 是否需要编码图片属性信息,例如EXIF。 + * @return 如果操作成功返回 IMAGE_SUCCESS,如果参数错误返回 IMAGE_BAD_PARAMETER, + * 具体请参考 {@link Image_ErrorCode} + * @since 12 + */ + Image_ErrorCode OH_PackingOptions_GetNeedsPackProperties(OH_PackingOptions *options, + bool *needsPackProperties); + +/** + * @brief 设置OH_PackingOptions结构体的needsPackProperties参数。 + * + * @param options 被操作的OH_PackingOptions指针。 + * @param needsPackProperties 是否需要编码图片属性信息,例如EXIF。 + * @return 如果操作成功返回 IMAGE_SUCCESS,如果参数错误返回 IMAGE_BAD_PARAMETER, + * 具体请参考 {@link Image_ErrorCode} + * @since 12 + */ +Image_ErrorCode OH_PackingOptions_SetNeedsPackProperties(OH_PackingOptions *options, + bool needsPackProperties); + /** * @brief 获取编码时期望的图片动态范围。 * diff --git a/zh-cn/native_sdk/multimedia/image_framework/include/image/image_receiver_native.h b/zh-cn/native_sdk/multimedia/image_framework/include/image/image_receiver_native.h index 50ef69ffb5cc40f9a5fd2e2ef639f2d0baf75231..2ba7ddeb1700e3a44ddcf83af4c4600a652592ed 100644 --- a/zh-cn/native_sdk/multimedia/image_framework/include/image/image_receiver_native.h +++ b/zh-cn/native_sdk/multimedia/image_framework/include/image/image_receiver_native.h @@ -27,6 +27,7 @@ * * @brief 声明从native层获取图片数据的方法。 * @library libimage_receiver.so + * @kit ImageKit * @syscap SystemCapability.Multimedia.Image.ImageReceiver * @since 12 */ diff --git a/zh-cn/native_sdk/multimedia/image_framework/include/image/image_source_native.h b/zh-cn/native_sdk/multimedia/image_framework/include/image/image_source_native.h index 1dae6502e5e80ab30aecf38beaee5fa27f4f6ce5..e72ebf7cddd68326c15d87d22741ddcbf0f54652 100644 --- a/zh-cn/native_sdk/multimedia/image_framework/include/image/image_source_native.h +++ b/zh-cn/native_sdk/multimedia/image_framework/include/image/image_source_native.h @@ -28,6 +28,7 @@ * @brief 图片解码API。 * * @library libimage_source.so + * @kit ImageKit * @syscap SystemCapability.Multimedia.Image.ImageSource * @since 12 */ @@ -37,6 +38,7 @@ #include "image_common.h" #include "pixelmap_native.h" +#include "picture_native.h" #include "rawfile/raw_file.h" #ifdef __cplusplus @@ -60,6 +62,21 @@ typedef struct OH_ImageSourceNative OH_ImageSourceNative; struct OH_ImageSource_Info; typedef struct OH_ImageSource_Info OH_ImageSource_Info; +/** + * @brief Picture解码参数结构体。 + * {@link OH_DecodingOptionsForPicture_Create}. + * + * @since 13 + */ + struct OH_DecodingOptionsForPicture; + + /** + * @brief Picture解码参数结构体。 + * {@link OH_DecodingOptionsForPicture_Create}. + * @since 13 + */ + typedef struct OH_DecodingOptionsForPicture OH_DecodingOptionsForPicture; + /** * @brief 解码指定期望动态范围。 * diff --git a/zh-cn/native_sdk/multimedia/image_framework/include/image_mdk.h b/zh-cn/native_sdk/multimedia/image_framework/include/image_mdk.h index 54c398b9dcfd5009ca99549aab4f905783bb1171..c0a1b8c1da6b1b2b50860a5f31343b8d16e94439 100644 --- a/zh-cn/native_sdk/multimedia/image_framework/include/image_mdk.h +++ b/zh-cn/native_sdk/multimedia/image_framework/include/image_mdk.h @@ -27,19 +27,20 @@ /** * @file image_mdk.h * - * @brief 声明访问图像剪辑矩形、大小、格式和组件数据的函数。 + * @brief 声明访问图像矩形、大小、格式和组件数据的函数。 * + * @library libimage_ndk.z.so + * @kit ImageKit + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 2.0 */ #ifndef INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_MDK_H_ #define INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_MDK_H_ -#include #include "napi/native_api.h" #include "image_mdk_common.h" -namespace OHOS { -namespace Media { + #ifdef __cplusplus extern "C" { #endif @@ -217,6 +218,4 @@ int32_t OH_Image_Release(ImageNative* native); }; #endif /** @} */ -} // namespace Media -} // namespace OHOS #endif // INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_MDK_H_ diff --git a/zh-cn/native_sdk/multimedia/image_framework/include/image_mdk_common.h b/zh-cn/native_sdk/multimedia/image_framework/include/image_mdk_common.h index 42363a9e452e74d26ddd5ae2ac11b4fa59eabdcf..3ef80f3203a20f871336e61cec740bb887b71cbe 100644 --- a/zh-cn/native_sdk/multimedia/image_framework/include/image_mdk_common.h +++ b/zh-cn/native_sdk/multimedia/image_framework/include/image_mdk_common.h @@ -29,6 +29,9 @@ * * @brief 声明图像常用的枚举值和结构体。 * + * @library libimage_ndk.z.so + * @kit ImageKit + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 2.0 */ @@ -176,6 +179,5 @@ struct OhosImageSize { }; #endif /** @} */ -} // namespace Media -} // namespace OHOS + #endif // INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_COMMON_H_ diff --git a/zh-cn/native_sdk/multimedia/image_framework/include/image_packer_mdk.h b/zh-cn/native_sdk/multimedia/image_framework/include/image_packer_mdk.h index d7b267ef321b4a892cc37d2afffc5fdf0d85967e..dddac665ad9d078f73bc65ebbd2ed1526230b656 100644 --- a/zh-cn/native_sdk/multimedia/image_framework/include/image_packer_mdk.h +++ b/zh-cn/native_sdk/multimedia/image_framework/include/image_packer_mdk.h @@ -40,6 +40,7 @@ * 最后通过OH_ImagePacker_Release释放编码器实例对象。\n * * @library libimage_packer_ndk.z.so + * @kit ImageKit * @syscap SystemCapability.Multimedia.Image * @since 11 * @version 4.1 diff --git a/zh-cn/native_sdk/multimedia/image_framework/include/image_receiver_mdk.h b/zh-cn/native_sdk/multimedia/image_framework/include/image_receiver_mdk.h index b0c0f87d447c7ee501a48c2db6883c2fc9c92873..7bea69dff50c001783d0fe027f60e7f891ed5f32 100644 --- a/zh-cn/native_sdk/multimedia/image_framework/include/image_receiver_mdk.h +++ b/zh-cn/native_sdk/multimedia/image_framework/include/image_receiver_mdk.h @@ -28,7 +28,11 @@ * @file image_receiver_mdk.h * * @brief 声明从native层获取图片数据的方法。 + * 需要链接 libimagendk.z.solibimage_receiverndk.z.so。 * + * @library libimage_receiver_ndk.z.so + * @kit ImageKit + * @syscap SystemCapability.Multimedia.Image * @since 10 * @version 2.0 */ diff --git a/zh-cn/native_sdk/multimedia/image_framework/include/image_source_mdk.h b/zh-cn/native_sdk/multimedia/image_framework/include/image_source_mdk.h index df83d8999f6029ba785402a6fe7d8194c712695b..da2fd0f2f58dd1ba34211bc0e314ee99ff3fb677 100644 --- a/zh-cn/native_sdk/multimedia/image_framework/include/image_source_mdk.h +++ b/zh-cn/native_sdk/multimedia/image_framework/include/image_source_mdk.h @@ -29,19 +29,27 @@ * * @brief 声明将图片源解码成像素位图的方法。 * + * @library libimage_source_ndk.z.so + * @kit ImageKit * @Syscap SystemCapability.Multimedia.Image * @since 10 * @version 4.0 */ -#ifndef INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_SOURCE_MDK_H_ -#define INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_SOURCE_MDK_H_ -#include -#include "napi/native_api.h" -#include "image_mdk_common.h" -#ifdef __cplusplus -extern "C" { -#endif + #ifndef INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_SOURCE_MDK_H_ + #define INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_SOURCE_MDK_H_ + #ifdef __cplusplus + #include + #else + #include + #endif + #include "napi/native_api.h" + #include "image_mdk_common.h" + #include "rawfile/raw_file.h" + #ifdef __cplusplus + extern "C" { + #endif + /** * @brief 为图像源方法定义native层图像源对象。 @@ -860,35 +868,35 @@ int32_t OH_ImageSource_ModifyImageProperty(const ImageSourceNative* native, * * @param native 表明native层 {@link ImageSourceNative} 值的指针。 * @param data 表明更新数据信息{@link OhosImageSourceUpdateData}的指针。 - * @return 如果操作成功返回{@link OHOS_IMAGE_RESULT_SUCCESS}; - * 如果参数错误,返回{@link IMAGE_RESULT_BAD_PARAMETER}; - * 如果 JNI 环境异常,返回{@link IMAGE_RESULT_JNI_ENV_ABNORMAL}; - * 如果参数无效,{@link IMAGE_RESULT_INVALID_PARAMETER}; - * 如果获取图片数据异常,返回 {@link IMAGE_RESULT_GET_DATA_ABNORMAL}; - * 如果解码失败,返回{@link IMAGE_RESULT_DECODE_FAILED}; - * 如果图像解码头错误,返回{@link IMAGE_RESULT_DECODE_HEAD_ABNORMAL}; - * 如果创建解码器失败,返回 {@link IMAGE_RESULT_CREATE_DECODER_FAILED}; - * 如果创建编码器失败,返回 {@link IMAGE_RESULT_CREATE_ENCODER_FAILED}; - * 如果检查格式不对,返回{@IMAGE_RESULT_CHECK_FORMAT_ERROR }; - * 如果skia错误,返回 {@link IMAGE_RESULT_THIRDPART_SKIA_ERROR}; - * 如果输入图片数据错误,返回 {@link IMAGE_RESULT_DATA_ABNORMAL}; - * 如果共享内存错误,返回 {@link IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST}; - * 如果共享内存数据异常,返回 {@link IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL}; - * 如果图片解码异常,返回{@link IMAGE_RESULT_DECODE_ABNORMAL}; - * 如果图像错误,返回 {@link IMAGE_RESULT_MALLOC_ABNORMAL}; - * 如果图片初始化错误,返回 {@link IMAGE_RESULT_DATA_UNSUPPORT}; - * 如果图片输入数据错误,返回 {@link IMAGE_RESULT_INIT_ABNORMAL}; - * 如果裁剪错误,返回 {@link IMAGE_RESULT_CROP}; - * 如果图片格式未知,返回 {@link IMAGE_RESULT_UNKNOWN_FORMAT}; - * 如果注册插件失败,返回 {@link IMAGE_RESULT_PLUGIN_REGISTER_FAILED}; - * 如果创建插件失败。返回 {@link IMAGE_RESULT_PLUGIN_CREATE_FAILED}; - * 如果增加位图失败,返回 {@link IMAGE_RESULT_ENCODE_FAILED}; - * 如果不支持图片硬解码,返回 {@link IMAGE_RESULT_HW_DECODE_UNSUPPORT}; - * 如果硬解码失败,返回 {@link IMAGE_RESULT_HW_DECODE_FAILED}; - * 如果ipc失败,返回 {@link IMAGE_RESULT_ERR_IPC}; - * 如果索引无效,返回 {@link IMAGE_RESULT_INDEX_INVALID}; - * 如果硬解码失败,返回 {@link IMAGE_RESULT_ALPHA_TYPE_ERROR}; - * 如果硬解码失败,返回 {@link IMAGE_RESULT_ALLOCATER_TYPE_ERROR}。 + * @return {@link OHOS_IMAGE_RESULT_SUCCESS} 如果操作成功; + * {@link IMAGE_RESULT_BAD_PARAMETER} 如果参数错误; + * {@link IMAGE_RESULT_JNI_ENV_ABNORMAL} 如果 JNI 环境异常; + * {@link IMAGE_RESULT_INVALID_PARAMETER} 如果参数无效; + * {@link IMAGE_RESULT_GET_DATA_ABNORMAL} 如果获取图片数据异常; + * {@link IMAGE_RESULT_DECODE_FAILED} 如果解码失败; + * {@link IMAGE_RESULT_DECODE_HEAD_ABNORMAL} 如果图像解码头错误; + * {@link IMAGE_RESULT_CREATE_DECODER_FAILED} 如果创建解码器失败; + * {@link IMAGE_RESULT_CREATE_ENCODER_FAILED} 如果创建编码器失败; + * {@link IMAGE_RESULT_CHECK_FORMAT_ERROR} 如果检查格式不对; + * {@link IMAGE_RESULT_THIRDPART_SKIA_ERROR} 如果 Skia 第三方库出错; + * {@link IMAGE_RESULT_DATA_ABNORMAL} 如果输入图片数据错误; + * {@link IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST} 如果共享内存不存在; + * {@link IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL} 如果共享内存数据异常; + * {@link IMAGE_RESULT_DECODE_ABNORMAL} 如果图片解码异常; + * {@link IMAGE_RESULT_MALLOC_ABNORMAL} 如果图像内存分配异常; + * {@link IMAGE_RESULT_DATA_UNSUPPORT} 如果图片初始化错误; + * {@link IMAGE_RESULT_INIT_ABNORMAL} 如果图片输入数据错误; + * {@link IMAGE_RESULT_CROP} 如果裁剪失败; + * {@link IMAGE_RESULT_UNKNOWN_FORMAT} 如果图片格式未知; + * {@link IMAGE_RESULT_PLUGIN_REGISTER_FAILED} 如果注册插件失败; + * {@link IMAGE_RESULT_PLUGIN_CREATE_FAILED} 如果创建插件失败; + * {@link IMAGE_RESULT_ENCODE_FAILED} 如果增加位图失败; + * {@link IMAGE_RESULT_HW_DECODE_UNSUPPORT} 如果不支持图片硬解码; + * {@link IMAGE_RESULT_HW_DECODE_FAILED} 如果硬解码失败; + * {@link IMAGE_RESULT_ERR_IPC} 如果 IPC 操作失败; + * {@link IMAGE_RESULT_INDEX_INVALID} 如果索引无效; + * {@link IMAGE_RESULT_ALPHA_TYPE_ERROR} 如果 Alpha 类型错误; + * {@link IMAGE_RESULT_ALLOCATER_TYPE_ERROR} 如果内存分配器类型错误。 * @see {@link ImageSourceNative}, {@link OhosImageSourceUpdateData} * * @Syscap SystemCapability.Multimedia.Image @@ -902,12 +910,12 @@ int32_t OH_ImageSource_UpdateData(const ImageSourceNative* native, struct OhosIm * @brief 释放native层图像源 ImageSourceNative。 * * @param native 表明native层 {@link ImageSourceNative} 值的指针。 - * @return 如果操作成功返回{@link OHOS_IMAGE_RESULT_SUCCESS}; - * 如果参数错误,返回{@link IMAGE_RESULT_BAD_PARAMETER}; - * 如果 JNI 环境异常,返回{@link IMAGE_RESULT_JNI_ENV_ABNORMAL}; - * 如果参数无效,{@link IMAGE_RESULT_INVALID_PARAMETER}; - * 如果获取图片数据异常,返回 {@link IMAGE_RESULT_GET_DATA_ABNORMAL}; - * 如果输入图片数据错误,返回 {@link IMAGE_RESULT_DATA_ABNORMAL}。 + * @return {@link OHOS_IMAGE_RESULT_SUCCESS}如果操作成功; + * {@link IMAGE_RESULT_BAD_PARAMETER}如果参数错误; + * {@link IMAGE_RESULT_JNI_ENV_ABNORMAL}如果 JNI 环境异常; + * {@link IMAGE_RESULT_INVALID_PARAMETER}如果参数无效; + * {@link IMAGE_RESULT_GET_DATA_ABNORMAL}如果获取图片数据异常; + * {@link IMAGE_RESULT_DATA_ABNORMAL}如果输入图片数据错误。 * @see {@link ImageSourceNative}, {@link OH_ImageSource_Create}, {@link OH_ImageSource_CreateIncremental} * * @Syscap SystemCapability.Multimedia.Image