mirror of
https://github.com/yume-chan/ya-webadb.git
synced 2025-10-03 09:49:24 +02:00
feat(scrcpy): add class for crop option
This commit is contained in:
parent
c0d0695285
commit
fdf674a9bc
2 changed files with 22 additions and 1 deletions
|
@ -89,6 +89,24 @@ export namespace CodecOptions {
|
||||||
export type Init = CodecOptionsInit;
|
export type Init = CodecOptionsInit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class Crop implements ScrcpyOptionValue {
|
||||||
|
width: number;
|
||||||
|
height: number;
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
|
||||||
|
constructor(width: number, height: number, x: number, y: number) {
|
||||||
|
this.width = width;
|
||||||
|
this.height = height;
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
}
|
||||||
|
|
||||||
|
toOptionValue(): string | undefined {
|
||||||
|
return `${this.width}:${this.height}:${this.x}:${this.y}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export interface Init {
|
export interface Init {
|
||||||
logLevel?: LogLevel;
|
logLevel?: LogLevel;
|
||||||
|
|
||||||
|
@ -124,7 +142,7 @@ export interface Init {
|
||||||
*/
|
*/
|
||||||
tunnelForward?: boolean;
|
tunnelForward?: boolean;
|
||||||
|
|
||||||
crop?: string | undefined;
|
crop?: Crop | undefined;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send PTS so that the client may record properly
|
* Send PTS so that the client may record properly
|
||||||
|
|
|
@ -2,6 +2,7 @@ export {
|
||||||
BackOrScreenOnControlMessage as ScrcpyBackOrScreenOnControlMessage,
|
BackOrScreenOnControlMessage as ScrcpyBackOrScreenOnControlMessage,
|
||||||
CaptureOrientation as ScrcpyCaptureOrientation,
|
CaptureOrientation as ScrcpyCaptureOrientation,
|
||||||
CodecOptions as ScrcpyCodecOptions,
|
CodecOptions as ScrcpyCodecOptions,
|
||||||
|
Crop as ScrcpyCrop,
|
||||||
InjectScrollControlMessage as ScrcpyInjectScrollControlMessage,
|
InjectScrollControlMessage as ScrcpyInjectScrollControlMessage,
|
||||||
InjectTouchControlMessage as ScrcpyInjectTouchControlMessage,
|
InjectTouchControlMessage as ScrcpyInjectTouchControlMessage,
|
||||||
InstanceId as ScrcpyInstanceId,
|
InstanceId as ScrcpyInstanceId,
|
||||||
|
@ -13,3 +14,5 @@ export {
|
||||||
UHidCreateControlMessage as ScrcpyUHidCreateControlMessage,
|
UHidCreateControlMessage as ScrcpyUHidCreateControlMessage,
|
||||||
UHidOutputDeviceMessage as ScrcpyUHidOutputDeviceMessage,
|
UHidOutputDeviceMessage as ScrcpyUHidOutputDeviceMessage,
|
||||||
} from "./3_0/impl/index.js";
|
} from "./3_0/impl/index.js";
|
||||||
|
|
||||||
|
export { ScrcpyOptions3_0 as ScrcpyOptionsLatest } from "./3_0/index.js";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue