2 #include "ScopeOverlay.h"
3 #include "ScopeImage.h"
4 #include "ScopeMultiImage.h"
13 , linewidth(_linewidth)
14 , overlay(_lines*_linewidth, 0) {
15 assert( _lines!=0 && _linewidth!=0 );
19 std::lock_guard<std::mutex> lock(
mutex);
20 assert( (_color_props.size() == _multi->Channels()) && (
lines==_multi->Lines()) && (
linewidth==_multi->Linewidth()) );
24 for (
size_t ch = 0 ; ch < _multi->Channels() ; ch++ ) {
25 ScopeImageU16CPtr chimage = _multi->GetChannel(ch);
26 if ( _color_props.at(ch).Color() != None ) {
27 ColorEnum col = _color_props.at(ch).Color();
28 uint16_t ll = _color_props.at(ch).LowerLimit();
29 uint16_t ul = _color_props.at(ch).UpperLimit();
36 return pix + U16ToBGRA8Histo(gray, col, ll, ul);
59 std::lock_guard<std::mutex> lock(
mutex);
60 FLOAT h = _d2bitmap->GetSize().height;
61 FLOAT w = _d2bitmap->GetSize().width;
62 assert( (_d2bitmap->GetSize().height ==
lines) && (_d2bitmap->GetSize().width ==
linewidth) );
67 assert( _lines!=0 && _linewidth!=0 );
68 std::lock_guard<std::mutex> lock(
mutex);
75 std::lock_guard<std::mutex> lock(
mutex);
80 std::lock_guard<std::mutex> lock(
mutex);
void ToD2Bitmap(ID2D1Bitmap *const _d2bitmap) const
uint32_t Linewidth() const
virtual void Create(ScopeMultiImageCPtr const _multi, const std::vector< ColorProps > &_color_props)
Creates an overlay from a multi image with the specified color properties per channel.
Encapsulated a 4-byte pixel in BGRA format for use with Direct2D.
#define BGRA8BLACK
An opaque black.
std::vector< BGRA8Pixel > overlay
vector with pixeldata
uint32_t lines
number of lines, y resolution
uint32_t linewidth
width of a line, x resolution
The BGRA8Pixel struct and various related helpers for color conversions.
This is the include file for standard system include files, or project specific include files that ar...
ScopeOverlay(const uint32_t &_lines=0, const uint32_t &_linewidth=0)
overlay will be initialized with 0s
void Resize(const uint32_t &_lines, const uint32_t &_linewidth)
const std::vector< T > * GetConstData() const
following http://www.mochima.com/articles/LUT/lut_h.html
Various helper functions and classes for Scope.
std::mutex mutex
mutex for protection
Gives RAII safe const access (read-only) to the pixeldata of a ScopeImage.