diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index ecbd8fd828285d36b1adfe06efc4130440bae563..a5d96641afbdd7ae20022d0decd1bde378ad8fb0 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2650,5 +2650,13 @@ { "first_introduced": "16", "name": "OH_ArkUI_UIInputEvent_GetTargetDisplayId" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_XComponent_StartImageAnalyzer" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_XComponent_StopImageAnalyzer" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_interface_xcomponent.h b/arkui/ace_engine/native/native_interface_xcomponent.h index 7bb2a1489854a4579dc7adf0299bd63a463397f8..c15ecf20c3ca2a926b72fef7e21bc9a648be7c38 100644 --- a/arkui/ace_engine/native/native_interface_xcomponent.h +++ b/arkui/ace_engine/native/native_interface_xcomponent.h @@ -75,6 +75,24 @@ enum { OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER = -2, }; +/** + * @brief Status code for AI analyzer. + * + * @since 16 + */ +typedef enum { + /** AI analyzer execution is finished. */ + ARKUI_XCOMPONENT_AI_ANALYSIS_FINISHED = 0, + /** AI analyzer is disabled. */ + ARKUI_XCOMPONENT_AI_ANALYSIS_DISABLED = 110000, + /** AI analyzer is unsupported. */ + ARKUI_XCOMPONENT_AI_ANALYSIS_UNSUPPORTED = 110001, + /** AI analyzer is ongoing. */ + ARKUI_XCOMPONENT_AI_ANALYSIS_ONGOING = 110002, + /** AI analyzer is stopped. */ + ARKUI_XCOMPONENT_AI_ANALYSIS_STOPPED = 110003, +} ArkUI_XComponent_ImageAnalyzerState; + typedef enum { /** Trigger a touch event when a finger is pressed. */ OH_NATIVEXCOMPONENT_DOWN = 0, @@ -849,6 +867,34 @@ int32_t OH_NativeXComponent_GetNativeAccessibilityProvider( int32_t OH_NativeXComponent_RegisterKeyEventCallbackWithResult( OH_NativeXComponent* component, bool (*callback)(OH_NativeXComponent* component, void* window)); +/** + * @brief Start image analyzer for the specified XComponent + * instance created by the native API. + * + * @param node Indicates the pointer to the XComponent instance created by the native API. + * @param userData Indicates the pointer to a user defined data. + * @param callback Indicates the pointer to a image analyzer status callback function. + * @return Returns the status code of the execution. + * {@link ARKUI_ERROR_CODE_NO_ERROR} the execution is successful.\n + * {@link ARKUI_ERROR_CODE_PARAM_INVALID} component is nullptr or callback is nullptr, + * or the type of node is not XComponent.\n + * @since 16 + */ +int32_t OH_ArkUI_XComponent_StartImageAnalyzer(ArkUI_NodeHandle node, void* userData, + void (*callback)(ArkUI_NodeHandle node, ArkUI_XComponent_ImageAnalyzerState statusCode, void* userData)); + +/** + * @brief Stop image analyzer for the specified XComponent + * instance created by the native API. + * + * @param node Indicates the pointer to the XComponent instance created by the native API. + * @return Returns the status code of the execution. + * {@link ARKUI_ERROR_CODE_NO_ERROR} the execution is successful.\n + * {@link ARKUI_ERROR_CODE_PARAM_INVALID} component is nullptr or the type of node is not XComponent.\n + * @since 16 + */ +int32_t OH_ArkUI_XComponent_StopImageAnalyzer(ArkUI_NodeHandle node); + #ifdef __cplusplus }; #endif