Scope
ScopeMultiImage.h
1 #pragma once
2 
3 // Forward declarations
4 namespace scope {
5 template<class T>class ScopeImage;
6 typedef std::shared_ptr<ScopeImage<uint16_t>> ScopeImageU16Ptr;
7 }
8 
9 namespace scope {
10 
13 
14 protected:
16  const uint32_t area;
17 
19  const size_t nochannels;
20 
22  const uint32_t lines;
23 
25  const uint32_t linewidth;
26 
28  std::vector<ScopeImageU16Ptr> channels;
29 
31  uint32_t avg_count;
32 
34  uint32_t avg_max;
35 
38 
40  uint32_t imagenumber;
41 
44 
47 
48 public:
50  ScopeMultiImage(const uint32_t& _area = 0, const size_t& _nochannels = 1, const uint32_t& _lines = 256, const uint32_t& _linewidth = 256);
51 
54  uint32_t Area() const { return area; }
55  size_t Channels() const { return nochannels; }
56  uint32_t Lines() const { return lines; }
57  uint32_t Linewidth() const { return linewidth; }
58  uint32_t Pixels() const { return lines*linewidth; }
59 
63  uint16_t GetPixel(const size_t& _ch, const uint32_t& _x, const uint32_t& _y) const;
64 
67  std::vector<uint16_t> GetMultiPixel(const uint32_t& _x, const uint32_t& _y) const;
68 
70  ScopeImageU16Ptr GetChannel(const size_t& chan) const;
71 
72  uint32_t GetAvgCount() const { return avg_count; }
73 
74  uint32_t GetAvgMax() const { return avg_max; }
75 
76  uint32_t GetImageNumber() const { return imagenumber; }
77 
78  bool IsCompleteFrame() const { return complete_frame; }
79 
80  bool IsCompleteAvg() const { return complete_avg; }
81 
82  double PercentComplete() const { return percent_complete; }
91  void SetChannel(const size_t& _chan, ScopeImageU16Ptr const _newimg);
92 
94  void SetAvgCount(const uint32_t& _avg_count);
95 
97  void SetAvgMax(const uint32_t& _avg_max);
98 
100  void SetImageNumber(const uint32_t& _imagenumber) { imagenumber = _imagenumber; }
101 
103  void SetCompleteFrame(const bool& _complete);
104 
106  void SetCompleteAvg(const bool& _complete);
107 
109  void SetPercentComplete(const double& _percent);
113  void FillRandom();
114 };
115 
117 typedef std::shared_ptr<ScopeMultiImage> ScopeMultiImagePtr;
119 typedef std::shared_ptr<const ScopeMultiImage> ScopeMultiImageCPtr;
120 }
void SetCompleteAvg(const bool &_complete)
Sets complete average.
bool complete_frame
false if frame not complete, allows for partial display during acquisition
uint32_t imagenumber
number of this image
void FillRandom()
Fills the multi image with random data.
ScopeImageU16Ptr GetChannel(const size_t &chan) const
std::vector< uint16_t > GetMultiPixel(const uint32_t &_x, const uint32_t &_y) const
const uint32_t linewidth
the linewidth (x-resolution)
void SetCompleteFrame(const bool &_complete)
Sets frame complete.
const uint32_t lines
number of lines (y-resolution)
void SetImageNumber(const uint32_t &_imagenumber)
Sets the number of this image.
uint32_t avg_count
this image is the xth average
ScopeMultiImage(const uint32_t &_area=0, const size_t &_nochannels=1, const uint32_t &_lines=256, const uint32_t &_linewidth=256)
Initializes and generate blank images for each channel.
void SetPercentComplete(const double &_percent)
Sets percent complete.
void SetChannel(const size_t &_chan, ScopeImageU16Ptr const _newimg)
Replaces one channel of the multiimage.
bool complete_avg
false if this is a not completely averaged frame, this is then only for display purpose and will not ...
const uint32_t area
the area from which the multi image comes
const size_t nochannels
number of channels
A multichannel image.
void SetAvgMax(const uint32_t &_avg_max)
Sets the maximum average count.
std::vector< ScopeImageU16Ptr > channels
the ScopeImages that contain the data for each channel
void SetAvgCount(const uint32_t &_avg_count)
Sets the average count of this image.
double percent_complete
how many percent of the frame are already filled
uint16_t GetPixel(const size_t &_ch, const uint32_t &_x, const uint32_t &_y) const