feat: GUI 控制的,LED 灯条颜色预览。
This commit is contained in:
16
src/models/display-config.ts
Normal file
16
src/models/display-config.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import { Borders } from '../constants/border';
|
||||
import { LedStripConfig } from './led-strip-config';
|
||||
|
||||
export class LedStripConfigOfBorders implements Record<Borders, LedStripConfig | null> {
|
||||
constructor(
|
||||
public top: LedStripConfig | null = null,
|
||||
public bottom: LedStripConfig | null = null,
|
||||
public left: LedStripConfig | null = null,
|
||||
public right: LedStripConfig | null = null,
|
||||
) {}
|
||||
}
|
||||
export class DisplayConfig {
|
||||
led_strip_of_borders = new LedStripConfigOfBorders();
|
||||
|
||||
constructor(public id: number) {}
|
||||
}
|
10
src/models/led-strip-config.ts
Normal file
10
src/models/led-strip-config.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import { Borders } from '../constants/border';
|
||||
|
||||
export class LedStripConfig {
|
||||
constructor(
|
||||
public readonly display_id: number,
|
||||
public readonly border: Borders,
|
||||
public start_pos: number,
|
||||
public len: number,
|
||||
) {}
|
||||
}
|
8
src/models/picker-configuration.ts
Normal file
8
src/models/picker-configuration.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import { DisplayConfig } from './display-config';
|
||||
|
||||
export class PickerConfiguration {
|
||||
constructor(
|
||||
public display_configs: DisplayConfig[] = [],
|
||||
public config_version: number = 1,
|
||||
) {}
|
||||
}
|
1
src/models/pixel-rgb.ts
Normal file
1
src/models/pixel-rgb.ts
Normal file
@ -0,0 +1 @@
|
||||
export type PixelRgb = [number, number, number];
|
12
src/models/screenshot.dto.ts
Normal file
12
src/models/screenshot.dto.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import { DisplayConfig } from './display-config';
|
||||
|
||||
export class ScreenshotDto {
|
||||
encode_image!: string;
|
||||
config!: DisplayConfig;
|
||||
colors!: {
|
||||
top: Uint8Array;
|
||||
bottom: Uint8Array;
|
||||
left: Uint8Array;
|
||||
right: Uint8Array;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user