openharmony 鸿蒙 arkts-apis-camera-e

2026-08-25 浏览 (1)

Enums

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.

CameraPosition

Enumerates the camera positions.

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

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
CAMERA_POSITION_UNSPECIFIED0A camera that does not have a fixed orientation relative to the device screen.
CAMERA_POSITION_BACK1Rear camera.
CAMERA_POSITION_FRONT2Front camera.
CAMERA_POSITION_FOLD_INNER(deprecated)3Folded camera.
This API is supported since API version 11 and deprecated since API version 12.

CameraType

Enumerates the camera types.

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

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
CAMERA_TYPE_DEFAULT0Default camera type.
CAMERA_TYPE_WIDE_ANGLE1Wide camera.
CAMERA_TYPE_ULTRA_WIDE2Ultra-wide camera.
CAMERA_TYPE_TELEPHOTO3Telephoto camera.
CAMERA_TYPE_TRUE_DEPTH4Camera with depth of field information.

ConnectionType

Enumerates the camera connection types.

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

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
CAMERA_CONNECTION_BUILT_IN0Built-in camera.
CAMERA_CONNECTION_USB_PLUGIN1Camera connected using USB.
CAMERA_CONNECTION_REMOTE2Remote camera.

HostDeviceType15+

Enumerates the remote camera types.

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

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
UNKNOWN_TYPE0Unknown type.
PHONE0x0EMobile phone.
TABLET0x11Tablet.

CameraStatus

Enumerates the camera statuses.

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

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
CAMERA_STATUS_APPEAR0A camera appears.
CAMERA_STATUS_DISAPPEAR1The camera disappears.
CAMERA_STATUS_AVAILABLE2The camera is available.
CAMERA_STATUS_UNAVAILABLE3The camera is unavailable.

FoldStatus12+

Enumerates the fold states available for a fordable device.

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

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
NON_FOLDABLE0The device is not foldable.
EXPANDED1The device is fully unfolded.
FOLDED2The device is folded.

SceneMode11+

Enumerates the camera scene modes.

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

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
NORMAL_PHOTO1Normal photo mode. For details, see PhotoSession.
NORMAL_VIDEO2Normal record mode. For details, see VideoSession.
SECURE_PHOTO12+12Secure mode. For details, see SecureSession.

CameraErrorCode

Enumerates the camera error codes,

which are returned when an API call is incorrect or the on() API is used to listen for the error status.

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
INVALID_ARGUMENT7400101A parameter is missing or the parameter type is incorrect.
Atomic service API: This API can be used in atomic services since API version 19.
OPERATION_NOT_ALLOWED7400102The operation is not allowed.
Atomic service API: This API can be used in atomic services since API version 19.
SESSION_NOT_CONFIG7400103The session is not configured.
Atomic service API: This API can be used in atomic services since API version 19.
SESSION_NOT_RUNNING7400104The session is not running.
Atomic service API: This API can be used in atomic services since API version 19.
SESSION_CONFIG_LOCKED7400105The session configuration is locked.
Atomic service API: This API can be used in atomic services since API version 19.
DEVICE_SETTING_LOCKED7400106The device setting is locked.
Atomic service API: This API can be used in atomic services since API version 19.
CONFLICT_CAMERA7400107The device is already started.
Atomic service API: This API can be used in atomic services since API version 19.
DEVICE_DISABLED7400108The camera is disabled for security reasons.
Atomic service API: This API can be used in atomic services since API version 19.
DEVICE_PREEMPTED7400109The camera is preempted.
Atomic service API: This API can be used in atomic services since API version 19.
UNRESOLVED_CONFLICTS_WITH_CURRENT_CONFIGURATIONS12+7400110The configuration conflicts with the current configuration.
Atomic service API: This API can be used in atomic services since API version 19.
SERVICE_FATAL_ERROR7400201The camera service is abnormal.
Atomic service API: This API can be used in atomic services since API version 19.

TorchMode11+

Enumerates the flashlight modes.

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

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
OFF0The flashlight is off.
ON1The flashlight is on.
AUTO2The system automatically adjusts the flashlight brightness according to the environment.

CameraFormat

Enumerates the camera output formats.

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

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
CAMERA_FORMAT_RGBA_88883RGBA_8888 image.
CAMERA_FORMAT_YUV_420_SP1003YUV_420_SP image, which corresponds to the NV21 image.
CAMERA_FORMAT_JPEG2000JPEG image.
CAMERA_FORMAT_YCBCR_P01011+2001YCBCR_P010 image.
CAMERA_FORMAT_YCRCB_P01011+2002YCRCB_P010 image.
CAMERA_FORMAT_HEIC13+2003HEIF image.
CAMERA_FORMAT_DNG24+4Digital Negative (DNG) image.
Atomic service API: This API can be used in atomic services since API version 24.

VideoCodecType13+

Enumerates the video codec types.

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

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
AVC0AVC.
HEVC1HEVC.

CameraConcurrentType18+

Enumerates the camera concurrency types.

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

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
CAMERA_LIMITED_CAPABILITY0Limited camera concurrency.
CAMERA_FULL_CAPABILITY1Full camera concurrency.

ImageRotation

Enumerates the image rotation angles.

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

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
ROTATION_00The image rotates 0 degrees.
ROTATION_9090The image rotates 90 degrees.
ROTATION_180180The image rotates 180 degrees.
ROTATION_270270The image rotates 270 degrees.

QualityLevel

Enumerates the image quality levels.

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

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
QUALITY_LEVEL_HIGH0High image quality.
QUALITY_LEVEL_MEDIUM1Medium image quality.
QUALITY_LEVEL_LOW2Low image quality.

MetadataObjectType

Enumerates the metadata object types.

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
FACE_DETECTION0Metadata object used for face detection.
Atomic service API: This API can be used in atomic services since API version 19.
HUMAN_BODY23+1Metadata object used for body detection.
Atomic service API: This API can be used in atomic services since API version 23.

FlashMode

Enumerates the flash modes.

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

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
FLASH_MODE_CLOSE0The flash is off.
FLASH_MODE_OPEN1The flash is on.
FLASH_MODE_AUTO2The flash mode is auto, indicating that the flash fires automatically depending on the photo capture conditions.
FLASH_MODE_ALWAYS_OPEN3The flash is steady on.

ExposureMode

Enumerates the exposure modes.

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
EXPOSURE_MODE_UNSPECIFIED24+-1Unspecified exposure.
Model restriction: 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.
EXPOSURE_MODE_LOCKED0Exposure locked. The metering point cannot be set.
After this mode is used, the exposure will be locked by default for each photo capture.
Atomic service API: This API can be used in atomic services since API version 19.
EXPOSURE_MODE_AUTO1Auto exposure. The metering point can be set by calling AutoExposure.setMeteringPoint.
After this mode is used, it takes effect only for the first photo capture.
Atomic service API: This API can be used in atomic services since API version 19.
EXPOSURE_MODE_CONTINUOUS_AUTO2Continuous auto exposure. The metering point cannot be set.
After this mode is used, the camera system automatically adjusts the exposure based on the environment changes each time.
Atomic service API: This API can be used in atomic services since API version 19.
EXPOSURE_MODE_MANUAL3Manual exposure. The exposure duration can be set.
In this mode, you can set the exposure duration by calling ManualExposure.setExposureDuration.
Atomic service API: This API can be used in atomic services since API version 24.

FocusMode

Enumerates the focus modes.

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

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
FOCUS_MODE_MANUAL0Manual focus. The focal length of the camera can be manually set to change the focus position. However, the focal point cannot be set.
FOCUS_MODE_CONTINUOUS_AUTO1Continuous auto focus. The focal point cannot be set.
FOCUS_MODE_AUTO2Auto focus. The focal point can be set by calling Focus.setFocusPoint, and auto focus is performed once based on the focal point.
FOCUS_MODE_LOCKED3Focus locked. The focal point cannot be set.

FocusState

Enumerates the focus states.

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

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
FOCUS_STATE_SCAN0Focusing.
FOCUS_STATE_FOCUSED1Focused.
FOCUS_STATE_UNFOCUSED2Unfocused.

VideoStabilizationMode

Enumerates the video stabilization modes.

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

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
OFF0Video stabilization is disabled.
LOW1The basic video stabilization algorithm is used.
MIDDLE2A video stabilization algorithm with a stabilization effect better than that of the LOW type is used.
HIGH3A video stabilization algorithm with a stabilization effect better than that of the MIDDLE type is used.
AUTO4The system automatically selects a video stabilization algorithm.

SmoothZoomMode11+

Enumerates the smooth zoom modes.

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

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
NORMAL0Bessel curve mode.

PreconfigType12+

Enumerates the preconfigured resolution types.

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
PRECONFIG_720P0720p resolution.
Atomic service API: This API can be used in atomic services since API version 19.
PRECONFIG_1080P11080p resolution.
Atomic service API: This API can be used in atomic services since API version 19.
PRECONFIG_4K24K resolution.
Atomic service API: This API can be used in atomic services since API version 19.
PRECONFIG_HIGH_QUALITY3High-quality resolution.
Atomic service API: This API can be used in atomic services since API version 19.
PRECONFIG_HIGH_QUALITY_PHOTOSESSION_BT202023+4Resolution that supports HDR preview and GIF photography.
Model restriction: This API can be used only in the stage model.
Atomic service API: This API can be used in atomic services since API version 23.

