BufferSave.h 722 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef BUFFERSAVE_H
#define BUFFERSAVE_H
#include <string>
#include <fstream>
#include "FrameBuilder.h"

namespace lima {


#define EDF_HEADER_LEN		1024
#define EDF_HEADER_BUFFER_LEN	(10 * EDF_HEADER_LEN)


typedef struct FrameInfo {
	unsigned long acq_frame_nb;
	void *frame_ptr;
	int width, height, depth;
	double frame_time_stamp;
} FrameInfoType;


enum FileFormat {
	FMT_RAW,
	FMT_EDF,
};


class BufferSave {
  public :
kirov's avatar
kirov committed
30
31
	std::string m_prefix;
	enum FileFormat m_format;
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

	BufferSave( const std::string &prefix, enum FileFormat format );
	~BufferSave( );

	int writeFrame( FrameInfoType &finfo );

  private:
	int writeEdfHeader( const FrameInfoType &finfo, std::ofstream &file );

};


}

#endif /* BUFFERSAVE_H */