-
Notifications
You must be signed in to change notification settings - Fork 0
/
Graphics.h
93 lines (73 loc) · 1.9 KB
/
Graphics.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#ifndef __GRAPHICS__
#define __GRAPHICS__
#include "stm32f4xx.h"
#include "video.h"
#include "images.h"
#include "USART.h"
#define COLOR_BLACK 0x00
#define GDA_FALSE 0
#define GDA_TRUE 1
//extern __align(1) __IO unsigned char fb[VID_VSIZE][VID_HSIZE+2] ; /* Frame buffer */
//extern __align(1) __IO unsigned char fb2[VID_VSIZE][VID_HSIZE+2] ; /* Frame buffer */
typedef uint8_t GDAu8;
typedef uint16_t GDAu16;
typedef int16_t GDAs16;
typedef uint32_t GDAu32;
typedef int32_t GDAs32;
typedef uint8_t GDABool;
typedef struct primRectangle {
GDAu16 x0;
GDAu16 y0;
GDAu16 x1;
GDAu16 y1;
GDABool Fill;
GDAu8 Color;
GDAu8 BorderColor;
GDAu8 DeepLevel;
} primRectangle;
typedef struct primLine {
GDAu16 x0;
GDAu16 y0;
GDAu16 x1;
GDAu16 y1;
GDAu8 Color;
GDAu8 DeepLevel;
} primLine;
typedef struct primCircle {
GDAu16 x0;
GDAu16 y0;
GDAu16 Radius;
GDABool Fill;
GDAu8 Color;
GDAu8 BorderColor;
GDAu8 DeepLevel;
} primCircle;
typedef struct primImage{
int index;
GDAu16 x0;
GDAu16 y0;
GDAu16 height;
GDAu16 width;
} primImage;
struct ImageEntry {
unsigned char type;
unsigned char layer;
short int x;
short int y;
short int height;
short int width;
unsigned char color;
unsigned int index;
};
int DrawPoint(uint32_t x_point,uint32_t y_point,uint8_t data);
void gdaSCircle(primCircle * CircleStruct);
void gdaSLine(primLine* LineStruct);
void gdaSRectangle(primRectangle* LineStruct);
void gdaLine(GDAu32 x1, GDAu32 y1, GDAu32 x2, GDAu32 y2, GDAu8 data);
void gdaRectangle(GDAu32 x0, GDAu32 y0, GDAu32 x1, GDAu32 y1, GDAu8 BorderColor, GDABool Fill, GDAu8 FillColor);
void gdaCircle(GDAu32 x, GDAu32 y, GDAu32 r, GDAu8 BorderColor,GDABool Fill,GDAu8 FillColor); /*GDACIRCLE BORDERCOLOR NOT IMPLEMENTED*/
void gdaClearColor(GDAu16 R, GDAu16 G, GDAu16 B);
void gdaDrawImage(char image_index,int x,int y,int width, int height);
void processEntity(struct ImageEntry *Entity);
void process();
#endif