2 #include "ScopeMultiHistogram.h"
3 #include "ScopeHistogram.h"
4 #include "ScopeMultiImage.h"
12 std::generate(std::begin(
hists), std::end(
hists), [&]() {
13 return std::make_shared<ScopeHistogram>(_no_of_bins, _range); } );
17 assert(
hists.size() == _multi->Channels());
18 for (
size_t c = 0 ; c <
hists.size() ; c++ )
19 hists.at(c)->Calculate(_multi->GetChannel(c), _loghistogram);
23 std::for_each(std::begin(
hists), std::end(
hists), [&](ScopeHistogramPtr h) {
24 h->Resize(_no_of_bins); } );
28 std::vector<uint32_t> counts(
hists.size(), 0);
29 std::transform(std::begin(counts), std::end(counts), std::begin(
hists), std::begin(counts), [](
const uint32_t& c, ScopeHistogramPtr h) {
30 return h->MaxCount(); } );
35 std::vector<uint16_t> positions(
hists.size(), 0);
36 std::transform(std::begin(positions), std::end(positions), std::begin(
hists), std::begin(positions), [](
const uint32_t& c, ScopeHistogramPtr h) {
37 return h->FirstCountPosition(); } );
42 std::vector<uint16_t> positions(
hists.size(), 0);
43 std::transform(std::begin(positions), std::end(positions), std::begin(
hists), std::begin(positions), [](
const uint32_t& c, ScopeHistogramPtr h) {
44 return h->LastCountPosition(); } );
49 return hists.at(_c)->GetHistConst();
53 hists.at(_c)->ReleaseHistConst();
void Calculate(ScopeMultiImageCPtr const _multi, const bool &_loghistogram=false)
const std::vector< uint32_t > * GetHistConst(const uint32_t &_c) const
This is the include file for standard system include files, or project specific include files that ar...
std::vector< uint16_t > LastCountPositions() const
std::vector< uint16_t > FirstCountPositions() const
std::vector< ScopeHistogramPtr > hists
vector with histograms for each channel
std::vector< uint32_t > MaxCounts() const
ScopeMultiHistogram(const uint32_t &_area=0, const uint32_t &_channels=1, const uint32_t &_no_of_bins=512, uint16_t _range=UINT16_MAX)
Initialize all channels.
void Resize(const uint32_t &_no_of_bins)
Resize the multi histogram to a new number of bins.
void ReleaseHistConst(const uint32_t &_c) const