Interfaces (Others)

NOTE

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.

CameraDevice

Describes the camera device information.

System capability: SystemCapability.Multimedia.Camera.Core

Name Type Read-only Optional Description
cameraId string Yes No Camera ID.
Atomic service API: This API can be used in atomic services since API version 19.
cameraPosition CameraPosition Yes No Camera position.
Atomic service API: This API can be used in atomic services since API version 19.
cameraType CameraType Yes No Camera type.
Atomic service API: This API can be used in atomic services since API version 19.
connectionType ConnectionType Yes No Camera connection type.
Atomic service API: This API can be used in atomic services since API version 19.
cameraOrientation12+ number Yes No Camera installation angle, which does not change as the screen rotates. The value range is [0, 360], in degrees.
Atomic service API: This API can be used in atomic services since API version 19.
hostDeviceName15+ string Yes No Remote device name. If no remote device is available, an empty value is returned.
Atomic service API: This API can be used in atomic services since API version 19.
hostDeviceType15+ HostDeviceType Yes No Remote device type.
Atomic service API: This API can be used in atomic services since API version 19.
lensEquivalentFocalLength24+ Array<number> Yes Yes Equivalent focal length of the camera lens.
Atomic service API: This API can be used in atomic services since API version 24.
isLogicalCamera24+ boolean Yes Yes Whether a camera is a logical camera (consisting of multiple physical cameras). true if the camera is a logical camera, false otherwise.
Model constraint: This API can be used only in the stage model.
Atomic service API: This API can be used in atomic services since API version 24.
constituentCameraDevices24+ Array<CameraDevice> Yes Yes List of physical cameras that form the logical camera.
Model constraint: This API can be used only in the stage model.
Atomic service API: This API can be used in atomic services since API version 24.
lensFocalLength24+ number Yes Yes Actual focal length of the lens.
Model constraint: This API can be used only in the stage model.
Atomic service API: This API can be used in atomic services since API version 24.
minimumFocusDistance24+ number Yes Yes Minimum focus distance of the camera.
Model constraint: This API can be used only in the stage model.
Atomic service API: This API can be used in atomic services since API version 24.
lensDistortion24+ Array<number> Yes Yes Array of lens distortion parameters.
Model constraint: This API can be used only in the stage model.
Atomic service API: This API can be used in atomic services since API version 24.
lensIntrinsicCalibration24+ Array<number> Yes Yes Array of lens intrinsic calibration parameters.
Model constraint: This API can be used only in the stage model.
Atomic service API: This API can be used in atomic services since API version 24.
sensorPhysicalSize24+ Array<number> Yes Yes Physical dimensions (width and height) of the sensor.
Model constraint: This API can be used only in the stage model.
Atomic service API: This API can be used in atomic services since API version 24.
sensorPixelArraySize24+ Array<number> Yes Yes Pixel array dimensions (width and height, in pixels) of the sensor.
Model constraint: This API can be used only in the stage model.
Atomic service API: This API can be used in atomic services since API version 24.
sensorColorFilterArrangement24+ SensorColorFilterArrangement Yes Yes Arrangement mode of the sensor color filter.
Model constraint: This API can be used only in the stage model.
Atomic service API: This API can be used in atomic services since API version 24.

CameraStatusInfo

Describes the camera status information.

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

System capability: SystemCapability.Multimedia.Camera.Core

Name Type Read-only Optional Description
camera CameraDevice No No Camera device.
status CameraStatus No No Camera status.

FoldStatusInfo12+

Describes the fold state information about a foldable device.

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

System capability: SystemCapability.Multimedia.Camera.Core

Name Type Read-only Optional Description
supportedCameras Array<CameraDevice> Yes No List of cameras supported in the current fold state.
foldStatus FoldStatus Yes No Fold state.

Profile

Describes the camera profile.

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

System capability: SystemCapability.Multimedia.Camera.Core

Name Type Read-only Optional Description
format CameraFormat Yes No Output format.
size Size Yes No Resolution.
The size setting corresponds to the camera's resolution width and height, rather than the actual dimensions of the output image.

