test.cpp 791 Bytes
Newer Older
1
#include <vector>
kirov's avatar
kirov committed
2
#include <exception>
3
4
#include "FrameBuilder.h"
#include "BufferSave.h"
kirov's avatar
kirov committed
5
6
#include "SizeUtils.h"
#include "Exceptions.h"
7
#include "AutoObj.h"
8
9
10
11
12
13

using namespace std;
using namespace lima;

int main( void )
{
kirov's avatar
kirov committed
14
	FrameBuilder fb;
15

16
17
18
	FrameDim full_fd;
	fb.getFrameDim(full_fd);
	
19
	Bin bin = Bin(2,2);
kirov's avatar
kirov committed
20
	fb.setBin(bin);
21
22
23
24
25
26
27
28
29
30
31

	FrameDim fd = full_fd / bin;
	
	BufferSave bs(BufferSave::EDF, "boza");
	bs.setTotFileFrames(5);

	int size = fd.getMemSize();
	AutoPtr<unsigned char, true> buffer;
	buffer = new unsigned char[size];

	Timestamp start = Timestamp::now();
32

33
	for( int i=0; i<10; i++ ) {
34
		int frame_nb = fb.getFrameNr();
kirov's avatar
kirov committed
35
		fb.getNextFrame( buffer );
36

37
38
		Timestamp t = Timestamp::now() - start;
		FrameInfoType finfo(frame_nb, buffer, &fd, t);
39
40
41
42
43
		bs.writeFrame(finfo);
	}

	return 0;
}