171 lines
4.2 KiB
C
171 lines
4.2 KiB
C
#ifndef MYWIN_DRAW_H__
|
||
#define MYWIN_DRAW_H__
|
||
#include "mywin_type.h"
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
/*****************************接口函数******************************/
|
||
|
||
|
||
void WIN_DrawPointSafe (int x,int y,int mode);
|
||
|
||
void WIN_DrawPointNormal (int x,int y,int mode);
|
||
|
||
void WIN_DrawPointColorSafe (int x,int y,u32 color);
|
||
|
||
void WIN_DrawPointColorNormal (int x,int y,u32 color);
|
||
|
||
void WIN_DrawPointSafeColorAlpha (int x,int y,u16 color,u8 alpha);
|
||
|
||
u32 WIN_SetLcdColor (u32 color);
|
||
|
||
u32 WIN_SetLcdBkColor (u32 color);
|
||
|
||
u16 WIN_GetLcdColor16 (void);
|
||
|
||
/****************************接口函数End******************************/
|
||
|
||
|
||
|
||
|
||
|
||
/*****************************字符显示函数******************************/
|
||
|
||
void WIN_DrawTxtAt (char *txt,int x,int y);
|
||
|
||
//在指定矩形中显示字符串,支持换行符\n
|
||
void WIN_DrawTxtAtRect (char *txt,int x,int y,int x_size,int y_size);
|
||
|
||
//在指定矩形居中显示字符串,支持换行符\n
|
||
void WIN_DrawTxtCenterAtRect (char *txt,int x,int y,int x_size,int y_size);
|
||
|
||
void WIN_DrawTxtHCenterAt (char *txt,int x,int y);
|
||
|
||
/***************************字符显示函数End******************************/
|
||
|
||
|
||
|
||
|
||
|
||
/*****************************绘制几何图形******************************/
|
||
|
||
void WIN_DrawHLine (int x_s,int y,int x_e);
|
||
|
||
//有透明度的划线,dis=0,正方向,dis=1,反方向
|
||
void WIN_DrawHLineAlpha (int x_s,int y,int x_e,u16 color,u8 dis);
|
||
|
||
void WIN_DrawVLine (int x,int y_s,int y_e);
|
||
|
||
//画线 x1,y1:起点坐标 x2,y2:终点坐标
|
||
void WIN_DrawLine(int x1, int y1, int x2, int y2);
|
||
|
||
//绘制连续线段
|
||
void WIN_DrawLines (POINT_Struct *Points, int PointCount);
|
||
|
||
//在指定位置画一个指定大小的圆 (x,y):中心点 r :半径
|
||
void WIN_DrawCircle(int x0,int y0,int r);
|
||
|
||
//绘制空心矩形
|
||
void WIN_DrawRect (int x,int y,int x_size,int y_size);
|
||
|
||
//绘制多边形
|
||
void WIN_DrawPolygon(POINT_Struct *Points, int PointCount);
|
||
|
||
//用纯色填充矩形
|
||
void WIN_FillRectByColor (int x,int y,int x_size,int y_size);
|
||
|
||
//用纯色和透明度填充矩形
|
||
void WIN_FillRectByColorAlpha (int x,int y,int x_size,int y_size,u8 alpha);
|
||
|
||
//填充三角形
|
||
void WIN_FillTriangle(int x1, int x2, int x3, int y1, int y2, int y3);
|
||
|
||
//填充多边形
|
||
void WIN_FillPolygon(POINT_Struct *Points, int PointCount);
|
||
|
||
//创建一个抗锯齿绘图平面
|
||
WIN_PlaneAAStruct *WIN_CreatPlaneAA(int x,int y,int x_size,int y_size,int accuracy);
|
||
|
||
//删除一个抗锯齿平面
|
||
void WIN_DeletePlaneAA(WIN_PlaneAAStruct *p);
|
||
|
||
//在平面内绘制抗锯齿点
|
||
void WIN_DrawPointAA(WIN_PlaneAAStruct *p,int x,int y);
|
||
|
||
//绘制一个抗锯齿绘图平面
|
||
void WIN_DrawPlaneAA (WIN_PlaneAAStruct *p);
|
||
|
||
//抗锯齿画线
|
||
void WIN_DrawLineAA(int x1, int y1, int x2, int y2,int accuracy);
|
||
|
||
/***************************绘制几何图形End******************************/
|
||
|
||
|
||
|
||
|
||
|
||
|
||
/*******************************绘制图像********************************/
|
||
|
||
//用背景图片填充矩形
|
||
void WIN_FillRect (int x,int y,int x_size,int y_size,u16 *buff,u16 pic_x,u16 pic_y,u16 pic_xsize,u16 pic_ysize);
|
||
|
||
//用带透明度的图片填充矩形
|
||
void WIN_FillRectAlpha (int x,int y,int x_size,int y_size,void *buff,u16 pic_x,u16 pic_y,u16 pic_xsize,u16 pic_ysize);
|
||
|
||
//绘制图标,图标使用const数组编译在程序里,其本身已经附带了大小等参数
|
||
void WIN_DrawImag (int x,int y,int xsize,int ysize,const u8 *buff);
|
||
|
||
//绘制图标,但是不绘制指定颜色
|
||
void WIN_DrawImagButColor (int x,int y,int xsize,int ysize,const u8 *buff,u16 color);
|
||
|
||
//绘制图标,把图像的有效部分绘制为指定颜色
|
||
void WIN_DrawImagByColor (int x,int y,int xsize,int ysize,const u8 *buff,u16 color);
|
||
|
||
//绘制图标,把原图像转化为透明度,用指定颜色来绘制
|
||
//此函数效率比较低,只用于绘制小图标,绘制图片使用矩形填充函数
|
||
void WIN_DrawImagByAlpha (int x,int y,int xsize,int ysize,const u8 *buff,u16 color);
|
||
|
||
//透明度绘制图像,反色处理
|
||
void WIN_DrawImagByAlphaAnti (int x,int y,int xsize,int ysize,const u8 *buff,u16 color);
|
||
|
||
/*******************************绘制图像End********************************/
|
||
|
||
|
||
|
||
/********************************清屏********************************/
|
||
|
||
//清空显示
|
||
void WIN_Clear (void);
|
||
|
||
/*******************************清屏End********************************/
|
||
|
||
|
||
|
||
/*******************************计算绘制资源********************************/
|
||
|
||
|
||
//获得文字的矩形大小
|
||
void WIN_GetTxtRectSize (char *txt,int *x_size,int *y_size);
|
||
|
||
//获得图像数据的尺寸,返回0,成功,非0,失败
|
||
int WIN_GetImageSize (u8 *buff,int *xsize,int *ysize);
|
||
|
||
|
||
/******************************计算绘制资源End********************************/
|
||
|
||
|
||
|
||
|
||
|
||
#endif
|
||
|