PreconfigRatio12+

Enumerates the preconfigured aspect ratios.

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

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
PRECONFIG_RATIO_1_101:1 aspect ratio.
PRECONFIG_RATIO_4_314:3 aspect ratio.
PRECONFIG_RATIO_16_9216:9 aspect ratio.

QualityPrioritization14+

Enumerates the priority levels for video recording quality.

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

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
HIGH_QUALITY0Prioritizes high-quality video recording.
POWER_BALANCE1Prioritizes video recording quality while balancing power consumption.

WhiteBalanceMode20+

Enumerates the white balance modes.

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

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
AUTO0Automatic.
CLOUDY1Cloudy.
INCANDESCENT2Incandescent light.
FLUORESCENT3Fluorescence light.
DAYLIGHT4Daylight.
MANUAL5Manual.
LOCKED6Locked.

SystemPressureLevel20+

Enumerates the system pressure levels.

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

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
SYSTEM_PRESSURE_NORMAL0The system pressure is normal.
SYSTEM_PRESSURE_MILD1The system pressure is elevated but not actively managed by the system.
SYSTEM_PRESSURE_SEVERE2The system pressure may affect the overall image quality and performance.
SYSTEM_PRESSURE_CRITICAL3The system pressure has a significant impact on the image quality and performance.
SYSTEM_PRESSURE_SHUTDOWN4The system pressure is too high, causing the system to shut down.

ControlCenterEffectType20+

Enumerates the effect types supported by the camera controller.

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
BEAUTY0Beauty effect.
Atomic service API: This API can be used in atomic services since API version 20.
PORTRAIT1Portrait blur effect.
Atomic service API: This API can be used in atomic services since API version 20.
AUTO_FRAMING24+2Auto focus.
Atomic service API: This API can be used in atomic services since API version 24.

PhotoQualityPrioritization21+

Enumerates the photo quality prioritization strategies.

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

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
HIGH_QUALITY0Focuses on image quality, which may increase the time required for capturing photos to ensure high-quality output.
SPEED1Focuses on performance, trading off image quality for faster capture times.

SensorColorFilterArrangement24+

Enumerates the arrangement modes of the sensor color filter.

Model restriction: 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.

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
BGGR0Blue-green-green-red filter arrangement.
GBRG1Green-blue-red-green filter arrangement.
GRBG2Green-red-blue-green arrangement mode.
RGGB3Red-green-green-blue arrangement mode.

FlashState24+

Enumerates the flash states.

Model restriction: 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.

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
FLASH_STATE_UNAVAILABLE0The flash is unavailable. This is the default value.
FLASH_STATE_READY1The flash is available.
FLASH_STATE_FLASHING2The flash is turned on.

ExposureMeteringMode24+

Enumerates the exposure metering modes.

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

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
MATRIX0Matrix metering mode. A wide area of the screen is selected, which is ideal for shooting natural landscapes.
CENTER1Center-weighted metering mode. Metering is performed on the entire image, with the center allocated with the maximum weight, which is ideal for shooting portraits.
SPOT2Spot metering mode. Metering is performed around 2.5% of the metering points, focusing on the light in a specific small area, such as the eyes of the subject.

OISMode24+

Enumerates the optical image stabilization (OIS) mode.

Model restriction: 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.

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
OFF0OIS is disabled.
AUTO1OIS is automatically controlled.
CUSTOM2OIS is controlled by the application.

OISAxes24+

Enumerates the OIS axes.

Model restriction: 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.

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
PITCH0Pitch axis. It controls the up-down rotation of the camera body, that is, the camera body rotates around the axis horizontal to the lens.
YAW1Yaw axis. It controls the left-right rotation of the camera body, that is, the camera body rotates around the axis perpendicular to the lens.

ExposureState

Enumerates the exposure states.

Since: 26.0.0

Model restriction: This API can be used only in the stage model.

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

System capability: SystemCapability.Multimedia.Camera.Core

NameValueDescription
EXPOSURE_STATE_SCAN0Focusing.
EXPOSURE_STATE_CONVERGED1Exposure converged.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 capi-oh-camera-capturesession-callbacks

openharmony 鸿蒙 arkts-apis-camera-OIS

openharmony 鸿蒙 capi-oh-camera-camera-devicequeryinfo

openharmony 鸿蒙 capi-oh-camera-camera-frameraterange

openharmony 鸿蒙 capi-oh-camera-camera-outputcapability

openharmony 鸿蒙 arkts-apis-camera-Photo

openharmony 鸿蒙 capi-oh-camera-camera-profile

openharmony 鸿蒙 capi-oh-camera-camera-manager

openharmony 鸿蒙 capi-oh-camera-previewoutput-callbacks

openharmony 鸿蒙 arkts-apis-camera-ManualExposureQuery

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