FrameRateRange

Describes the frame rate range.

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

System capability: SystemCapability.Multimedia.Camera.Core

Name Type Read-only Optional Description
min number Yes No Minimum frame rate, in frames per second (fps).
max number Yes No Maximum frame rate, in fps.

VideoProfile

Describes the video configuration information. It inherits from Profile.

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

System capability: SystemCapability.Multimedia.Camera.Core

Name Type Read-only Optional Description
frameRateRange FrameRateRange Yes No Frame rate range, in fps.

CameraOutputCapability

Describes the camera output capability.

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

System capability: SystemCapability.Multimedia.Camera.Core

Name Type Read-only Optional Description
previewProfiles Array<Profile> Yes No Supported preview profiles.
photoProfiles Array<Profile> Yes No Supported photo profiles.
videoProfiles Array<VideoProfile> Yes No Supported video profiles.
supportedMetadataObjectTypes Array<MetadataObjectType> Yes No Supported metadata object types.

TorchStatusInfo11+

Describes the flashlight status information.

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

System capability: SystemCapability.Multimedia.Camera.Core

Name Type Read-only Optional Description
isTorchAvailable boolean Yes No Whether the flashlight is available. true if available, false otherwise.
isTorchActive boolean Yes No Whether the flashlight is activated. true if activated, false otherwise.
torchLevel number Yes No Flashlight brightness level. The value range is [0, 1]. A larger value indicates a greater luminance.

Size

Describes the image dimensions.

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

System capability: SystemCapability.Multimedia.Camera.Core

Name Type Read-only Optional Description
height number No No Image height, in pixels.
width number No No Image width, in pixels.

Point

Describes the point coordinates, which are used for focus and exposure configuration.

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

System capability: SystemCapability.Multimedia.Camera.Core

Name Type Read-only Optional Description
x number No No X coordinate of a point.
y number No No Y coordinate of a point.

CameraConcurrentInfo18+

Describes the camera's concurrency information.

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

System capability: SystemCapability.Multimedia.Camera.Core

Name Type Read-only Optional Description
device CameraDevice Yes No Concurrent camera device.
type CameraConcurrentType Yes No Concurrency type.
modes Array<SceneMode > Yes No Scene mode.
outputCapabilities Array<CameraOutputCapability > Yes No Output capabilities of the camera.

Location

Describes the geolocation information.

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

System capability: SystemCapability.Multimedia.Camera.Core

Name Type Read-only Optional Description
latitude number No No Latitude, in degrees, within the range [–90, 90].
longitude number No No Longitude, in degrees, within the range [–180, 180].
altitude number No No Altitude, in meters.

PhotoCaptureSetting

Describes the settings for taking an image.

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

System capability: SystemCapability.Multimedia.Camera.Core

Name Type Read-only Optional Description
quality QualityLevel No Yes Image quality (low by default).
rotation ImageRotation No Yes Rotation angle of the image. The default value is 0, indicating clockwise rotation.
location Location No Yes Geolocation information of the image (depending on the device hardware information by default).
mirror boolean No Yes Whether mirror photography is enabled (disabled by default). Before using this enumerated value, call isMirrorSupported to check whether mirror photography is supported. true if enabled, false otherwise.

FrameShutterInfo

Describes the frame shutter information.

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

System capability: SystemCapability.Multimedia.Camera.Core

Name Type Read-only Optional Description
captureId number No No ID of this capture action.
timestamp number No No Timestamp of the shutter, in milliseconds.

FrameShutterEndInfo12+

Describes the frame shutter end information during capture.

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

System capability: SystemCapability.Multimedia.Camera.Core

Name Type Read-only Optional Description
captureId number No No ID of this capture action.

CaptureStartInfo11+

Describes the capture start information.

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

System capability: SystemCapability.Multimedia.Camera.Core

Name Type Read-only Optional Description
captureId number No No ID of this capture action.
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.

CaptureEndInfo

Describes the capture end information.

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

System capability: SystemCapability.Multimedia.Camera.Core

Name Type Read-only Optional Description
captureId number No No ID of this capture action.
frameCount number No No Number of frames captured.

AutoDeviceSwitchStatus13+

Describes the information about the automatic camera switch status.

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

System capability: SystemCapability.Multimedia.Camera.Core

Name Type Read-only Optional Description
isDeviceSwitched boolean Yes No Whether the camera is automatically switched. true if auto-switched, false otherwise.
isDeviceCapabilityChanged boolean Yes No Whether the camera capability is changed after the camera is automatically switched. true if changed, false otherwise.

Rect

Describes a rectangle. The coordinate system for the returned detection points is based on the landscape device orientation, with the charging port on the right. In this coordinate system, the top-left corner is (0, 0), and the bottom-right corner is (1, 1). Here, topLeftX and topLeftY represent the coordinates of the top-left corner of the rectangle, whereas width and height represent the width and height of the rectangle, respectively. When cropping or selecting a face region based on specific requirements, the x and y coordinates of the rectangle must be multiplied by the width and height of the actual camera preview output stream to obtain the cropped face region.

The width and height of the actual preview stream refer to the resolution of the camera output stream. For details, see size in profile.

For details about how to obtain the preview stream data, see Dual-Channel Preview (ArkTS).

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

System capability: SystemCapability.Multimedia.Camera.Core

Name Type Read-only Optional Description
topLeftX number No No X coordinate of the top-left corner of the rectangle, in the range of [0, 1].
topLeftY number No No Y coordinate of the top-left corner of the rectangle, in the range of [0, 1].
width number No No Width of the rectangle, in the range of [0, 1].
height number No No Height of the rectangle, in the range of [0, 1].

MetadataObject

Describes the camera metadata, which is the data source of CameraInput. The metadata is obtained through metadataOutput.on('metadataObjectsAvailable').

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

System capability: SystemCapability.Multimedia.Camera.Core

Name Type Read-only Optional Description
type MetadataObjectType Yes No Metadata object type.
timestamp number Yes No Current timestamp, in nanoseconds (ns).
boundingBox Rect Yes No Metadata rectangle.

SmoothZoomInfo11+

Describes the smooth zoom information.

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

System capability: SystemCapability.Multimedia.Camera.Core

Name Type Read-only Optional Description
duration number No No Total duration of smooth zoom, in milliseconds.

ControlCenterStatusInfo20+

Describes the effect status information of a camera controller.

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

System capability: SystemCapability.Multimedia.Camera.Core

Name Type Read-only Optional Description
effectType ControlCenterEffectType Yes No Effect type of the camera controller.
isActive boolean Yes No Whether the camera controller is activated. true if activated, false otherwise.

IsoInfo22+

Describes the information about the sensitivity (ISO) settings.

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

System capability: SystemCapability.Multimedia.Camera.Core

Name Type Read-only Optional Description
iso number Yes Yes ISO.

CameraOcclusionDetectionResult23+

Describes the instance returned by the occlusion status callback, which indicates whether the camera lens is blocked or dirty.

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

System capability: SystemCapability.Multimedia.Camera.Core

Name Type Read-only Optional Description
isCameraOccluded boolean Yes No Whether the camera lens is blocked. true if blocked, false otherwise.
isCameraLensDirty boolean Yes No Whether the camera lens is dirty. true if dirty, false otherwise.

ZoomRange24+

Describes the zoom range.

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

System capability: SystemCapability.Multimedia.Camera.Core

Name Type Read-only Optional Description
min number Yes No Minimum zoom value.
max number Yes No Maximum zoom value.

PhysicalAperture24+

Describes the physical aperture object.

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

System capability: SystemCapability.Multimedia.Camera.Core

Name Type Read-only Optional Description
zoomRange ZoomRange No No Zoom range of a given physical aperture.
apertures Array<number> No No Supported physical aperture.

ExposureInfo24+

Describes the exposure information object.

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

System capability: SystemCapability.Multimedia.Camera.Core

Name Type Read-only Optional Description
exposureTime number Yes Yes Exposure time, in microseconds.