7 #ifndef LINUX_LIBV2_SOURCE_FBUTIL_LIB_FBUTIL_H_ 8 #define LINUX_LIBV2_SOURCE_FBUTIL_LIB_FBUTIL_H_ 19 #include <sys/ioctl.h> 25 #include <arpa/inet.h> 30 #define FBUTIL_API extern "C" 41 struct fb_fix_screeninfo
fix;
42 struct fb_var_screeninfo
var;
48 #define XORMODE 0x80000000 52 FBUTIL_API union multiptr 158 FBUTIL_API int show_bmp(
const char *fbp,
struct fb_var_screeninfo *scrinfo,
const char *bmpname);
int fb_fd
用来存取打开framebuffer后的文件描述符
FBUTIL_API void close_framebuffer(struct fb_data *f_data)
关闭framebuffer设备并释放掉相关内存
unsigned char * fbuffer
缓冲区首地址
FBUTIL_API void put_cross(struct fb_data *f_data, int x, int y, unsigned colidx)
画交叉线
FBUTIL_API void put_string(struct fb_data *f_data, int x, int y, char *s, unsigned colidx)
在屏幕上显示一个字符串
FBUTIL_API void * get_framebuffer(const char *dev, int *size)
获得framebuffer对象
unsigned char ** line_addr
屏幕中每行的首地址
unsigned int colormap[256]
颜色图谱
FBUTIL_API void put_string_center(struct fb_data *f_data, int x, int y, char *s, unsigned colidx)
在屏幕显示一个字符串
FBUTIL_API void rect(struct fb_data *f_data, int x1, int y1, int x2, int y2, unsigned colidx)
在屏幕上显示一个矩形
FBUTIL_API void line(struct fb_data *f_data, int x1, int y1, int x2, int y2, unsigned colidx)
在屏幕上化一条线
FBUTIL_API void fillrect(struct fb_data *f_data, int x1, int y1, int x2, int y2, unsigned colidx)
填充矩形颜色
FBUTIL_API void free_framebuffer(void *buff, int size)
释放framebuffer对象
int bytes_per_pixel
每像素的字节数
FBUTIL_API void setcolor(struct fb_data *f_data, unsigned colidx, unsigned value)
设置屏幕颜色
struct fb_fix_screeninfo fix
用来存取framebuffer的固定信息
FBUTIL_API int show_bmp(const char *fbp, struct fb_var_screeninfo *scrinfo, const char *bmpname)
显示bmp位图
struct fb_var_screeninfo var
用来存取framebuffer的可变信息
FBUTIL_API int open_framebuffer(const char *dev, struct fb_data *f_data)
打开framebuffer设备并用mmap建立内存映射
FBUTIL_API void progress_bar(struct fb_data *f_data, int progress, const char *fmt,...)
显示进度条