2022-08-02 19:22:32 +08:00
|
|
|
export interface IScreenInfo {
|
|
|
|
screen_width: number;
|
|
|
|
screen_height: number;
|
|
|
|
unit_width: number;
|
|
|
|
unit_height: number;
|
2022-08-03 20:02:25 +08:00
|
|
|
screen_rows: number;
|
|
|
|
screen_cols: number;
|
2022-08-02 19:22:32 +08:00
|
|
|
desktop_col: number;
|
2022-08-03 20:02:25 +08:00
|
|
|
desktop_row: number;
|
|
|
|
desktop_width: number;
|
|
|
|
desktop_height: number;
|
2022-08-02 19:22:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export class SpecialVideoHelper {
|
|
|
|
private static kScreenWidth = 3840;
|
|
|
|
private static kScreenHeight = 2160;
|
|
|
|
|
|
|
|
public static getScreenInfo(
|
|
|
|
wall_cols: number,
|
|
|
|
wall_rows: number
|
|
|
|
): IScreenInfo {
|
|
|
|
const desktp_row = Math.ceil(Math.sqrt(wall_rows * wall_cols));
|
|
|
|
const desktop_col = desktp_row;
|
|
|
|
const unit_width = SpecialVideoHelper.kScreenWidth / desktop_col;
|
|
|
|
const unit_height = SpecialVideoHelper.kScreenHeight / desktp_row;
|
|
|
|
const screen_width = wall_cols * unit_width;
|
|
|
|
const screen_height = wall_rows * unit_height;
|
|
|
|
return {
|
|
|
|
screen_width,
|
|
|
|
screen_height,
|
|
|
|
unit_width,
|
|
|
|
unit_height,
|
2022-08-03 20:02:25 +08:00
|
|
|
screen_rows: wall_rows,
|
|
|
|
screen_cols: wall_cols,
|
2022-08-02 19:22:32 +08:00
|
|
|
desktop_col,
|
2022-08-03 20:02:25 +08:00
|
|
|
desktop_row: desktop_col,
|
|
|
|
desktop_width: SpecialVideoHelper.kScreenWidth,
|
|
|
|
desktop_height: SpecialVideoHelper.kScreenHeight,
|
2022-08-02 19:22:32 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|