UNPKG

@yume-chan/scrcpy

Version:
68 lines 1.81 kB
export const LockOrientation = { Unlocked: 0, LockedInitial: 1, LockedValue: 2, }; export const Orientation = { Orient0: 0, Orient90: 90, Orient180: 180, Orient270: 270, }; export class CaptureOrientation { static Unlocked = /* #__PURE__ */ (() => new CaptureOrientation(LockOrientation.Unlocked, Orientation.Orient0, false))(); lock; orientation; flip; constructor(lock, orientation, flip = false) { this.lock = lock; this.orientation = orientation; this.flip = flip; } toOptionValue() { if (this.lock === LockOrientation.Unlocked && this.orientation === Orientation.Orient0 && !this.flip) { return undefined; } if (this.lock === LockOrientation.LockedInitial) { return "@"; } return ((this.lock === LockOrientation.LockedValue ? "@" : "") + (this.flip ? "flip" : "") + this.orientation); } } export class NewDisplay { static Default = /* #__PURE__ */ new NewDisplay(); width; height; dpi; constructor(a, b, c) { if (a === undefined) { return; } if (b === undefined) { this.dpi = a; return; } this.width = a; this.height = b; this.dpi = c; } toOptionValue() { if (this.width === undefined && this.height === undefined && this.dpi === undefined) { return ""; } if (this.width === undefined) { return `/${this.dpi}`; } if (this.dpi === undefined) { return `${this.width}x${this.height}`; } return `${this.width}x${this.height}/${this.dpi}`; } } //# sourceMappingURL=init.js.map