-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathImagePlane.h
41 lines (29 loc) · 862 Bytes
/
ImagePlane.h
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
#pragma once
#include "st.h"
#include "Light.h"
using namespace std;
typedef STColor3f Pixel;
#define screenWidth 512
#define screenHeight 512
//Represents virtual window into scene
class ImagePlane {
public:
//constructor: defines imageplane as four corners relative to camera
ImagePlane(STPoint3* LL, STPoint3* UL, STPoint3* LR, STPoint3* UR);
//calculate the world coordinates of a point with the specified image coordinates
STPoint3* imgToWorld(int imX, int imY);
//set pixel color
void setPixel(int imX, int imY, Pixel color);
//write stored results to image file
void writeImage();
//array of pixels of ImagePlane
Pixel* pixels;
private:
//four corners of ImagePlane
STPoint3* LL;
STPoint3* UL;
STPoint3* LR;
STPoint3* UR;
/*int screenWidth;
int screenHeight;*/
};