• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Interfaces (Others)
2<!--Kit: Camera Kit-->
3<!--Subsystem: Multimedia-->
4<!--Owner: @qano-->
5<!--SE: @leo_ysl-->
6<!--TSE: @xchaosioda-->
7
8> **NOTE**
9>
10> The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
11
12## CameraDevice
13
14Describes the camera device information.
15
16**Atomic service API**: This API can be used in atomic services since API version 19.
17
18**System capability**: SystemCapability.Multimedia.Camera.Core
19
20| Name                             | Type                                 | Read-only| Optional| Description       |
21|---------------------------------|-------------------------------------| ---- |----|---------- |
22| cameraId                        | string                              | Yes  | No | Camera ID.|
23| cameraPosition                  | [CameraPosition](arkts-apis-camera-e.md#cameraposition)   | Yes  | No | Camera position.   |
24| cameraType                      | [CameraType](arkts-apis-camera-e.md#cameratype)           | Yes  | No | Camera type.   |
25| connectionType                  | [ConnectionType](arkts-apis-camera-e.md#connectiontype)   | Yes  | No | Camera connection type.|
26| cameraOrientation<sup>12+</sup> | number                              | Yes  | No | Camera installation angle, which does not change as the screen rotates. The value ranges from 0° to 360°, measured in degrees.|
27| hostDeviceName<sup>15+</sup>    | string                              | Yes  | No | Remote device name.|
28| hostDeviceType<sup>15+</sup>    | [HostDeviceType](arkts-apis-camera-e.md#hostdevicetype15) | Yes  | No | Remote device type.|
29
30## CameraStatusInfo
31
32Describes the camera status information.
33
34**Atomic service API**: This API can be used in atomic services since API version 19.
35
36**System capability**: SystemCapability.Multimedia.Camera.Core
37
38| Name  | Type                          |    Read-only  |     Optional    | Description      |
39| ------ | ----------------------------- | --------- |------------ | ---------- |
40| camera | [CameraDevice](arkts-apis-camera-i.md#cameradevice) |     No   |       No    | Camera device.|
41| status | [CameraStatus](arkts-apis-camera-e.md#camerastatus) |     No   |       No    | Camera status.|
42
43## FoldStatusInfo<sup>12+</sup>
44
45Describes the fold state information about a foldable device.
46
47**Atomic service API**: This API can be used in atomic services since API version 19.
48
49**System capability**: SystemCapability.Multimedia.Camera.Core
50
51| Name  | Type                          |    Read-only  |     Optional    | Description      |
52| ------ | ----------------------------- | --------- |------------ | ---------- |
53| supportedCameras | [Array<CameraDevice\>](arkts-apis-camera-i.md#cameradevice) |     Yes   |       No    | List of cameras supported in the current fold state.|
54| foldStatus | [FoldStatus](arkts-apis-camera-e.md#foldstatus12) |     Yes   |       No    | Fold state.|
55
56## Profile
57
58Describes the camera profile.
59
60**Atomic service API**: This API can be used in atomic services since API version 19.
61
62**System capability**: SystemCapability.Multimedia.Camera.Core
63
64| Name     | Type                         | Read-only| Optional| Description        |
65| -------- | ----------------------------- |---- | ---- | ------------- |
66| format   | [CameraFormat](arkts-apis-camera-e.md#cameraformat) | Yes |  No | Output format.     |
67| size     | [Size](#size)                 | Yes |  No | Resolution.<br>The size setting corresponds to the camera's resolution width and height, rather than the actual dimensions of the output image. |
68
69## FrameRateRange
70
71Describes the frame rate range.
72
73**Atomic service API**: This API can be used in atomic services since API version 19.
74
75**System capability**: SystemCapability.Multimedia.Camera.Core
76
77| Name     | Type                         | Read-only| Optional| Description           |
78| -------- | ----------------------------- |----- |---| -------------- |
79| min      | number                        |  Yes | No| Minimum frame rate.     |
80| max      | number                        |  Yes | No| Maximum frame rate.     |
81
82## VideoProfile
83
84Describes the video configuration information. It inherits from [Profile](#profile).
85
86**Atomic service API**: This API can be used in atomic services since API version 19.
87
88**System capability**: SystemCapability.Multimedia.Camera.Core
89
90| Name                      | Type                                     | Read-only| Optional| Description       |
91| ------------------------- | ----------------------------------------- | --- | ---- |----------- |
92| frameRateRange            | [FrameRateRange](arkts-apis-camera-i.md#frameraterange)         | Yes |  No | Frame rate range, in units of frames per second (FPS).|
93
94## CameraOutputCapability
95
96Describes the camera output capability.
97
98**Atomic service API**: This API can be used in atomic services since API version 19.
99
100**System capability**: SystemCapability.Multimedia.Camera.Core
101
102| Name                          | Type                                               | Read-only| Optional| Description               |
103| ----------------------------- | --------------------------------------------------- | ---- | ---- |-------------------|
104| previewProfiles               | Array\<[Profile](#profile)\>                        |  Yes | No| Supported preview profiles.     |
105| photoProfiles                 | Array\<[Profile](#profile)\>                        |  Yes | No| Supported photo profiles.       |
106| videoProfiles                 | Array\<[VideoProfile](#videoprofile)\>              |  Yes | No| Supported video profiles.       |
107| supportedMetadataObjectTypes  | Array\<[MetadataObjectType](arkts-apis-camera-e.md#metadataobjecttype)\>  |  Yes | No| Supported metadata object types.|
108
109## TorchStatusInfo<sup>11+</sup>
110
111Describes the flashlight status information.
112
113**Atomic service API**: This API can be used in atomic services since API version 19.
114
115**System capability**: SystemCapability.Multimedia.Camera.Core
116
117| Name             | Type      | Read-only| Optional| Description       |
118| ---------------- | ---------- | ---- | ---- | ----------- |
119| isTorchAvailable | boolean    | Yes  | No  | Whether the flashlight is available. **true** if available, **false** otherwise.|
120| isTorchActive    | boolean    | Yes  | No  | Whether the flashlight is activated. **true** if activated, **false** otherwise.|
121| torchLevel       | number     | Yes  | No  | Flashlight brightness level. The value range is [0, 1]. A larger value indicates a greater luminance. |
122
123## Size
124
125Describes the output capability.
126
127**Atomic service API**: This API can be used in atomic services since API version 19.
128
129**System capability**: SystemCapability.Multimedia.Camera.Core
130
131| Name  | Type   | Read-only| Optional | Description        |
132| ------ | ------ | ---- |-----| ------------ |
133| height | number | No  | No  | Image height, in pixels.|
134| width  | number | No  | No  | Image width, in pixels.|
135
136## Point
137
138Describes the point coordinates, which are used for focus and exposure configuration.
139
140**Atomic service API**: This API can be used in atomic services since API version 19.
141
142**System capability**: SystemCapability.Multimedia.Camera.Core
143
144| Name   | Type  | Read-only  | Optional  | Description        |
145| ------ | ------ | ------ | ------ | ------------ |
146| x      | number | No    | No    | X coordinate of a point.  |
147| y      | number | No    | No    | Y coordinate of a point.  |
148
149## CameraConcurrentInfo<sup>18+</sup>
150
151Describes the camera's concurrency information.
152
153**Atomic service API**: This API can be used in atomic services since API version 19.
154
155**System capability**: SystemCapability.Multimedia.Camera.Core
156
157| Name  | Type   | Read-only| Optional | Description        |
158| ------ | ------ |----|-----| ------------ |
159| device              | [CameraDevice](arkts-apis-camera-i.md#cameradevice)   | Yes | No  | Concurrent camera device.|
160| type                | [CameraConcurrentType](arkts-apis-camera-e.md#cameraconcurrenttype18)  | Yes | No  | Concurrency type.|
161| modes               | Array\<[SceneMode](arkts-apis-camera-e.md#scenemode11) \>              | Yes | No  | Scene mode.|
162| outputCapabilities  | Array\<[CameraOutputCapability](#cameraoutputcapability) \> | Yes | No  | Output capabilities of the camera.|
163
164## Location
165
166Describes the geolocation information.
167
168**Atomic service API**: This API can be used in atomic services since API version 19.
169
170**System capability**: SystemCapability.Multimedia.Camera.Core
171
172| Name         | Type  | Read-only| Optional |Description        |
173| ------------ | ------ | ---- |-----|------------ |
174| latitude     | number |  No | No  |Latitude, in degrees.   |
175| longitude    | number |  No | No  |Longitude, in degrees.   |
176| altitude     | number |  No | No  |Altitude, in meters.   |
177
178## PhotoCaptureSetting
179
180Describes the settings for taking an image.
181
182**Atomic service API**: This API can be used in atomic services since API version 19.
183
184**System capability**: SystemCapability.Multimedia.Camera.Core
185
186| Name     | Type                           | Read-only| Optional| Description                                                                                                                          |
187| -------- | ------------------------------- | ---- | ---- |------------------------------------------------------------------------------------------------------------------------------|
188| quality  | [QualityLevel](arkts-apis-camera-e.md#qualitylevel)   | No  | Yes  | Image quality (low by default).                                                                                                                  |
189| rotation | [ImageRotation](arkts-apis-camera-e.md#imagerotation) | No  | Yes  | Rotation angle of the image. The default value is **0**, indicating clockwise rotation.                                                                                                         |
190| location | [Location](#location)           | No  | Yes  | Geolocation information of the image (depending on the device hardware information by default).                                                                                                      |
191| mirror   | boolean                         | No  | Yes  | Whether mirror photography is enabled (disabled by default). Before using this enumerated value, call [isMirrorSupported](arkts-apis-camera-PhotoOutput.md#ismirrorsupported) to check whether mirror photography is supported. **true** if enabled, **false** otherwise.|
192
193## FrameShutterInfo
194
195Describes the frame shutter information.
196
197**Atomic service API**: This API can be used in atomic services since API version 19.
198
199**System capability**: SystemCapability.Multimedia.Camera.Core
200
201| Name      | Type  | Read-only| Optional| Description       |
202| --------- | ------ | ---- | ---- | ---------- |
203| captureId | number | No  | No  | ID of this capture action.|
204| timestamp | number | No  | No  | Timestamp when the frame shutter event is triggered.|
205
206## FrameShutterEndInfo<sup>12+</sup>
207
208Describes the frame shutter end information during capture.
209
210**Atomic service API**: This API can be used in atomic services since API version 19.
211
212**System capability**: SystemCapability.Multimedia.Camera.Core
213
214| Name     | Type  | Read-only| Optional| Description      |
215| --------- | ------ | ---- | ---- | ---------- |
216| captureId | number | No  | No  | ID of this capture action.|
217
218## CaptureStartInfo<sup>11+</sup>
219
220Describes the capture start information.
221
222**Atomic service API**: This API can be used in atomic services since API version 19.
223
224**System capability**: SystemCapability.Multimedia.Camera.Core
225
226| Name      | Type   | Read-only| Optional| Description      |
227| ---------- | ------ | ---- | ---- | --------- |
228| captureId  | number | No  | No  | ID of this capture action.|
229| time       | number | No  | No  | Estimated duration when the sensor captures frames at the bottom layer in a single capture. If **–1** is reported, there is no estimated duration.   |
230
231## CaptureEndInfo
232
233Describes the capture end information.
234
235**Atomic service API**: This API can be used in atomic services since API version 19.
236
237**System capability**: SystemCapability.Multimedia.Camera.Core
238
239| Name      | Type   | Read-only| Optional| Description      |
240| ---------- | ------ | ---- | ---- | ---------|
241| captureId  | number | No  | No  | ID of this capture action.|
242| frameCount | number | No  | No  | Number of frames captured.|
243
244## AutoDeviceSwitchStatus<sup>13+</sup>
245
246Describes the information about the automatic camera switch status.
247
248**Atomic service API**: This API can be used in atomic services since API version 19.
249
250**System capability**: SystemCapability.Multimedia.Camera.Core
251
252| Name      | Type     | Read-only| Optional| Description                     |
253| ---------- |---------| ---- | ---- |-------------------------|
254| isDeviceSwitched  | boolean | Yes  | No  | Whether the camera is automatically switched. **true** if auto-switched, **false** otherwise.      |
255| isDeviceCapabilityChanged | boolean  | Yes  | No  | Whether the camera capability is changed after the camera is automatically switched. **true** if changed, **false** otherwise.|
256
257## Rect
258
259Describes a rectangle.
260
261**Atomic service API**: This API can be used in atomic services since API version 19.
262
263**System capability**: SystemCapability.Multimedia.Camera.Core
264
265| Name     | Type  |  Read-only | Optional |           Description        |
266| -------- | ------ | ------ |-----| --------------------- |
267| topLeftX | number |   No  | No  | X-axis coordinate of the upper left corner of the rectangle.  |
268| topLeftY | number |   No  | No  | Y-axis coordinate of the upper left corner of the rectangle.  |
269| width    | number |   No  | No  | Width of the rectangle, which is a relative value. The value range is [0, 1]. |
270| height   | number |   No  | No  | Height of the rectangle, which is a relative value. The value range is [0, 1]. |
271
272## MetadataObject
273
274Describes the camera metadata, which is the data source of [CameraInput](arkts-apis-camera-CameraInput.md). The metadata is obtained through metadataOutput.on('metadataObjectsAvailable').
275
276**Atomic service API**: This API can be used in atomic services since API version 19.
277
278**System capability**: SystemCapability.Multimedia.Camera.Core
279
280| Name        | Type                                       | Read-only| Optional|Description               |
281| ----------- | ------------------------------------------- | ---- | ---- | ----------------- |
282| type        | [MetadataObjectType](arkts-apis-camera-e.md#metadataobjecttype)   |  Yes |  No | Metadata object type.   |
283| timestamp   | number                                      |  Yes |  No | Current timestamp, in milliseconds.|
284| boundingBox | [Rect](#rect)                               |  Yes |  No | Metadata rectangle. |
285
286## SmoothZoomInfo<sup>11+</sup>
287
288Describes the smooth zoom information.
289
290**Atomic service API**: This API can be used in atomic services since API version 19.
291
292**System capability**: SystemCapability.Multimedia.Camera.Core
293
294| Name    | Type       |   Read-only  |   Optional  | Description      |
295| -------- | ---------- | -------- | -------- | ---------- |
296| duration |   number   |   No    |    No   | Total duration of smooth zoom, in ms.|
297
298## ControlCenterStatusInfo<sup>20+</sup>
299
300Describes the effect status information of a camera controller.
301
302**Atomic service API**: This API can be used in atomic services since API version 20.
303
304**System capability**: SystemCapability.Multimedia.Camera.Core
305
306| Name    | Type       |   Read-only  |   Optional  | Description      |
307| -------- | ---------- | -------- | -------- | ---------- |
308| effectType | [ControlCenterEffectType](arkts-apis-camera-e.md#controlcentereffecttype20) |   Yes   |    No   | Effect type of the camera controller.|
309| isActive | boolean | Yes| No| Whether the camera controller is activated. **true** if activated, **false** otherwise.|
310