📄 guiaachar4.lst
字号:
C51 COMPILER V8.05a GUIAACHAR4 04/11/2008 14:18:17 PAGE 1
C51 COMPILER V8.05a, COMPILATION OF MODULE GUIAACHAR4
OBJECT MODULE PLACED IN GUIAAChar4.obj
COMPILER INVOKED BY: D:\Program Files\keil\C51\BIN\C51.EXE gui\AntiAlias\GUIAAChar4.c LARGE BROWSE MDU_F120 DEBUG OBJECT
-EXTEND PRINT(.\GUIAAChar4.lst) OBJECT(GUIAAChar4.obj)
line level source
1 /*
2 *********************************************************************************************************
3 * uC/GUI
4 * Universal graphic software for embedded applications
5 *
6 * (c) Copyright 2002, Micrium Inc., Weston, FL
7 * (c) Copyright 2002, SEGGER Microcontroller Systeme GmbH
8 *
9 * 礐/GUI is protected by international copyright laws. Knowledge of the
10 * source code may not be used to write a similar product. This file may
11 * only be used in accordance with a license and should not be redistributed
12 * in any way. We appreciate your understanding and fairness.
13 *
14 ----------------------------------------------------------------------
15 File : GUICharAA.C
16 Purpose : Display antialiased
17 ----------------------------------------------------------------------
18 Version-Date---Author-Explanation
19 ----------------------------------------------------------------------
20
21 1.00.00 990922 RS First release
22 ----------------------------------------------------------------------
23 Known problems or limitations with current version
24 ----------------------------------------------------------------------
25 Module needs cleanup and review, but is fully functional.
26 ---------------------------END-OF-HEADER------------------------------
27 */
28
29
30 #include "gui\Core\GUI_Private.h"
31
32 #include <stdio.h>
33 #include <string.h>
34
35 /*
36 ***********************************************************
37 * *
38 * Anti-aliased drawing *
39 * *
40 ***********************************************************
41 */
42
43 static void Draw(int x0, int y0, int XSize, int YSize, int BytesPerLine, const U8*pData) {
44 1 int x, y;
45 1 tLCD_SetPixelAA* pfSetPixelAA;
46 1 pfSetPixelAA = (GUI_Context.TextMode && GUI_TM_TRANS) ? (LCD_SetPixelAA) : (LCD_SetPixelAA_NoTrans);
47 1 for (y=0; y<YSize; y++) {
48 2 const U8*pData0 = pData;
49 2 for (x=0; x<XSize-1; x+=2) {
50 3 (*pfSetPixelAA)(x+x0,y0+y, (*pData0)>>4); /* x0+x changed -> x+x0 to avoid problems with IAR's ICC
-MC80 */
51 3 (*pfSetPixelAA)(x0+x+1,y0+y, (*pData0++)&15);
52 3 }
53 2 if (XSize&1) {
C51 COMPILER V8.05a GUIAACHAR4 04/11/2008 14:18:17 PAGE 2
54 3 (*pfSetPixelAA)(x0+x,y0+y, (*pData0)&15);
55 3 }
56 2 pData+=BytesPerLine;
57 2 }
58 1 }
59
60 /*
61 ***********************************************************
62 * *
63 * Font handling *
64 * *
65 ***********************************************************
66 */
67
68 static const GUI_FONT_PROP* GUIPROP_FindChar(const GUI_FONT_PROP* pProp, U16P c) {
69 1 for (pProp = GUI_Context.pAFont->p.pProp; pProp; pProp=(const GUI_FONT_PROP*) pProp->pNext) {
70 2 if ((c>=pProp->First) && (c<=pProp->Last))
71 2 break;
72 2 }
73 1 return pProp;
74 1 }
75
76 void GUIPROP_AA4_DispChar(U16P c) {
77 1 int BytesPerLine;
78 1 GUI_DRAWMODE DrawMode = GUI_Context.TextMode;
79 1 const GUI_FONT_PROP* pProp = GUIPROP_FindChar(GUI_Context.pAFont->p.pProp, c);
80 1 if (pProp) {
81 2 GUI_DRAWMODE OldDrawMode;
82 2 const GUI_CHARINFO* pCharInfo = pProp->paCharInfo+(c-pProp->First);
83 2 BytesPerLine = pCharInfo->BytesPerLine;
84 2 OldDrawMode = LCD_SetDrawMode(DrawMode);
85 2 Draw ( GUI_Context.DispPosX, GUI_Context.DispPosY,
86 2 pCharInfo->XSize,
87 2 GUI_Context.pAFont->YSize,
88 2 BytesPerLine,
89 2 (U8 const*)pCharInfo->pData
90 2 );
91 2 LCD_SetDrawMode(OldDrawMode); /* Restore draw mode */
92 2 GUI_Context.DispPosX += pCharInfo->XDist;
93 2 }
94 1 }
95
96 int GUIPROP_AA4_GetCharDistX(U16P c) {
97 1 const GUI_FONT_PROP* pProp = GUIPROP_FindChar(GUI_Context.pAFont->p.pProp, c);
98 1 return (pProp) ? (pProp->paCharInfo+(c-pProp->First))->XSize : 0;
99 1 }
100
101 void GUIPROP_AA4_GetFontInfo(void*pFont, GUI_FONTINFO* pfi) {
102 1 GUI_USE_PARA(pFont);
103 1 pfi->Flags = GUI_FONTINFO_FLAG_PROP | GUI_FONTINFO_FLAG_AA4;
104 1 }
105
106 char GUIPROP_AA4_IsInFont(void*pFont, U16 c) {
107 1 const GUI_FONT_PROP* pProp = GUIPROP_FindChar(((GUI_FONT*)pFont)->p.pProp, c);
108 1 return (pProp==NULL) ? 0 : 1;
109 1 }
110
111 /* End of file */
112
MODULE INFORMATION: STATIC OVERLAYABLE
C51 COMPILER V8.05a GUIAACHAR4 04/11/2008 14:18:17 PAGE 3
CODE SIZE = 973 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- 50
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -