1/* 2 * Copyright (C) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16interface Point { 17 x: number; 18 y: number; 19} 20 21interface exposureBias { 22 minExposureBias: number; 23 maxExposureBias: number; 24} 25 26interface zoomRatio { 27 minZoom: number; 28 maxZoom: number; 29} 30 31interface cameraInfo { 32 cameraId: string; 33 cameraPosition: number; 34 cameraType: number; 35 connectionType: number; 36} 37 38interface cameraOutputCapability { 39 previewProfilesSize: number; 40 photoProfilesSize: number; 41 videoProfilesSize: number; 42 metadataProfilesSize: number; 43} 44 45interface Capture_Setting { 46 quality: number; 47 rotation: number; 48 mirror: boolean; 49 latitude: number; 50 longitude: number; 51 altitude: number; 52} 53 54interface canPreconfig { 55 errorCode: number; 56 canPreconfig: boolean; 57} 58 59interface supportedSceneModes { 60 errorCode:number; 61 sceneModesSize: number; 62 isNormalPhoto: boolean; 63 isNormalVideo: boolean; 64 isSecurePhoto: boolean; 65} 66 67interface canAddInput { 68 errorCode:number; 69 isAddInput:boolean; 70} 71 72interface canAddPreviewOutput { 73 errorCode:number; 74 isAddPreviewOutput:boolean; 75} 76 77interface canAddPhotoOutput { 78 errorCode:number; 79 isAddPhotoOutput:boolean; 80} 81 82interface canAddVideoOutput { 83 errorCode:number; 84 isAddVideoOutput:boolean; 85} 86 87interface secureCamera { 88 errorCode: number; 89 secureSeqId: BigInt; 90} 91 92interface movingPhoto { 93 errorCode: number; 94 isMovingPhotoSupported: boolean; 95} 96 97interface isTorchSupported { 98 errorCode: number; 99 isTorchSupported: boolean; 100} 101 102interface isTorchSupportedByTorchMode { 103 errorCode: number; 104 isTorchSupportedByTorchMode: boolean; 105} 106 107interface frameRatesSize { 108 errorCode: number; 109 frameRatesSize: number; 110} 111 112interface videoFrameRatesSize { 113 errorCode: number; 114 videoFrameRatesSize: number; 115} 116 117interface FrameRateRange { 118 errorCode: number; 119 min: number; 120 max: number; 121} 122 123interface colorSpacesSize { 124 errorCode: number; 125 colorSpacesSize: number; 126} 127 128interface effectTypeSize { 129 errorCode: number; 130 effectTypeSize: number; 131} 132 133interface activeColorSpace { 134 errorCode: number; 135 activeColorSpace: number; 136} 137 138interface colorSpace { 139 colorSpaceSupportSize: number; 140 setcolorSpace: number; 141 colorSpacesSize: number; 142} 143 144interface autoDeviceSwitchSupportInfo { 145 errorCode: number; 146 isSupported: boolean; 147} 148 149interface MacroSupportedinfo { 150 errorCode: number; 151 isMacroSupported: boolean; 152} 153 154export const initCamera: (surfaceId: string) => number; 155 156export const getSupportedCameras: () => cameraInfo; 157 158export const getCameraOrientation: () => number; 159 160export const getCameraHostNameErrorParameter: () => number; 161 162export const getCameraHostTypeErrorParameter: () => number; 163 164export const getCameraHostNameInspection: () => number; 165 166export const getCameraHostTypeInspection: () => number; 167 168export const getCameraHostName: () => number; 169 170export const getCameraHostType: () => number; 171 172export const getWhiteBalanceTest: () => number; 173 174export const getMacroStatusChangeTest: () => number; 175 176export const createCameraInput: () => number; 177 178export const createCameraInputWithPositionAndType: (position: number, type: number) => number; 179 180export const getSupportedOutputCapability: () => cameraOutputCapability; 181 182export const createPreviewOutput: () => number; 183 184export const createPhotoOutput: (surfaceId: string) => number; 185 186export const createVideoOutput: (surfaceId: string) => number; 187 188export const createMetadataOutput: () => number; 189 190export const createSession: () => number; 191 192export const isCameraMuted: () => number; 193 194export const cameraInputOpen: () => number; 195 196export const cameraInputClose: () => number; 197 198export const cameraInputRelease: () => number; 199 200export const previewOutputStart: () => number; 201 202export const previewOutputStop: () => number; 203 204export const previewOutputRelease: () => number; 205 206export const photoOutputCapture: () => number; 207 208export const takePictureWithSettings: (setting: Capture_Setting) => number; 209 210export const isMirrorSupported: () => boolean; 211 212export const photoOutputRelease: () => number; 213 214export const videoOutputStart: () => number; 215 216export const videoOutputStop: () => number; 217 218export const videoOutputRelease: () => number; 219 220export const isVideoMirrorSupported: () => boolean; 221 222export const enableVideoMirror: (enable: boolean) => number; 223 224export const metadataOutputStart: () => number; 225 226export const metadataOutputStop: () => number; 227 228export const metadataOutputRelease: () => number; 229 230export const sessionBegin: () => number; 231 232export const sessionCommitConfig: () => number; 233 234export const sessionStop: () => number; 235 236export const sessionStart: () => number; 237 238export const sessionAddInput: () => number; 239 240export const sessionRemoveInput: () => number; 241 242export const sessionAddPreviewOutput: () => number; 243 244export const sessionAddPhotoOutput: () => number; 245 246export const sessionAddVideoOutput: () => number; 247 248export const sessionAddMetadataOutput: () => number; 249 250export const sessionRemovePreviewOutput: () => number; 251 252export const sessionRemovePhotoOutput: () => number; 253 254export const sessionRemoveVideoOutput: () => number; 255 256export const sessionRemoveMetadataOutput: () => number; 257 258export const sessionRelease: () => number; 259 260export const sessionHasFlash: () => boolean; 261 262export const sessionIsFlashModeSupported: (a: number) => boolean; 263 264export const sessionGetFlashMode: () => number; // return flashmode 265 266export const sessionSetFlashMode: (a: number) => number; 267 268export const sessionIsExposureModeSupported: (a: number) => boolean; 269 270export const sessionGetExposureMode: () => number; // return exposureMode 271 272export const sessionSetExposureMode: (a: number) => number; 273 274export const sessionGetMeteringPoint: () => Point; // return meteringPoint 275 276export const sessionSetMeteringPoint: (point: Point) => number; 277 278export const sessionGetExposureBiasRange: () => exposureBias // return exposureBiasRange 279 280export const sessionSetExposureBias: (a: number) => number; 281 282export const sessionGetExposureBias: () => number; // return exposureBias 283 284export const sessionIsFocusModeSupported: (a: number) => boolean; 285 286export const sessionIsControlCenterSupported: () => boolean; 287 288export const sessionGetSupportedEffectTypes: (index: number) => effectTypeSize; 289 290export const sessionDeleteSupportedEffectTypes: (index: number) => number; 291 292export const sessionEnableControlCenter: (enable: boolean) => number; 293 294export const sessionRegisterControlCenterEffectStatusChange: (index:number) => number; 295 296export const sessionUnregisterControlCenterEffectStatusChange: (index:number) => number; 297 298export const sessionGetPhotoRotation: (a: number) => number; 299 300export const sessionGetVideoRotation: (a: number) => number; 301 302export const sessionGetPreviewRotation: (a: number) => number; 303 304export const sessionSetPreviewRotation: (a: number, b: boolean) => number; 305 306export const sessionGetFocusMode: () => number; 307 308export const sessionSetFocusMode: (a: number) => number; 309 310export const sessionSetFocusPoint: (point: Point) => number; 311 312export const sessionGetFocusPoint: () => Point; 313 314export const sessionGetZoomRatioRange: () => zoomRatio // return ZoomRatioRange 315 316export const sessionGetZoomRatio: () => number; // return current ZoomRatio 317 318export const sessionSetZoomRatio: (a: number) => number; 319 320export const sessionIsVideoStabilizationModeSupported: (a: number) => boolean; 321 322export const sessionGetVideoStabilizationMode: () => number; // return VideoStabilizationMode 323 324export const sessionSetVideoStabilizationMode: (a: number) => number; 325 326export const getCameraCallbackCode: () => number; 327 328export const readyCreatePhotoOutputWithoutSurface: () => number; 329 330export const oHCaptureSessionRegisterCallback: (index:number) => number; 331 332export const oHCaptureSessionUnregisterCallback: (index:number) => number; 333 334export const oHCameraManagerGetSupportedSceneModes: (index:number) => supportedSceneModes; 335 336export const oHCameraManagerDeleteSceneModes: (index:number) => number; 337 338export const oHCameraManagerGetSupportedCameraOutputCapabilityWithSceneMode: (index:number) => number; 339 340export const oHCaptureSessionSetSessionMode: (index:number) => number; 341 342export const oHCaptureSessionCanAddInput: (index:number) => canAddInput; 343 344export const oHCaptureSessionCanAddPreviewOutput: (index:number) => canAddPreviewOutput; 345 346export const oHCaptureSessionCanAddPhotoOutput: (index:number) => canAddPhotoOutput; 347 348export const oHCaptureSessionCanAddVideoOutput: (index:number) => canAddVideoOutput; 349 350export const oHCaptureSessionAddSecureOutput: (index:number) => number; 351 352export const oHCameraInputOpenSecureCamera: (index:number) => secureCamera; 353 354export const oHCameraManagerSetSceneMode: (index:number) => number; 355 356export const oHCameraManagerGetSupportedCameraInfos: (index:number) => Array<cameraInfo>; 357 358export const oHCaptureSessionRegisterCallbackOn: (index:number) => number; 359 360export const oHCaptureSessionUnregisterCallbackOff: (index:number) => number; 361 362export const oHCameraManagerCreateVideoOutputUsedInPreconfig: (videoId: string,index:number) => number; 363 364export const oHCameraManagerCreatePreviewOutputUsedInPreconfig: (index:number) => number; 365 366export const oHCameraManagerCreatePhotoOutputUsedInPreconfig: (surfaceId: string,index:number) => number; 367 368export const oHCaptureSessionCanPreconfig: (a: number,index:number) => canPreconfig; 369 370export const oHCaptureSessionCanPreconfigWithRatio: (a: number,b: number,index:number) => canPreconfig; 371 372export const oHCaptureSessionPreconfig: (a: number,index:number) => number; 373 374export const oHCaptureSessionPreconfigWithRatio: (a: number,b: number,index:number) => number; 375 376export const oHVideoOutputGetActiveProfile: (index:number) => number; 377 378export const oHVideoOutputDeleteProfile: (index:number) => number; 379 380export const oHPreviewOutputGetActiveProfile: (index:number) => number; 381 382export const oHPreviewOutputDeleteProfile: (index:number) => number; 383 384export const oHPhotoOutputGetActiveProfile: (index:number) => number; 385 386export const oHPhotoOutputDeleteProfile: (index:number) => number; 387 388export const oHPhotoOutputRegisterPhotoAvailableCallback: (index:number) => number; 389 390export const oHPhotoOutputUnregisterPhotoAvailableCallback: (index:number) => number; 391 392export const oHPhotoOutputRegisterPhotoAssetAvailableCallback: (index:number) => number; 393 394export const oHPhotoOutputUnregisterPhotoAssetAvailableCallback: (index:number) => number; 395 396export const oHPhotoOutputIsMovingPhotoSupported: (index:number) => movingPhoto; 397 398export const oHPhotoOutputEnableMovingPhoto: (index:number, enable:boolean) => number; 399 400export const oHPhotoNativeGetMainImage: (index:number) => number; 401 402export const oHPhotoNativeRelease: (index:number) => number; 403 404export const oHCameraManagerCreatePhotoOutputWithoutSurface: (index:number) => number; 405 406export const releaseCamera: () => number; 407 408export const oHCameraManagerTorchMode: (index:number) => number; 409 410export const oHCameraManagerIsTorchSupported: (index:number) => isTorchSupported; 411 412export const oHCameraManagerIsTorchSupportedByTorchMode: (index:number) => isTorchSupportedByTorchMode; 413 414export const oHCameraManagerSetTorchMode: (index:number) => number; 415 416export const oHCaptureSessionGetExposureValue: (index:number) => number; 417 418export const oHCaptureSessionGetFocalLength: (index:number) => number; 419 420export const oHCaptureSessionSetSmoothZoom: (index:number) => number; 421 422export const oHCaptureSessionGetSupportedColorSpaces: (index:number) => colorSpacesSize; 423 424export const oHCaptureSessionDeleteColorSpaces: (index:number) => number; 425 426export const oHCaptureSessionGetActiveColorSpace: (index:number) => activeColorSpace; 427 428export const oHNativeBufferColorSpace: () => colorSpace; 429 430export const oHCaptureSessionSetActiveColorSpace: (index:number) => number; 431 432export const oHPreviewOutputGetSupportedFrameRates: (index:number) => frameRatesSize; 433 434export const oHPreviewOutputSetFrameRate: (index:number) => number; 435 436export const oHPreviewOutputGetActiveFrameRate: (index:number) => FrameRateRange; 437 438export const oHPreviewOutputDeleteFrameRates: (index:number) => number; 439 440export const oHVideoOutputGetSupportedFrameRates: (index:number) => videoFrameRatesSize; 441 442export const oHVideoOutputSetFrameRate: (index:number) => number; 443 444export const oHVideoOutputGetActiveFrameRate: (index:number) => FrameRateRange; 445 446export const oHVideoOutputDeleteFrameRates: (index:number) => number; 447 448export const oHCameraManagerRegisterTorchStatusCallback: (index:number) => number; 449 450export const oHCameraManagerUnregisterTorchStatusCallback: (index:number) => number; 451 452export const oHCaptureSessionRegisterSmoothZoomInfoCallback: (index:number) => number; 453 454export const oHCaptureSessionUnregisterSmoothZoomInfoCallback: (index:number) => number; 455 456export const oHPhotoOutputRegisterCaptureStartWithInfoCallback: (index:number) => number; 457 458export const oHPhotoOutputUnregisterCaptureStartWithInfoCallback: (index:number) => number; 459 460export const oHPhotoOutputRegisterCaptureEndCallback: (index:number) => number; 461 462export const oHPhotoOutputUnregisterCaptureEndCallback: (index:number) => number; 463 464export const oHPhotoOutputRegisterFrameShutterEndCallback: (index:number) => number; 465 466export const oHPhotoOutputUnregisterFrameShutterEndCallback: (index:number) => number; 467 468export const oHPhotoOutputRegisterCaptureReadyCallback: (index:number) => number; 469 470export const oHPhotoOutputUnregisterCaptureReadyCallback: (index:number) => number; 471 472export const oHPhotoOutputRegisterEstimatedCaptureDurationCallback: (index:number) => number; 473 474export const oHPhotoOutputUnregisterEstimatedCaptureDurationCallback: (index:number) => number; 475 476export const sessionIsAutoDeviceSwitchSupported: () => autoDeviceSwitchSupportInfo; 477 478export const sessionEnableAutoDeviceSwitch: (enable:boolean) => number; 479 480export const sessionRegisterAutoDeviceSwitchStatusChange: (index:number) => number; 481 482export const sessionUnregisterAutoDeviceSwitchStatusChange: (index:number) => number; 483 484export const sessionRegisterSystemPressureLevel: (index:number) => number; 485 486export const sessionUnregisterSystemPressureLevel: (index:number) => number; 487 488export const cameraManagerRegisterFoldStatusChange: (index:number) => number; 489 490export const cameraManagerUnregisterFoldStatusChange: (index:number) => number; 491 492export const sessionSetQualityPrioritization: (index:number) => number; 493 494export const oHCameraManagerGetCameraDevice: (index:number) => number; 495 496export const oHCameraManagerGetCameraConcurrentInfos: (index:number) => number; 497 498export const oHCameraInputOpenConcurrentCameras: (index:number) => number; 499 500export const sessionIsMacroSupported: (a: number) => MacroSupportedinfo; 501 502export const sessionEnableMacro: (index: number, enable: boolean) => number;