2 #include "ScopeImage.h"
9 ScopeImageAccessU16 imagedata(*_img);
12 assert(_where + std::distance(_from, _to) <= imagedata.GetData()->end() );
16 _where = std::copy( _from, _to, _where);
18 if ( _where == imagedata.GetData()->end() )
24 bool InsertAndAveragePixels(ScopeImageU16Ptr
const _img, std::vector<uint16_t>::iterator& _where,
const DaqChunk::iterator _from,
const DaqChunk::iterator _to,
const uint16_t& _currentavgcount) {
25 assert(_currentavgcount < UINT16_MAX>>1);
29 ScopeImageAccessU16 imagedata(*_img);
31 uint32_t halfdivisor = 1;
32 uint32_t multiplier = 0;
33 if ( _currentavgcount > 0 ) {
34 multiplier = _currentavgcount;
35 divisor = _currentavgcount + 1;
36 halfdivisor = divisor >> 2;
41 _where = std::transform(_from, _to, _where, _where, [&](
const uint16_t& daqch,
const uint16_t& i) {
42 n = (
static_cast<uint32_t
>(i) * multiplier) +
static_cast<uint32_t
>(daqch);
43 return static_cast<uint16_t
>( n / divisor + ((n%divisor)>halfdivisor?1u:0u) ); } );
45 if ( _where == imagedata.GetData()->end() ) {
47 _where = imagedata.GetData()->begin();
std::vector< uint16_t >::iterator iterator
Iterator over the data vector.
This is the include file for standard system include files, or project specific include files that ar...