Scope
ScopeHistogram.h
1 #pragma once
2 
3 #include "ScopeImage.h"
4 #include "ScopeDatatypes.h"
5 
6 namespace scope {
7 
10 
11 protected:
13  mutable std::mutex mutex;
14 
16  const uint16_t range;
17 
19  double binsize;
20 
22  std::vector<uint32_t> hist;
23 
24 public:
26  ScopeHistogram(const uint32_t& _no_of_bins = 512, const uint16_t& _range = UINT16_MAX);
27 
29  ScopeHistogram(const ScopeHistogram& _h);
30 
32  double Binsize() const;
33 
37  void Calculate(ScopeImageU16CPtr const _img, const bool& _loghistogram = false);
38 
41  void Resize(const uint32_t& _no_of_bins);
42 
44  uint32_t MaxCount() const;
45 
47  uint16_t FirstCountPosition() const;
48 
50  uint16_t LastCountPosition() const;
51 
54  const std::vector<uint32_t>* GetHistConst() const;
55 
57  void ReleaseHistConst() const;
58 };
59 
61 typedef std::shared_ptr<ScopeHistogram> ScopeHistogramPtr;
62 
63 }
A histogram for a uint16_t image with uint32_t counts.
Definition: ScopeHistogram.h:9
const uint16_t range
range of uint16 to do histogram of
double Binsize() const
uint16_t FirstCountPosition() const
double binsize
size of each bin
void ReleaseHistConst() const
In here all declarations for all kinds of datatypes Scope needs.
uint16_t LastCountPosition() const
std::vector< uint32_t > hist
data vector
const std::vector< uint32_t > * GetHistConst() const
ScopeHistogram(const uint32_t &_no_of_bins=512, const uint16_t &_range=UINT16_MAX)
Initialize to binsize 1 (histogram size is thus UINT16_MAX+1) and zero counts.
void Resize(const uint32_t &_no_of_bins)
Resize the histogram to a new number of bins.
void Calculate(ScopeImageU16CPtr const _img, const bool &_loghistogram=false)
Calculate the histogram.
std::mutex mutex
for data protection
uint32_t MaxCount() const