2 #include "ScopeOverlayResonanceSW.h"
3 #include "ScopeImage.h"
4 #include "ScopeMultiImageResonanceSW.h"
16 std::lock_guard<std::mutex> lock(
mutex);
17 assert( (_color_props.size() == _multi->Channels()) && (
lines==_multi->Lines()) && (
linewidth==_multi->Linewidth()) );
21 for (
size_t ch = 0 ; ch < _multi->Channels() ; ch++ ) {
22 ScopeImageU16CPtr chimage = _multi->GetChannel(ch);
23 if ( _color_props.at(ch).Color() != None ) {
24 ColorEnum col = _color_props.at(ch).Color();
25 uint16_t ll = _color_props.at(ch).LowerLimit();
26 uint16_t ul = _color_props.at(ch).UpperLimit();
34 for ( uint32_t l = 0; l <
lines; l+= 2 ) {
36 std::transform(std::begin(
overlay)+l*linewidth, std::begin(
overlay)+(l+1)*linewidth, it, std::begin(
overlay)+l*linewidth, [&](
BGRA8Pixel& pix,
const uint16_t& gray) {
37 return pix + U16ToBGRA8Histo(gray, col, ll, ul);
40 std::transform(std::begin(
overlay)+(l+1)*linewidth, std::begin(
overlay)+(l+2)*linewidth, it, std::begin(
overlay)+(l+1)*linewidth, [&](
BGRA8Pixel& pix,
const uint16_t& gray) {
41 return pix + U16ToBGRA8Histo(gray, col, ll, ul);
ScopeOverlayResonanceSW(const uint32_t &_lines=0, const uint32_t &_linewidth=0)
overlay will be initialized with 0s
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
Overlay of several gray-scale/uint16_t channels into one BGRA8 image.
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...
virtual void Create(ScopeMultiImageResonanceSWCPtr const _multi, const std::vector< ColorProps > &_color_props)
Creates an overlay from a multi image with the specified color properties per channel.
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.