openharmony 鸿蒙 arkts-apis-camera-OISQuery

2026-08-25 浏览 (1)

Interface (OISQuery)

This module describes the optical image stabilization (OIS) query object.

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.
  • The initial APIs of this interface are supported since API version 24.

Modules to Import

import { camera } from '@kit.CameraKit';

isOISModeSupported24+

isOISModeSupported(mode: OISMode): boolean

Checks whether the specified OIS mode is supported.

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

Parameters

ParameterTypeMandatoryDescription
modeOISModeYesOIS mode.

Returns

TypeDescription
booleanWhether the device supports the specified OIS mode. The value true indicates the specified OIS mode is supported, and the value false indicates the opposite.

Error Codes

For details about the error codes, see Camera Error Codes.

Error CodeError Message
7400102Operation not allowed, the inputDevice or the session is abnormal.
7400103Session not config.

Example

import { BusinessError } from '@kit.BasicServicesKit';

function isOISModeSupported(photoSession: camera.PhotoSession, mode: camera.OISMode): boolean {
  let isSupported = false;
  try {
    isSupported = photoSession.isOISModeSupported(mode);
  } catch (error) {
    let err = error as BusinessError;
    console.error(`The isOISModeSupported call failed. error code: ${err.code}`);
  }
  return isSupported;
}

getSupportedOISBiasRange24+

getSupportedOISBiasRange(oisAxis: OISAxes): Array<number>

Obtains the supported bias range on the specified OIS axis.

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

Parameters

ParameterTypeMandatoryDescription
oisAxisOISAxesYesOIS axis.

Returns

TypeDescription
Array<number>Bias range.

Error Codes

For details about the error codes, see Camera Error Codes.

Error CodeError Message
7400102Operation not allowed, the inputDevice or the session is abnormal.
7400103Session not config.

Example

import { BusinessError } from '@kit.BasicServicesKit';

function getSupportedOISBiasRange(photoSession: camera.PhotoSession, oisAxis: camera.OISAxes): Array<number> {
  let biasRange: Array<number> = [];
  try {
    biasRange = photoSession.getSupportedOISBiasRange(oisAxis);
  } catch (error) {
    let err = error as BusinessError;
    console.error(`The getSupportedOISBiasRange call failed. error code: ${err.code}`);
  }
  return biasRange;
}

getSupportedOISBiasStep24+

getSupportedOISBiasStep(oisAxis: OISAxes): number

Obtains the bias step on the specified OIS axis.

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

Parameters

ParameterTypeMandatoryDescription
oisAxisOISAxesYesOIS axis.

Returns

TypeDescription
numberBias step.

Error Codes

For details about the error codes, see Camera Error Codes.

Error CodeError Message
7400102Operation not allowed, the inputDevice or the session is abnormal.
7400103Session not config.

Example

import { BusinessError } from '@kit.BasicServicesKit';

function getSupportedOISBiasStep(photoSession: camera.PhotoSession, oisAxis: camera.OISAxes): number {
  let biasStep = 0.0;
  try {
    biasStep = photoSession.getSupportedOISBiasStep(oisAxis);
  } catch (error) {
    let err = error as BusinessError;
    console.error(`The getSupportedOISBiasStep call failed. error code: ${err.code}`);
  }
  return biasStep;
}

getCurrentOISMode24+

getCurrentOISMode(): OISMode

Obtains the 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

Returns

TypeDescription
OISModeOIS mode.

Error Codes

For details about the error codes, see Camera Error Codes.

Error CodeError Message
7400102Operation not allowed, the inputDevice or the session is abnormal.
7400103Session not config.

Example

import { BusinessError } from '@kit.BasicServicesKit';

function getCurrentOISMode(photoSession: camera.PhotoSession): camera.OISMode {
  let mode: camera.OISMode = camera.OISMode.OFF;
  try {
    mode = photoSession.getCurrentOISMode();
  } catch (error) {
    let err = error as BusinessError;
    console.error(`The getCurrentOISMode call failed. error code: ${err.code}`);
  }
  return mode;
}

getCurrentCustomOISBias24+

getCurrentCustomOISBias(oisAxis: OISAxes): number

Obtains the custom bias on the specified OIS axis.

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

Parameters

ParameterTypeMandatoryDescription
oisAxisOISAxesYesOIS axis.

Returns

TypeDescription
numberCurrent bias.

Error Codes

For details about the error codes, see Camera Error Codes.

Error CodeError Message
7400102Operation not allowed, the inputDevice or the session is abnormal.
7400103Session not config.

Example

import { BusinessError } from '@kit.BasicServicesKit';

function getCurrentCustomOISBias(photoSession: camera.PhotoSession, oisAxis: camera.OISAxes): number {
  let bias = 0.0;
  try {
    bias = photoSession.getCurrentCustomOISBias(oisAxis);
  } catch (error) {
    let err = error as BusinessError;
    console.error(`The getCurrentCustomOISBias call failed. error code: ${err.code}`);
  }
  return bias;
}

你可能感兴趣的鸿蒙文章

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/Mko4WZ9h