📄 lcdaa.lst
字号:
C51 COMPILER V8.05a LCDAA 04/11/2008 14:19:03 PAGE 1
C51 COMPILER V8.05a, COMPILATION OF MODULE LCDAA
OBJECT MODULE PLACED IN LCDAA.obj
COMPILER INVOKED BY: D:\Program Files\keil\C51\BIN\C51.EXE gui\Core\LCDAA.c LARGE BROWSE MDU_F120 DEBUG OBJECTEXTEND PRI
-NT(.\LCDAA.lst) OBJECT(LCDAA.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 : LCDAA.c
16 Purpose : Low level antialiasing routines.
17 ---------------------------END-OF-HEADER------------------------------
18 */
19
20 #define LCD_C
21
22 #include <stddef.h> /* needed for definition of NULL */
23 #include "gui\Core\LCD.h"
24 #include "gui\Core\GUI_Private.h"
25 #include "gui\Core\LCD_Private.h"
26
27 /*
28 *********************************************************
29 * *
30 * Macros for internal use *
31 * *
32 *********************************************************
33 */
34
35 #define RETURN_IF_Y_OUT() \
36 if (y < GUI_Context.ClipRect.y0) \
37 return; \
38 if (y > GUI_Context.ClipRect.y1) \
39 return;
40
41 #define RETURN_IF_X_OUT() \
42 if (x < GUI_Context.ClipRect.x0) return; \
43 if (x > GUI_Context.ClipRect.x1) return;
44
45 #define CLIP_X() \
46 if (x0 < GUI_Context.ClipRect.x0) { x0 = GUI_Context.ClipRect.x0; } \
47 if (x1 > GUI_Context.ClipRect.x1) { x1 = GUI_Context.ClipRect.x1; }
48
49 #define CLIP_Y() \
50 if (y0 < GUI_Context.ClipRect.y0) { y0 = GUI_Context.ClipRect.y0; } \
51 if (y1 > GUI_Context.ClipRect.y1) { y1 = GUI_Context.ClipRect.y1; }
52
53
54 /*
C51 COMPILER V8.05a LCDAA 04/11/2008 14:19:03 PAGE 2
55 *********************************************************
56 * *
57 * Antialiasing (opt) *
58 * *
59 *********************************************************
60 */
61
62
63
64 LCD_COLOR LCD_AA_MixColors(LCD_COLOR Color, LCD_COLOR BkColor, U8 Intens) {
65 1 /* Calc Color seperations for FgColor first */
66 1 I32 R = (Color&0xff)*Intens;
67 1 I32 G = (Color&0xff00)*Intens;
68 1 I32 B = (Color&0xff0000)*Intens;
69 1 /* Add Color seperations for BkColor */
70 1 Intens = 15-Intens;
71 1 R += (BkColor&0xff)*Intens;
72 1 G += (BkColor&0xff00)*Intens;
73 1 B += (BkColor&0xff0000)*Intens;
74 1 R = (R/15)&0xff;
75 1 G = (G/15)&0xff00;
76 1 B = (B/15)&0xff0000;
77 1 Color = R+G+B;
78 1 return Color;
79 1 }
80
81
82 /* Draw 1-pixel with Foreground color */
83 void LCD_SetPixelAA(int x, int y, U8 Intens) {
84 1 if (Intens == 0)
85 1 return;
86 1 RETURN_IF_Y_OUT();
87 1 RETURN_IF_X_OUT();
88 1 if (Intens >= 15) {
89 2 LCDDEV_L0_SetPixelIndex(x,y, LCD_COLORINDEX);
90 2 } else {
91 2 LCD_COLOR Color = LCD_Index2Color(LCD_COLORINDEX);
92 2 LCD_COLOR BkColor = LCD_GetPixelColor(x,y);
93 2 Color = LCD_AA_MixColors(Color, BkColor, Intens);
94 2 LCDDEV_L0_SetPixelIndex(x,y, LCD_Color2Index(Color));
95 2 }
96 1 }
97
98 /* Draw 1-pixel with Foreground and background color */
99 void LCD_SetPixelAA_NoTrans(int x, int y, U8 Intens) {
100 1 RETURN_IF_Y_OUT();
101 1 RETURN_IF_X_OUT();
102 1 if (Intens == 0) {
103 2 LCDDEV_L0_SetPixelIndex(x,y, LCD_BKCOLORINDEX);
104 2 } else if (Intens == 15) {
105 2 LCDDEV_L0_SetPixelIndex(x,y, LCD_COLORINDEX);
106 2 } else {
107 2 LCD_COLOR Color = LCD_AA_MixColors(LCD_Index2Color(LCD_COLORINDEX),
108 2 LCD_Index2Color(LCD_BKCOLORINDEX),
109 2 Intens);
110 2 LCDDEV_L0_SetPixelIndex(x,y,LCD_Color2Index(Color));
111 2 }
112 1 }
113
MODULE INFORMATION: STATIC OVERLAYABLE
C51 COMPILER V8.05a LCDAA 04/11/2008 14:19:03 PAGE 3
CODE SIZE = 1076 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- 43
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 + -