Scope
|
#include <D2HistogramRender.h>
Public Member Functions | |
D2HistogramRender (const uint32_t &_width, const uint32_t &_channels, scope::ScopeMultiHistogramPtr _hist) | |
~D2HistogramRender () | |
void | Create (const HWND &_hwnd) |
void | SetHistogram (scope::ScopeMultiHistogramPtr _hist) |
void | Render () |
void | Size (const CSize &size) |
bool | ClickedAt (const CPoint _clickpoint, uint32_t &_channel, bool &_uplo) |
void | SetLowerLimitPosition (const uint32_t &_channel, const FLOAT &_pos) |
void | SetUpperLimitPosition (const uint32_t &_channel, const FLOAT &_pos) |
Protected Member Functions | |
void | DiscardDeviceResources () |
D2HistogramRender (const D2HistogramRender &) | |
D2HistogramRender | operator= (const D2HistogramRender &) |
Protected Attributes | |
std::mutex | mutex |
const uint32_t | width |
const uint32_t | channels |
std::unique_ptr< RenderTarget > | render_target |
ID2D1SolidColorBrush * | brushwhite |
ID2D1SolidColorBrush * | brushred |
ID2D1SolidColorBrush * | brushyellow |
HWND | hwnd |
std::vector< FLOAT > | llpos |
std::vector< FLOAT > | ulpos |
scope::ScopeMultiHistogramPtr | hist |
Handles all Direct2D rendering in a CHistogramView.
Renders a histogram made up of single lines. Its size is fixed to 'width'. Also renders and repositions limit lines. Also can test for click hits on limit lines. All mutex protected.
Definition at line 16 of file D2HistogramRender.h.
|
protected |
Disable copy.
d2d::D2HistogramRender::D2HistogramRender | ( | const uint32_t & | _width, |
const uint32_t & | _channels, | ||
scope::ScopeMultiHistogramPtr | _hist | ||
) |
Initialize all to nullptr.
Definition at line 8 of file D2HistogramRender.cpp.
d2d::D2HistogramRender::~D2HistogramRender | ( | ) |
Discard device resources.
Definition at line 21 of file D2HistogramRender.cpp.
|
protected |
Safely release all Direct2D resources.
Definition at line 25 of file D2HistogramRender.cpp.
|
protected |
Disable assignment.
void d2d::D2HistogramRender::Create | ( | const HWND & | _hwnd | ) |
Creates the render target for a hwnd, the brushes for painting, and sets the limit position to the window edges.
Definition at line 31 of file D2HistogramRender.cpp.
void d2d::D2HistogramRender::SetHistogram | ( | scope::ScopeMultiHistogramPtr | _hist | ) |
Sets the pointer to the current multi histogram.
Definition at line 49 of file D2HistogramRender.cpp.
void d2d::D2HistogramRender::Render | ( | ) |
Draws the current multi histogram with the limit lines.
Definition at line 54 of file D2HistogramRender.cpp.
void d2d::D2HistogramRender::Size | ( | const CSize & | size | ) |
Resizes the renderer and the limit positions.
Definition at line 144 of file D2HistogramRender.cpp.
bool d2d::D2HistogramRender::ClickedAt | ( | const CPoint | _clickpoint, |
uint32_t & | _channel, | ||
bool & | _uplo | ||
) |
Checks if click hit a limit (+-5 pixel) and if yes, on which channel and upper or lower limit line.
[in] | _clickpoint | the point (in window coordinates) to test |
[out] | _channel | histogram of which channel was hit |
[out] | _uplo | if lower limit was hit false, if upper limit line was hit true |
Definition at line 99 of file D2HistogramRender.cpp.
void d2d::D2HistogramRender::SetLowerLimitPosition | ( | const uint32_t & | _channel, |
const FLOAT & | _pos | ||
) |
Set position of a lower limit line.
Definition at line 134 of file D2HistogramRender.cpp.
void d2d::D2HistogramRender::SetUpperLimitPosition | ( | const uint32_t & | _channel, |
const FLOAT & | _pos | ||
) |
Set position of an upper limit line.
Definition at line 139 of file D2HistogramRender.cpp.
|
mutableprotected |
mutex for protection
Definition at line 20 of file D2HistogramRender.h.
|
protected |
constant width of the renderer
Definition at line 23 of file D2HistogramRender.h.
|
protected |
number of channels
Definition at line 26 of file D2HistogramRender.h.
|
protected |
Direct2D render target.
Definition at line 29 of file D2HistogramRender.h.
|
protected |
Direct2D white brush.
Definition at line 32 of file D2HistogramRender.h.
|
protected |
Direct2D red brush.
Definition at line 35 of file D2HistogramRender.h.
|
protected |
Direct2D yellow brush.
Definition at line 38 of file D2HistogramRender.h.
|
protected |
windows handle
Definition at line 41 of file D2HistogramRender.h.
|
protected |
Keeps track of the lower limit positions in screen coordinates.
Definition at line 44 of file D2HistogramRender.h.
|
protected |
Keeps track of the upper limit positions in screen coordinates.
Definition at line 47 of file D2HistogramRender.h.
|
protected |
Pointer to the currently rendered multi histogram.
Definition at line 50 of file D2HistogramRender.h.