-
Notifications
You must be signed in to change notification settings - Fork 29
/
WebglBaseLine.ts
97 lines (81 loc) · 1.43 KB
/
WebglBaseLine.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import { ColorRGBA } from "./ColorRGBA";
/**
* Baseline class
*/
export class WebglBaseLine {
public intensity: number;
public visible: boolean;
/**
* The number of data point pairs in the line
*/
public numPoints: number;
/**
* The data ponits for webgl array
* @internal
*/
public xy: Float32Array;
/**
* The Color of the line
*/
public color: ColorRGBA;
/**
* The horizontal scale of the line
* @default = 1
*/
public scaleX: number;
/**
* The vertical sclae of the line
* @default = 1
*/
public scaleY: number;
/**
* The horixontal offset of the line
* @default = 0
*/
public offsetX: number;
/**
* the vertical offset of the line
* @default = 0
*/
public offsetY: number;
/**
* if this is a close loop line or not
* @default = false
*/
public loop: boolean;
/**
* total webgl number of points
* @internal
*/
public webglNumPoints: number;
/**
* @private
* @internal
*/
public _vbuffer: WebGLBuffer;
/**
* @private
* @internal
*/
public _prog: WebGLProgram;
/**
* @private
* @internal
*/
public _coord: number;
/**
* @internal
*/
constructor() {
this.scaleX = 1;
this.scaleY = 1;
this.offsetX = 0;
this.offsetY = 0;
this.loop = false;
this._vbuffer = 0;
this._prog = 0;
this._coord = 0;
this.visible = true;
this.intensity = 1;
}
}