Scope
|
#include <ScopeOverlay.h>
Inherited by scope::ScopeOverlayResonanceSW.
Public Member Functions | |
ScopeOverlay (const uint32_t &_lines=0, const uint32_t &_linewidth=0) | |
virtual void | Create (ScopeMultiImageCPtr const _multi, const std::vector< ColorProps > &_color_props) |
void | ToD2Bitmap (ID2D1Bitmap *const _d2bitmap) const |
void | Resize (const uint32_t &_lines, const uint32_t &_linewidth) |
uint32_t | Lines () const |
uint32_t | Linewidth () const |
Protected Attributes | |
uint32_t | lines |
uint32_t | linewidth |
std::vector< BGRA8Pixel > | overlay |
std::mutex | mutex |
Overlay of several gray-scale/uint16_t channels into one BGRA8 image.
Thread-safe.
Definition at line 17 of file ScopeOverlay.h.
scope::ScopeOverlay::ScopeOverlay | ( | const uint32_t & | _lines = 0 , |
const uint32_t & | _linewidth = 0 |
||
) |
overlay will be initialized with 0s
[in] | _lines | initial y resolution |
[in] | _linewidth | initial x resolution |
Definition at line 11 of file ScopeOverlay.cpp.
|
virtual |
Creates an overlay from a multi image with the specified color properties per channel.
[in] | _multi | the multi image to create overlay from |
[in] | _color_props | the vector with the ColorProps for each channel |
Alternative incarnations I had tried out... ~ 230 ms for 1024x1024 uint32_t size = overlay.size(); for ( uint32_t i = 0 ; i < size ; i++ ) overlay[i] += U16ToBGRA8Histo(pixel->at(i), col, ll, ul);
~1000ms for 1024x1024 This is 4x slower than the simple for loop (why?) auto itch = chimage->GetDataBeginConst(); std::for_each(std::begin(overlay), std::end(overlay), [&](BGRA8Pixel& pix) { pix += U16ToBGRA8Histo(*itch++, col, ll, ul); } ); several seconds (why??? to much overhead???) concurrency::parallel_transform(std::begin(overlay), std::end(overlay), it, std::begin(overlay), [&](BGRA8Pixel& pix, const uint16_t& gray) { return pix + U16ToBGRA8Histo(gray, col, ll, ul); } );
Definition at line 18 of file ScopeOverlay.cpp.
void scope::ScopeOverlay::ToD2Bitmap | ( | ID2D1Bitmap *const | _d2bitmap | ) | const |
[in] | _d2bitmap | pointer to the Direct2D bitmap to fill with the overlay |
Definition at line 58 of file ScopeOverlay.cpp.
void scope::ScopeOverlay::Resize | ( | const uint32_t & | _lines, |
const uint32_t & | _linewidth | ||
) |
[in] | _lines,_linewidth | new size |
Definition at line 66 of file ScopeOverlay.cpp.
uint32_t scope::ScopeOverlay::Lines | ( | ) | const |
Definition at line 74 of file ScopeOverlay.cpp.
uint32_t scope::ScopeOverlay::Linewidth | ( | ) | const |
Definition at line 79 of file ScopeOverlay.cpp.
|
protected |
number of lines, y resolution
Definition at line 21 of file ScopeOverlay.h.
|
protected |
width of a line, x resolution
Definition at line 24 of file ScopeOverlay.h.
|
protected |
vector with pixeldata
Definition at line 27 of file ScopeOverlay.h.
|
mutableprotected |
mutex for protection
Definition at line 30 of file ScopeOverlay.h.