import display from "@ohos.display"; import { Size } from './Size'; export class WeCameraConfig { constructor(o23) { this.useFlash = false; this.minFps = 12; this.maxFps = 30; this.autoFoucs = true; this.useFlash = o23.useFlash; this.previewSize = o23.previewSize !== undefined ? o23.previewSize : this.getFullScreenSize(); this.photoSize = o23.photoSize !== undefined ? o23.photoSize : this.getFullScreenSize(); this.videoSize = o23.videoSize !== undefined ? o23.videoSize : this.getFullScreenSize(); } getMinFps() { return this.minFps; } getMaxFps() { return this.maxFps; } getPreviewSize() { return this.previewSize; } getPhotoSize() { return this.photoSize; } getVideoSize() { return this.videoSize; } getPhotoOutputFormat() { return []; } getVideoOutputFormat() { return []; } getFullScreenSize() { let m23 = display.getDefaultDisplaySync(); let n23 = new Size(m23.width, m23.height); return n23; } getFps() { return 24; } } export class WeCameraConfigBuilder { constructor() { this.useFlash = false; this.minFps = 12; this.maxFps = 30; this.autoFoucs = true; this.photoFormat = []; this.videoFormat = []; } openFlash() { this.useFlash = true; return this; } previewSurfaceSize(l23) { this.previewSize = l23; return this; } photoOutputSize(k23) { this.photoSize = k23; return this; } videoOutputSize(j23) { this.videoSize = j23; return this; } closeAutoFoucs() { this.autoFoucs = false; return this; } setMinFps(i23) { this.minFps = i23; return this; } setMaxFps(h23) { this.maxFps = h23; return this; } build() { if (this.photoSize?.getRote() !== this.previewSize?.getRote()) { this.photoSize = this.previewSize; } if (this.videoSize?.getRote() !== this.previewSize?.getRote()) { this.videoSize = this.previewSize; } return new WeCameraConfig(this); } } 