00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef FRAMEGRAPHICS
00017 #define FRAMEGRAPHICS
00018
00019 #include <unistd.h>
00020 #include <stdio.h>
00021 #include <fcntl.h>
00022 #include <linux/fb.h>
00023 #include <linux/fs.h>
00024 #include <sys/mman.h>
00025 #include <sys/ioctl.h>
00026 #include <string.h>
00027
00028
00029
00030
00031
00032
00033 #define FG_COLOR_RED 0xF800 // 襍、
00034 #define FG_COLOR_GREEN 0x07E0 // 邱�
00035 #define FG_COLOR_BLUE 0x001F // 髱�
00036 #define FG_COLOR_CYAN FG_COLOR_GREEN | FG_COLOR_BLUE // 豌エ (繧キ繧「繝ウ) // OR繧貞叙繧九→濶イ縺瑚カウ縺帙k繧茨ス�!
00037 #define FG_COLOR_MAGENTA FG_COLOR_RED | FG_COLOR_BLUE // 邏ォ (繝槭ぞ繝ウ繧ソ)
00038 #define FG_COLOR_YELLOW FG_COLOR_RED | FG_COLOR_GREEN // 鮟� (繧、繧ィ繝ュ繝シ)
00039 #define FG_COLOR_BLACK 0x0000 // 鮟�
00040 #define FG_COLOR_WHITE 0xFFFF // 逋ス
00041 #define FG_COLOR_GRAY50 0x7BEF // 轣ー 霈晏コヲ50�シ�
00042 #define FG_COLOR_GRAY25 0x39E7 // 轣ー 霈晏コヲ25�シ�
00043
00044 class FrameGraphics {
00045
00046 private:
00047 FrameGraphics(const FrameGraphics&);
00048 const FrameGraphics& operator=(const FrameGraphics&);
00049 int FBfd;
00050 short *FBptr;
00051 struct fb_fix_screeninfo finfo;
00052 struct fb_var_screeninfo vinfo;
00053 int width;
00054 int height;
00055 int depth;
00056 int size;
00057 int length;
00058
00059 public:
00060 FrameGraphics(const char* device);
00061 ~FrameGraphics(void);
00062 void ShowParam(void);
00063 void DrawPoint(int x, int y, short color);
00064 void DrawLine(int x1, int y1, int x2, int y2, short color);
00065 void DrawRect(int x, int y, int w, int h, short color);
00066 void DrawRectFill(int x, int y, int w, int h, short color);
00067 void ClearScreen(void);
00068 void ClearRect(int x, int y, int w, int h);
00069 int GetWidth(void);
00070 int GetHeight(void);
00071
00072
00073 };
00074
00075 #endif
00076