-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFrameBuffer.h
More file actions
53 lines (44 loc) · 999 Bytes
/
FrameBuffer.h
File metadata and controls
53 lines (44 loc) · 999 Bytes
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* File: FrameBuffer.h
* Author: zoizoi
*
* Created on 30 January 2011, 20:29
*/
#ifndef FRAMEBUFFER_H
#define FRAMEBUFFER_H
#include "vtkEssentials.h"
class FrameBuffer {
public:
FrameBuffer(vtkSmartPointer<vtkRenderWindow> renderWindow);
FrameBuffer(const FrameBuffer& orig);
virtual ~FrameBuffer() {
// delete data;
};
void grabData() {
size = renderWindow->GetSize();
len = size[0] * size[1];
data = renderWindow->GetRGBAPixelData(0, 0, (size[0] - 1), (size[1] - 1), 0);
}
float* copyData(){
float* dataCopy=new float[len]();
for(int i=0;i<len;i++){
dataCopy[i]=data[i];
}
return dataCopy;
}
float* getData() {
return data;
}
int getLen() {
return len;
}
void delData(){
delete data;
}
private:
vtkSmartPointer<vtkRenderWindow> renderWindow;
float* data;
int* size;
int len;
};
#endif /* FRAMEBUFFER_H */