openharmony 鸿蒙 ts-image-common

2025-06-12 浏览 (1)

Image Analysis Types

NOTE

The initial APIs of this module are supported since API version 12. Newly added APIs will be marked with a superscript to indicate their earliest API version.

ImageAnalyzerConfig

Provides AI analyzer configuration.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.ArkUI.ArkUI.Full

NameTypeMandatoryDescription
typesImageAnalyzerType[]YesAI analysis types.

ImageAnalyzerType

Defines the AI analysis type. If it is not set, subject recognition and text recognition are enabled by default.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.ArkUI.ArkUI.Full

NameValueDescription
SUBJECT0Subject recognition.
TEXT1Text recognition.
OBJECT_LOOKUP2Object lookup.

ImageAIOptions

Provides the AI analysis options.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.ArkUI.ArkUI.Full

NameTypeMandatoryDescription
typesImageAnalyzerType[]NoAI analysis types.
aiControllerImageAnalyzerControllerNoAI analysis controller.

NOTE

The types parameter of this API has a higher priority than that of ImageAnalyzerConfig. This means that, if both parameters are set, the value set by this API takes precedence.

This API depends on device capabilities and must be used together with the enableAnalyzer API of the corresponding component (for example, the Image component).

ImageAnalyzerController

Implements an ImageAnalyzerController object, which can be bound to a supported component and then call the supported method through the controller.

System capability: SystemCapability.ArkUI.ArkUI.Full

constructor

constructor()

A constructor used to create an ImageAnalyzerController instance.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.ArkUI.ArkUI.Full

getImageAnalyzerSupportTypes

getImageAnalyzerSupportTypes(): ImageAnalyzerType[]

Obtains the analysis types supported by the corresponding component.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.ArkUI.ArkUI.Full

Return value

TypeDescription
ImageAnalyzerType[]Analysis type supported by the corresponding component.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙ArcButton

harmony 鸿蒙ArcSlider

harmony 鸿蒙Chip

harmony 鸿蒙ChipGroup

harmony 鸿蒙ComposeListItem

harmony 鸿蒙ComposeTitleBar

harmony 鸿蒙advanced.Counter

harmony 鸿蒙Dialog Box (Dialog)

harmony 鸿蒙DialogV2

harmony 鸿蒙DownloadFileButton

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/i2oZ09