Scope
scope::gui::CHistogramView Class Reference

#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
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

Member Function Documentation

void scope::gui::CHistogramView::SetLimits ( )
protected

Set limits in renderer and scope_controller.

Definition at line 123 of file HistogramView.cpp.

void scope::gui::CHistogramView::UpdateHistogramFrame ( )
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...)

void scope::gui::CHistogramView::OnFinalMessage ( HWND  )
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.

LRESULT scope::gui::CHistogramView::OnEraseBkgnd ( HDC  wParam)
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.

uint16_t scope::gui::CHistogramView::LowerLimit ( const uint32_t &  _ch) const
inline

Render histogram and limit bars.

Definition at line 136 of file HistogramView.h.

Member Data Documentation

const uint32_t scope::gui::CHistogramView::width = 512
staticprotected

static constant width of the histogram renderer

Definition at line 26 of file HistogramView.h.

const uint32_t scope::gui::CHistogramView::area
protected

for which area

Definition at line 29 of file HistogramView.h.

const uint32_t scope::gui::CHistogramView::channels
protected

how many channels

Definition at line 32 of file HistogramView.h.

uint16_t scope::gui::CHistogramView::range
protected

what uin16_t histogram range is used

Definition at line 35 of file HistogramView.h.

ScopeController scope::gui::CHistogramView::scope_controller
protected

the ScopeController kept handy here

Definition at line 38 of file HistogramView.h.

SCOPE_MULTIIMAGECPTR_T scope::gui::CHistogramView::current_frame
protected

image corresponding to the currently displayed histogram

Definition at line 41 of file HistogramView.h.

ScopeMultiHistogramPtr scope::gui::CHistogramView::current_histogram
protected

currently displayed histogram

Definition at line 44 of file HistogramView.h.

std::vector<uint16_t> scope::gui::CHistogramView::lower_limits
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.

std::vector<uint16_t> scope::gui::CHistogramView::upper_limits
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.

d2d::D2HistogramRender scope::gui::CHistogramView::renderer
protected

this one handles all of the Views rendering

Definition at line 53 of file HistogramView.h.

std::vector<bool> scope::gui::CHistogramView::dragginglower
protected

Keeps track of mouse dragging which lower limit.

Definition at line 56 of file HistogramView.h.

std::vector<bool> scope::gui::CHistogramView::draggingupper
protected

Keeps track of mouse dragging which upper limit.

Definition at line 59 of file HistogramView.h.

std::vector<FLOAT> scope::gui::CHistogramView::llpos
protected

Keeps track of the lower limit positions in screen coordinates/histogram array index.

Definition at line 62 of file HistogramView.h.

std::vector<FLOAT> scope::gui::CHistogramView::ulpos
protected

Keeps track of the upper limit positions in screen coordinates/histogram array index.

Definition at line 65 of file HistogramView.h.


The documentation for this class was generated from the following files: