Scope
|
#include <HistogramView.h>
Inherits CWindowImpl< CHistogramView >.
Public Member Functions | |
CHistogramView (const uint32_t &_area, const uint32_t &_channels, uint16_t _range) | |
DECLARE_WND_CLASS_EX (nullptr, CS_HREDRAW|CS_VREDRAW,-1) | |
Called via Win32 messages | |
BOOL | PreTranslateMessage (MSG *pMsg) |
virtual void | OnFinalMessage (HWND) |
void | OnShowWindow (BOOL bShow, UINT nStatus) |
void | OnLButtonDown (UINT nFlags, CPoint point) |
void | OnLButtonUp (UINT nFlags, CPoint point) |
void | OnMouseMove (UINT nFlags, CPoint point) |
LRESULT | OnEraseBkgnd (HDC wParam) |
void | OnPaint (CDCHandle) |
void | OnSize (UINT, CSize _size) |
void | OnDisplayChange (UINT, CSize) |
Called by CHistogramFrame | |
/** | |
void | Optimize () |
void | FullRange () |
void | SetCurrentFrame (SCOPE_MULTIIMAGECPTR_T const _multi, const bool &_loghisto) |
uint16_t | LowerLimit (const uint32_t &_ch) const |
uint16_t | UpperLimit (const uint32_t &_ch) const |
Protected Member Functions | |
void | SetLimits () |
void | UpdateHistogramFrame () |
Protected Attributes | |
const uint32_t | area |
const uint32_t | channels |
uint16_t | range |
ScopeController | scope_controller |
SCOPE_MULTIIMAGECPTR_T | current_frame |
ScopeMultiHistogramPtr | current_histogram |
std::vector< uint16_t > | lower_limits |
std::vector< uint16_t > | upper_limits |
d2d::D2HistogramRender | renderer |
std::vector< bool > | dragginglower |
std::vector< bool > | draggingupper |
std::vector< FLOAT > | llpos |
std::vector< FLOAT > | ulpos |
Static Protected Attributes | |
static const uint32_t | width = 512 |
CHistogramView is a holder for the renderer, calculates histograms, and takes care of window resizes and mouse/limit bar movements.
Definition at line 21 of file HistogramView.h.
scope::gui::CHistogramView::CHistogramView | ( | const uint32_t & | _area, |
const uint32_t & | _channels, | ||
uint16_t | _range | ||
) |
Initialize everything.
Definition at line 11 of file HistogramView.cpp.
|
protected |
Set limits in renderer and scope_controller.
Definition at line 123 of file HistogramView.cpp.
|
protected |
Update Histogram with current parameters.
Definition at line 138 of file HistogramView.cpp.
scope::gui::CHistogramView::DECLARE_WND_CLASS_EX | ( | nullptr | , |
CS_HREDRAW| | CS_VREDRAW, | ||
- | 1 | ||
) |
Set background brush to -1, avoids erasure of background (similar effect as OnEraseBkgnd below...)
|
virtual |
Do not do 'delete this;' because view is a member of frame and gets destroyed when frame is destroyed.
Definition at line 26 of file HistogramView.cpp.
void scope::gui::CHistogramView::OnShowWindow | ( | BOOL | bShow, |
UINT | nStatus | ||
) |
Create the renderer only now, because now the window is shown.
Definition at line 73 of file HistogramView.cpp.
void scope::gui::CHistogramView::OnLButtonDown | ( | UINT | nFlags, |
CPoint | point | ||
) |
Ask renderer for hit test and set click state.
Definition at line 29 of file HistogramView.cpp.
void scope::gui::CHistogramView::OnLButtonUp | ( | UINT | nFlags, |
CPoint | point | ||
) |
Releases click state.
Definition at line 44 of file HistogramView.cpp.
void scope::gui::CHistogramView::OnMouseMove | ( | UINT | nFlags, |
CPoint | point | ||
) |
If moving with left mouse button down, give position to Renderer and render limit bars.
Definition at line 50 of file HistogramView.cpp.
|
inline |
avoids flickering during resize
Definition at line 112 of file HistogramView.h.
void scope::gui::CHistogramView::OnPaint | ( | CDCHandle | ) |
Render the histogram and the limit bars (both via Renderer)
Definition at line 83 of file HistogramView.cpp.
void scope::gui::CHistogramView::OnSize | ( | UINT | , |
CSize | _size | ||
) |
Resize the Renderer accordingly, be careful not to resize to 0.
Definition at line 91 of file HistogramView.cpp.
void scope::gui::CHistogramView::Optimize | ( | ) |
Set lower limit to the first value with count >0 and the upper limit to the last value with count >0.
Optimizes dynamic range for display.
Definition at line 101 of file HistogramView.cpp.
void scope::gui::CHistogramView::FullRange | ( | ) |
Set lower and upper limits to full range.
Definition at line 113 of file HistogramView.cpp.
void scope::gui::CHistogramView::SetCurrentFrame | ( | scope::SCOPE_MULTIIMAGECPTR_T const | _multi, |
const bool & | _loghisto | ||
) |
Sets the current frame and calculates its histogram (either with regular count or with logarithmic counts)
Definition at line 145 of file HistogramView.cpp.
|
inline |
Render histogram and limit bars.
Definition at line 136 of file HistogramView.h.
|
staticprotected |
static constant width of the histogram renderer
Definition at line 26 of file HistogramView.h.
|
protected |
for which area
Definition at line 29 of file HistogramView.h.
|
protected |
how many channels
Definition at line 32 of file HistogramView.h.
|
protected |
what uin16_t histogram range is used
Definition at line 35 of file HistogramView.h.
|
protected |
the ScopeController kept handy here
Definition at line 38 of file HistogramView.h.
|
protected |
image corresponding to the currently displayed histogram
Definition at line 41 of file HistogramView.h.
|
protected |
currently displayed histogram
Definition at line 44 of file HistogramView.h.
|
protected |
lower limit values of all channels/the value that corresponds to histogram array index (because of range)
Definition at line 47 of file HistogramView.h.
|
protected |
upper limit values of all channels/the value that corresponds to histogram array index (because of range)
Definition at line 50 of file HistogramView.h.
|
protected |
this one handles all of the Views rendering
Definition at line 53 of file HistogramView.h.
|
protected |
Keeps track of mouse dragging which lower limit.
Definition at line 56 of file HistogramView.h.
|
protected |
Keeps track of mouse dragging which upper limit.
Definition at line 59 of file HistogramView.h.
|
protected |
Keeps track of the lower limit positions in screen coordinates/histogram array index.
Definition at line 62 of file HistogramView.h.
|
protected |
Keeps track of the upper limit positions in screen coordinates/histogram array index.
Definition at line 65 of file HistogramView.h.