This repository has been archived by the owner on May 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
t2.cpp
49 lines (42 loc) · 1.51 KB
/
t2.cpp
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
#include "graphical_transformation.hpp"
int main(){
int x=64,y=64;
NewImage(x,y);
SetAxis();
int l=10,r=40;
for(int i=l;i<=r;i++){
SetPixel(i,l);
SetPixel(l,i);
SetPixel(i,r);
SetPixel(r,i);
}
SetColor(0x0000ff);
for(int i=l;i<=r;i++){
SetPixel(Translation(std::make_pair(i,l),-20,-30));
SetPixel(Translation(std::make_pair(l,i),-20,-30));
SetPixel(Translation(std::make_pair(i,r),-20,-30));
SetPixel(Translation(std::make_pair(r,i),-20,-30));
}
SetColor(0x00ff00);
for(int i=l;i<=r;i++){
SetPixel(Proportion(std::make_pair(i,l),0.4,0.6));
SetPixel(Proportion(std::make_pair(l,i),0.4,0.6));
SetPixel(Proportion(std::make_pair(i,r),0.4,0.6));
SetPixel(Proportion(std::make_pair(r,i),0.4,0.6));
}
SetColor(0xff0000);
for(int i=l;i<=r;i++){
SetPixel(Rotation(std::make_pair(i,l),45.0/180.0*3.14159265359));
SetPixel(Rotation(std::make_pair(l,i),45.0/180.0*3.14159265359));
SetPixel(Rotation(std::make_pair(i,r),45.0/180.0*3.14159265359));
SetPixel(Rotation(std::make_pair(r,i),45.0/180.0*3.14159265359));
}
SetColor(0xffff00);
for(int i=l;i<=r;i++){
SetPixel(Stagger(std::make_pair(i,l),0.5,0.5));
SetPixel(Stagger(std::make_pair(l,i),0.5,0.5));
SetPixel(Stagger(std::make_pair(i,r),0.5,0.5));
SetPixel(Stagger(std::make_pair(r,i),0.5,0.5));
}
Save("t2.bmp");
}