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 activeColorSpace { 129 errorCode: number; 130 activeColorSpace: number; 131} 132 133interface colorSpace { 134 colorSpaceSupportSize: number; 135 setcolorSpace: number; 136 colorSpacesSize: number; 137} 138 139interface autoDeviceSwitchSupportInfo { 140 errorCode: number; 141 isSupported: boolean; 142} 143 144export const initCamera: (surfaceId: string) => number; 145 146export const getSupportedCameras: () => cameraInfo; 147 148export const getCameraOrientation: () => number; 149 150export const createCameraInput: () => number; 151 152export const createCameraInputWithPositionAndType: (position: number, type: number) => number; 153 154export const getSupportedOutputCapability: () => cameraOutputCapability; 155 156export const createPreviewOutput: () => number; 157 158export const createPhotoOutput: (surfaceId: string) => number; 159 160export const createVideoOutput: (surfaceId: string) => number; 161 162export const createMetadataOutput: () => number; 163 164export const createSession: () => number; 165 166export const isCameraMuted: () => number; 167 168export const cameraInputOpen: () => number; 169 170export const cameraInputClose: () => number; 171 172export const cameraInputRelease: () => number; 173 174export const previewOutputStart: () => number; 175 176export const previewOutputStop: () => number; 177 178export const previewOutputRelease: () => number; 179 180export const photoOutputCapture: () => number; 181 182export const takePictureWithSettings: (setting: Capture_Setting) => number; 183 184export const isMirrorSupported: () => boolean; 185 186export const photoOutputRelease: () => number; 187 188export const videoOutputStart: () => number; 189 190export const videoOutputStop: () => number; 191 192export const videoOutputRelease: () => number; 193 194export const metadataOutputStart: () => number; 195 196export const metadataOutputStop: () => number; 197 198export const metadataOutputRelease: () => number; 199 200export const sessionBegin: () => number; 201 202export const sessionCommitConfig: () => number; 203 204export const sessionStop: () => number; 205 206export const sessionStart: () => number; 207 208export const sessionAddInput: () => number; 209 210export const sessionRemoveInput: () => number; 211 212export const sessionAddPreviewOutput: () => number; 213 214export const sessionAddPhotoOutput: () => number; 215 216export const sessionAddVideoOutput: () => number; 217 218export const sessionAddMetadataOutput: () => number; 219 220export const sessionRemovePreviewOutput: () => number; 221 222export const sessionRemovePhotoOutput: () => number; 223 224export const sessionRemoveVideoOutput: () => number; 225 226export const sessionRemoveMetadataOutput: () => number; 227 228export const sessionRelease: () => number; 229 230export const sessionHasFlash: () => boolean; 231 232export const sessionIsFlashModeSupported: (a: number) => boolean; 233 234export const sessionGetFlashMode: () => number; // return flashmode 235 236export const sessionSetFlashMode: (a: number) => number; 237 238export const sessionIsExposureModeSupported: (a: number) => boolean; 239 240export const sessionGetExposureMode: () => number; // return exposureMode 241 242export const sessionSetExposureMode: (a: number) => number; 243 244export const sessionGetMeteringPoint: () => Point; // return meteringPoint 245 246export const sessionSetMeteringPoint: (point: Point) => number; 247 248export const sessionGetExposureBiasRange: () => exposureBias // return exposureBiasRange 249 250export const sessionSetExposureBias: (a: number) => number; 251 252export const sessionGetExposureBias: () => number; // return exposureBias 253 254export const sessionIsFocusModeSupported: (a: number) => boolean; 255 256export const sessionGetFocusMode: () => number; 257 258export const sessionSetFocusMode: (a: number) => number; 259 260export const sessionSetFocusPoint: (point: Point) => number; 261 262export const sessionGetFocusPoint: () => Point; 263 264export const sessionGetZoomRatioRange: () => zoomRatio // return ZoomRatioRange 265 266export const sessionGetZoomRatio: () => number; // return current ZoomRatio 267 268export const sessionSetZoomRatio: (a: number) => number; 269 270export const sessionIsVideoStabilizationModeSupported: (a: number) => boolean; 271 272export const sessionGetVideoStabilizationMode: () => number; // return VideoStabilizationMode 273 274export const sessionSetVideoStabilizationMode: (a: number) => number; 275 276export const getCameraCallbackCode: () => number; 277 278export const oHCaptureSessionRegisterCallback: (index:number) => number; 279 280export const oHCaptureSessionUnregisterCallback: (index:number) => number; 281 282export const oHCameraManagerGetSupportedSceneModes: (index:number) => supportedSceneModes; 283 284export const oHCameraManagerDeleteSceneModes: (index:number) => number; 285 286export const oHCameraManagerGetSupportedCameraOutputCapabilityWithSceneMode: (index:number) => number; 287 288export const oHCaptureSessionSetSessionMode: (index:number) => number; 289 290export const oHCaptureSessionCanAddInput: (index:number) => canAddInput; 291 292export const oHCaptureSessionCanAddPreviewOutput: (index:number) => canAddPreviewOutput; 293 294export const oHCaptureSessionCanAddPhotoOutput: (index:number) => canAddPhotoOutput; 295 296export const oHCaptureSessionCanAddVideoOutput: (index:number) => canAddVideoOutput; 297 298export const oHCaptureSessionAddSecureOutput: (index:number) => number; 299 300export const oHCameraInputOpenSecureCamera: (index:number) => secureCamera; 301 302export const oHCameraManagerSetSceneMode: (index:number) => number; 303 304export const oHCaptureSessionRegisterCallbackOn: (index:number) => number; 305 306export const oHCaptureSessionUnregisterCallbackOff: (index:number) => number; 307 308export const oHCameraManagerCreateVideoOutputUsedInPreconfig: (videoId: string,index:number) => number; 309 310export const oHCameraManagerCreatePreviewOutputUsedInPreconfig: (index:number) => number; 311 312export const oHCameraManagerCreatePhotoOutputUsedInPreconfig: (surfaceId: string,index:number) => number; 313 314export const oHCaptureSessionCanPreconfig: (a: number,index:number) => canPreconfig; 315 316export const oHCaptureSessionCanPreconfigWithRatio: (a: number,b: number,index:number) => canPreconfig; 317 318export const oHCaptureSessionPreconfig: (a: number,index:number) => number; 319 320export const oHCaptureSessionPreconfigWithRatio: (a: number,b: number,index:number) => number; 321 322export const oHVideoOutputGetActiveProfile: (index:number) => number; 323 324export const oHVideoOutputDeleteProfile: (index:number) => number; 325 326export const oHPreviewOutputGetActiveProfile: (index:number) => number; 327 328export const oHPreviewOutputDeleteProfile: (index:number) => number; 329 330export const oHPhotoOutputGetActiveProfile: (index:number) => number; 331 332export const oHPhotoOutputDeleteProfile: (index:number) => number; 333 334export const oHPhotoOutputRegisterPhotoAvailableCallback: (index:number) => number; 335 336export const oHPhotoOutputUnregisterPhotoAvailableCallback: (index:number) => number; 337 338export const oHPhotoOutputRegisterPhotoAssetAvailableCallback: (index:number) => number; 339 340export const oHPhotoOutputUnregisterPhotoAssetAvailableCallback: (index:number) => number; 341 342export const oHPhotoOutputIsMovingPhotoSupported: (index:number) => movingPhoto; 343 344export const oHPhotoOutputEnableMovingPhoto: (index:number, enable:boolean) => number; 345 346export const oHPhotoNativeGetMainImage: (index:number) => number; 347 348export const oHPhotoNativeRelease: (index:number) => number; 349 350export const oHCameraManagerCreatePhotoOutputWithoutSurface: (index:number) => number; 351 352export const releaseCamera: () => number; 353 354export const oHCameraManagerTorchMode: (index:number) => number; 355 356export const oHCameraManagerIsTorchSupported: (index:number) => isTorchSupported; 357 358export const oHCameraManagerIsTorchSupportedByTorchMode: (index:number) => isTorchSupportedByTorchMode; 359 360export const oHCameraManagerSetTorchMode: (index:number) => number; 361 362export const oHCaptureSessionGetExposureValue: (index:number) => number; 363 364export const oHCaptureSessionGetFocalLength: (index:number) => number; 365 366export const oHCaptureSessionSetSmoothZoom: (index:number) => number; 367 368export const oHCaptureSessionGetSupportedColorSpaces: (index:number) => colorSpacesSize; 369 370export const oHCaptureSessionDeleteColorSpaces: (index:number) => number; 371 372export const oHCaptureSessionGetActiveColorSpace: (index:number) => activeColorSpace; 373 374export const oHNativeBufferColorSpace: () => colorSpace; 375 376export const oHCaptureSessionSetActiveColorSpace: (index:number) => number; 377 378export const oHPreviewOutputGetSupportedFrameRates: (index:number) => frameRatesSize; 379 380export const oHPreviewOutputSetFrameRate: (index:number) => number; 381 382export const oHPreviewOutputGetActiveFrameRate: (index:number) => FrameRateRange; 383 384export const oHPreviewOutputDeleteFrameRates: (index:number) => number; 385 386export const oHVideoOutputGetSupportedFrameRates: (index:number) => videoFrameRatesSize; 387 388export const oHVideoOutputSetFrameRate: (index:number) => number; 389 390export const oHVideoOutputGetActiveFrameRate: (index:number) => FrameRateRange; 391 392export const oHVideoOutputDeleteFrameRates: (index:number) => number; 393 394export const oHCameraManagerRegisterTorchStatusCallback: (index:number) => number; 395 396export const oHCameraManagerUnregisterTorchStatusCallback: (index:number) => number; 397 398export const oHCaptureSessionRegisterSmoothZoomInfoCallback: (index:number) => number; 399 400export const oHCaptureSessionUnregisterSmoothZoomInfoCallback: (index:number) => number; 401 402export const oHPhotoOutputRegisterCaptureStartWithInfoCallback: (index:number) => number; 403 404export const oHPhotoOutputUnregisterCaptureStartWithInfoCallback: (index:number) => number; 405 406export const oHPhotoOutputRegisterCaptureEndCallback: (index:number) => number; 407 408export const oHPhotoOutputUnregisterCaptureEndCallback: (index:number) => number; 409 410export const oHPhotoOutputRegisterFrameShutterEndCallback: (index:number) => number; 411 412export const oHPhotoOutputUnregisterFrameShutterEndCallback: (index:number) => number; 413 414export const oHPhotoOutputRegisterCaptureReadyCallback: (index:number) => number; 415 416export const oHPhotoOutputUnregisterCaptureReadyCallback: (index:number) => number; 417 418export const oHPhotoOutputRegisterEstimatedCaptureDurationCallback: (index:number) => number; 419 420export const oHPhotoOutputUnregisterEstimatedCaptureDurationCallback: (index:number) => number; 421 422export const sessionIsAutoDeviceSwitchSupported: () => autoDeviceSwitchSupportInfo; 423 424export const sessionEnableAutoDeviceSwitch: (enable:boolean) => number; 425 426export const sessionRegisterAutoDeviceSwitchStatusChange: (index:number) => number; 427 428export const sessionUnregisterAutoDeviceSwitchStatusChange: (index:number) => number; 429 430export const cameraManagerRegisterFoldStatusChange: (index:number) => number; 431 432export const cameraManagerUnregisterFoldStatusChange: (index:number) => number;