CtBuffer.h 1.16 KB
Newer Older
papillon's avatar
 
papillon committed
1
2
3
4
#ifndef CTBUFFER_H
#define CTBUFFER_H

#include "Constants.h"
papillon's avatar
   
papillon committed
5
#include "SizeUtils.h"
papillon's avatar
   
papillon committed
6
#include "CtAcquisition.h"
papillon's avatar
   
papillon committed
7
#include "CtImage.h"
papillon's avatar
   
papillon committed
8
#include "HwInterface.h"
papillon's avatar
   
papillon committed
9
10
11
#include "HwFrameCallback.h"

#include "Data.h"
papillon's avatar
 
papillon committed
12
13
14

namespace lima {

papillon's avatar
   
papillon committed
15
16
17
18
19
20
21
22
23
24
class CtBufferFrameCB : public HwFrameCallback
{
    public:
	CtBufferFrameCB(CtControl *ct): m_ct(ct) {}
    protected:
        bool newFrameReady(const HwFrameInfoType& frame_info);
    private:
	CtControl *m_ct;
};

papillon's avatar
 
papillon committed
25
26
27
28
class CtBuffer {

    public:
	struct Parameters {
papillon's avatar
   
papillon committed
29
30
31
		Parameters();
		void reset();
		BufferMode mode;
papillon's avatar
 
papillon committed
32
33
34
35
		long	nbBuffers;
		short	maxMemory;
	};

papillon's avatar
   
papillon committed
36
	CtBuffer(HwInterface *hw);
papillon's avatar
 
papillon committed
37
38
	~CtBuffer();

papillon's avatar
   
papillon committed
39
40
41
	void setPars(Parameters pars);
	void getPars(Parameters& pars) const;

papillon's avatar
 
papillon committed
42
43
44
45
46
47
48
49
50
	void setMode(BufferMode mode);
	void getMode(BufferMode& mode) const;

	void setNumber(long nb_buffers);
	void getNumber(long& nb_buffers) const;

	void setMaxMemory(short max_memory);
	void getMaxMemory(short& max_memory) const;

papillon's avatar
   
papillon committed
51
52
53
54
	void registerFrameCallback(CtControl *ct);
        void unregisterFrameCallback();

	void setup(CtControl *ct);
papillon's avatar
   
papillon committed
55

papillon's avatar
 
papillon committed
56
    private:
papillon's avatar
   
papillon committed
57
	HwBufferCtrlObj	*m_hw_buffer;
papillon's avatar
   
papillon committed
58
	CtBufferFrameCB *m_frame_cb;
papillon's avatar
   
papillon committed
59
	Parameters	m_pars;
papillon's avatar
 
papillon committed
60

seb's avatar
seb committed
61
};
papillon's avatar
 
papillon committed
62
63
64
} // namespace lima

#endif // CTBUFFER_H