runMACS
 All Data Structures Files Functions Variables Enumerations Enumerator Macros
StatsExtractor.h
Go to the documentation of this file.
1 #ifndef STATS_EXTRACTOR_H
2 #define STATS_EXTRACTOR_H
3 
4 #include <Extractor.h>
5 #include <utils.h>
6 
7 class StatsExtractor : public Extractor {
8 public:
9  StatsExtractor(zmq::context_t & _ctx,
10  const PubSubEndpoint & _source,
11  const PubSubEndpoint & _destination,
12  const std::string & _identifier);
14  std::string type();
15  std::string identifier();
16  std::list<std::string> parameters();
17 private:
18  void extractSetup();
19  void extractImpl(unsigned int _width,
20  unsigned int _height,
21  unsigned int _bytesPerPixel,
22  uint64_t highResTime,
23  uint64_t wallTime,
24  zmq::message_t * sourceImage);
25  void extractTeardown();
26 
27  void sendStatus();
28  void sendHist();
29  void sendBlueness(double blueness);
30 
31  std::string s_identifier;
32  unsigned int max, min, avg;
33 
34  uint32_t *hist;
35  PubSubEndpoint destination;
36  zmq::socket_t *destinationSocket;
37 
38  uint32_t sensorBits;
39  uint32_t histBits;
40  uint32_t histCount;
41  uint32_t bitShift;
42  uint32_t bitMask;
43 
44  class CalAvgData {
45  public:
46  double * calData;
47  double dark;
49  double * acc;
50  template <typename T> void accumulate(T* data, unsigned int w, unsigned int h);
51  };
52 
53  CalAvgData blHigh;
54  CalAvgData blLow;
55  bool haveCalAvg;
56 
57  std::string hdrText;
58  std::string hdrBluenessText;
59 };
60 
61 #endif /* STATS_EXTRACTOR_H */
StatsExtractor(zmq::context_t &_ctx, const PubSubEndpoint &_source, const PubSubEndpoint &_destination, const std::string &_identifier)
Base class for an image extractor.
Definition: Extractor.h:17
std::list< std::string > parameters()
std::string type()
std::string identifier()