Implement Histogram

Basic pass at histogram. Uses a power based
scale compared against the total pixel count.
Probably needs a UI toggle to flip lines on
and off as the text and lines in OpenGL are
a large cycles sucker. Could be likely much
faster when migrated to a geometry shader
approach. Uses the scaled viewport resolution
to increase performance as much as possible.
This commit is contained in:
Troy James Sobotka
2020-05-19 00:07:34 -07:00
parent 3518a10230
commit 6ebe0084a3
8 changed files with 314 additions and 48 deletions
+6 -5
View File
@@ -76,12 +76,13 @@ void WaveformScope::DrawScope()
waveform_start_dim_x, waveform_start_dim_y,
waveform_end_dim_x, waveform_end_dim_y);
float waveform_start_uv_x = waveform_start_dim_x / width();
float waveform_start_uv_y = waveform_start_dim_y / height();
float waveform_end_uv_x = waveform_end_dim_x / width();
float waveform_end_uv_y = waveform_end_dim_y / height();
float waveform_start_uv_x = (waveform_start_dim_x - 1.0) / (width() - 1.0);
float waveform_start_uv_y = (waveform_start_dim_y - 1.0) / (height() - 1.0);
float waveform_end_uv_x = (waveform_end_dim_x - 1.0) / (width() - 1.0);
float waveform_end_uv_y = (waveform_end_dim_y - 1.0) / (height() - 1.0);
pipeline()->setUniformValue(
"waveform_uv",
"waveform_region_uv",
waveform_start_uv_x, waveform_start_uv_y,
waveform_end_uv_x, waveform_end_uv_y);