VAT  3.0
Video Analysis Tool
ImageHeader.h
1 // This file contains the prototypes of functions reading
2 // a jpeg header (Application marker segment) and
3 // converting it in TimeStamp instances.
4 
5 #ifndef __IMAGE_HEADER_H__
6 #define __IMAGE_HEADER_H__
7 
8 #include <QString>
9 #include "TimeStamp.h"
10 
11 class ImageHeader {
12  public:
13  ImageHeader();
14  ~ImageHeader();
15 
16  static int days_per_month[12];
17 
18  QString jpeg_header_string; //Stores header as string. Empty string
19  //if not present.
20  QString m_camId;
21  TimeStamp ts; // Stores current image time stamp
22  bool ts_present; // Indicates if the timestamp is present in images
23  int ts_diff; // Default milliseconds difference between frames
24  // set if no timestamp is found. The value comes from a
25  // manually defined parameter (see AcquisitionModule)
26  // Opens filename file and reads its header (Application marker segment,
27  // it starts after a FF E0).
28  // This header is given back as string. If something goes wrong, empty
29  // string is given back.
30  void readJpegHeader(QString& filename);
31 
32  // Takes the jpeg header (given by function readJpegHeader) and converts
33  // it into a TimeStamp instance. Camera Id is given back in CamId string.
34  // If something goes wrong, ts_present is set to false.
35  void jpegHeaderConvert(QString header, QString& camId);
36 
37 
38  //Set values for representing a null header
39  void setNullHeader();
40 
41  // Writes the jpeg_header_string with the data in the parameters.
42  // First input parameter is the milliseconds increment per frame.
43  // Second one is the camera ID (on 3 bytes + '\0')
44  // Time, date and framecount are automatically generated.
45  // y,m,d,hh,mm,ss,mss,frm are the starting values for time, date and frame count.
46  // They are used only the first call (the others uses ms_increment_per_frame to
47  // compute the new time/date
48  void jpegHeaderStringAutomaticGeneration(
49  QString& header,
50  double ms_increment_per_frame,
51  QString& camera_id,
52  int y, int m, int d,
53  int hh, int mm, int ss, double mss, int frm);
54 
55 };
56 
57 #endif // __IMAGE_HEADER_H__
Definition: ImageHeader.h:11
Definition: TimeStamp.h:4