/*
* api_TFT.h
*
*  Created on: Aug 14, 2014
*      Author: QTC
*/
#ifndef API_TFT_H_
#define API_TFT_H_


typedef struct
{
    short             x_point;
    short             y_point;
    unsigned char    *VRAM;              /* 显存指针 */
    unsigned char    *IMG;               /* 图片指针 */
    unsigned char    Img_with;
    unsigned int     Img_high;
    short             LeftX;              /* 窗口左 */
    short             RightX;             /* 窗口右 */
    short             WinTopY;            /* 窗口上 */
    short             WinBottomY;         /* 窗口下 */
    unsigned char    Radius;             /* 中间开始向两边画的半径 */
    unsigned char    Alpha;              /* Alpha数值 */
    unsigned char    Luminance;          /* 原图亮度 */
    unsigned char    VramSelectBuf;      /* VRAM 显示标志 0：显存使用VRAM_BUF[ 0 ]   1: 显存使用VRAM_BUF1 */
    unsigned char    VramCalOverFlag[2];       /* VRAM 计算完成标志 计算完成==1 */
}DrawInfomation;

extern      DrawInfomation  g_DrawInfo;
extern      unsigned   char                 VRAM_BUF[ 2 ][ 38400 ];
extern      volatile   unsigned char       memoryVramSel;

extern      void                 Api_ClearAllVram(unsigned char VramIndex,unsigned int Fill);
extern      void                 Api_SetDrawWindow(DrawInfomation *DrawInfo,unsigned int Left_side,unsigned int Right_side,unsigned int Top_side,unsigned int Bottom_side);

extern      unsigned char       Api_DrawDeleteCenterIcon(DrawInfomation *DrawInfo);  /* 从中间向两边删除图片 半径为Radius */
extern      unsigned char       Api_DrawCenterSpreadIcon(DrawInfomation *DrawInfo);  /* 从中间向两边展开图片 半径为Radius */

extern      unsigned char       Api_DrawIcon(DrawInfomation *DrawInfo);              /* 带有window属性 直接绘制 */
extern      unsigned char       Api_DrawLuminIcon(DrawInfomation *DrawInfo);         /* 带有window属性 直接绘制 带有流明控制 Luminance，值越大图片越亮 但是不超过原图亮度 */

extern      unsigned char       Api_DrawWindowMinAlphaIcon(DrawInfomation *DrawInfo);/* 带有window属性,选取数值小的像素进行绘画 */
extern      unsigned char       Api_DrawWindowMinAlphaLuminIcon(DrawInfomation *DrawInfo);  /* 带有window属性,选择最小颜色值绘画;带有流明控制 */

extern      unsigned char       Api_DrawConstMaxAlpha(DrawInfomation *DrawInfo);     /* 固定数值的ALPHA通道 比ALPHA小的像素值 = ALPHA值 */
extern      unsigned char       Api_DrawLuminArea(DrawInfomation *DrawInfo);         /* 覆盖区域的图片带有流明效果,Luminance 这个参数越大越亮,但是不会超过原图亮度 */


extern      unsigned char       Api_AlphaFillInsideIcon(DrawInfomation *DrawInfo);   /* 填充第一行与最后一行，其他部分ALPHA透明 选择像素值最小的绘画 */

extern      unsigned char       Api_DrawMaxAlphaIcon(DrawInfomation *DrawInfo);      /* 选择最大值像素绘画 */
extern      unsigned char       Api_DrawMinAlphaIcon(DrawInfomation *DrawInfo);      /* 选择最小值像素绘画 */

extern      unsigned char       Api_DrawAlphaChannelIcon(DrawInfomation *DrawInfo);      /* 带有window属性, 图像数据 等于alpha的像素 不进行绘画，等于直接画 */
extern      unsigned char       Api_DrawAlphaChannelLuminIcon(DrawInfomation *DrawInfo); /* 带有window属性, 图像数据 等于alpha的像素 不进行绘画，等于直接画 带流明控制 */

extern      unsigned char       Api_DrawMinAlphaLuminIcon(DrawInfomation *DrawInfo);  /* 可以调节原图亮度，选择像素数值最小的显示，Luminance 这个参数越大越亮 */

extern      unsigned char       Api_DrawBlendModeIcon(DrawInfomation *DrawInfo);      /* 带有window属性 两张图片像素混合 合成后像素值 = (A + B) /2 */

extern      unsigned char       Api_DrawMaxAlphaChannelIcon(DrawInfomation *DrawInfo);  /* 带有window属性, 底图数据等于alpha的像素直接绘画，否则选择最大像素数据进行绘画 */
extern      unsigned char       Api_DrawMaxAlphaChannelLuminIcon(DrawInfomation *DrawInfo);  /* Api_DrawMaxAlphaChannelIcon 基础上增加流明控制,Luminance 这个参数越大越亮 */

extern      unsigned char       Api_DrawEdgeMinAlphaIcon(DrawInfomation *DrawInfo);     /* 边缘2像素带有alpha */
  
extern      unsigned char       Do_Nothing(DrawInfomation *DrawInfo); /* 不进行任何绘画 */


    
#endif /* API_TFT_H_ */
