MCPcopy Create free account
hub / github.com/AI-FanGe/OpenAIglasses_for_Navigation / render

Method render

static/visualizer.js:67–98  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

65 }
66
67 render() {
68 const ctx = this.ctx;
69 const width = this.canvas.width / window.devicePixelRatio;
70 const height = this.canvas.height / window.devicePixelRatio;
71
72 // 清空画布
73 ctx.fillStyle = this.colors.background;
74 ctx.fillRect(0, 0, width, height);
75
76 // 绘制网格背景
77 this.drawGrid(width, height);
78
79 // 绘制HUD边框
80 this.drawHUD(width, height);
81
82 // 根据模式绘制内容
83 if (this.data.mode === 'SEGMENT') {
84 this.drawSegmentMode(width, height);
85 } else if (this.data.mode === 'FLASH') {
86 this.drawFlashMode(width, height);
87 } else if (this.data.mode === 'TRACK') {
88 this.drawTrackMode(width, height);
89 }
90
91 // 绘制手部骨骼
92 if (this.data.hand) {
93 this.drawHand(this.data.hand, width, height);
94 }
95
96 // 绘制FPS和状态信息
97 this.drawStats(width, height);
98 }
99
100 drawGrid(width, height) {
101 const ctx = this.ctx;

Callers 2

connectWebSocketMethod · 0.95
main.jsFile · 0.45

Calls 7

drawGridMethod · 0.95
drawHUDMethod · 0.95
drawSegmentModeMethod · 0.95
drawFlashModeMethod · 0.95
drawTrackModeMethod · 0.95
drawHandMethod · 0.95
drawStatsMethod · 0.95

Tested by

no test coverage detected