Loading...
Searching...
No Matches

Detailed Description

An intensity accumulator for persistent displays (phosphor scopes, goniometers, spectrograms): hits add energy, decay() fades it, render() maps it to colours with a gamma.

Public Member Functions

void resize (int w, int h)
 
void clear ()
 
void decay (float factor)
 
void hit (double x, double y, float energy=1.f)
 
void line (double x0, double y0, double x1, double y1, float energy=1.f)
 
void buildGamma (float gamma)
 
template<typename F >
void map (float full, float gamma, F &&f)
 Calls f(row, x, level 0-255) for every pixel, full energy at 255.
 
void render (QColor color, float full, float gamma=0.5f)
 Maps the accumulator to color at full intensity for full energy.
 
void render (ColorMap cmap, float full, float gamma=0.5f)
 Maps the accumulator through a colour map.
 

Public Attributes

int width {}
 
int height {}
 
std::vector< float > acc
 
QImage image
 
std::array< uint8_t, levels+1 > gamma_lut {}
 Intensity level to 0-255 after the gamma, built when the gamma changes.
 
float lut_gamma {-1.f}
 

Static Public Attributes

static constexpr int levels = 1024
 Resolution of the intensities the gamma table maps.
 

Member Function Documentation

◆ line()

void Ui::Monitor::DensityImage::line ( double  x0,
double  y0,
double  x1,
double  y1,
float  energy = 1.f 
)
inline

A line of hits from (x0, y0) to (x1, y1), one per pixel step, sharing energy so that fast strokes are dimmer than slow ones, as on a CRT.


The documentation for this struct was generated from the following file: