Add profiling with Remotery
This commit is contained in:
parent
c37be6798f
commit
6331a2bf79
50 changed files with 16864 additions and 11 deletions
61
vis/Code/PixelTimeRange.js
Normal file
61
vis/Code/PixelTimeRange.js
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
|
||||
class PixelTimeRange
|
||||
{
|
||||
constructor(start_us, span_us, span_px)
|
||||
{
|
||||
this.Span_px = span_px;
|
||||
this.Set(start_us, span_us);
|
||||
}
|
||||
|
||||
Set(start_us, span_us)
|
||||
{
|
||||
this.Start_us = start_us;
|
||||
this.Span_us = span_us;
|
||||
this.End_us = this.Start_us + span_us;
|
||||
this.usPerPixel = this.Span_px / this.Span_us;
|
||||
}
|
||||
|
||||
SetStart(start_us)
|
||||
{
|
||||
this.Start_us = start_us;
|
||||
this.End_us = start_us + this.Span_us;
|
||||
}
|
||||
|
||||
SetEnd(end_us)
|
||||
{
|
||||
this.End_us = end_us;
|
||||
this.Start_us = end_us - this.Span_us;
|
||||
}
|
||||
|
||||
SetPixelSpan(span_px)
|
||||
{
|
||||
this.Span_px = span_px;
|
||||
this.usPerPixel = this.Span_px / this.Span_us;
|
||||
}
|
||||
|
||||
PixelOffset(time_us)
|
||||
{
|
||||
return Math.floor((time_us - this.Start_us) * this.usPerPixel);
|
||||
}
|
||||
|
||||
PixelSize(time_us)
|
||||
{
|
||||
return Math.floor(time_us * this.usPerPixel);
|
||||
}
|
||||
|
||||
TimeAtPosition(position)
|
||||
{
|
||||
return this.Start_us + position / this.usPerPixel;
|
||||
}
|
||||
|
||||
Clone()
|
||||
{
|
||||
return new PixelTimeRange(this.Start_us, this.Span_us, this.Span_px);
|
||||
}
|
||||
|
||||
SetAsUniform(gl, program)
|
||||
{
|
||||
glSetUniform(gl, program, "inTimeRange.usStart", this.Start_us);
|
||||
glSetUniform(gl, program, "inTimeRange.usPerPixel", this.usPerPixel);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue