📄 lcdcolor.lst
字号:
C51 COMPILER V8.05a LCDCOLOR 04/11/2008 14:19:03 PAGE 1
C51 COMPILER V8.05a, COMPILATION OF MODULE LCDCOLOR
OBJECT MODULE PLACED IN LCDColor.obj
COMPILER INVOKED BY: D:\Program Files\keil\C51\BIN\C51.EXE gui\Core\LCDColor.c LARGE BROWSE MDU_F120 DEBUG OBJECTEXTEND
-PRINT(.\LCDColor.lst) OBJECT(LCDColor.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 : LCDColor.C
16 Purpose : Color conversion routines for LCD-drivers
17 ---------------------------END-OF-HEADER------------------------------
18 */
19
20 #define LCDCOLOR_C
21
22 #include <stddef.h> /* needed for definition of NULL */
23 #include "gui\Core\GUI.h"
24 #include "gui\Core\LCD_Private.h" /* inter modul definitions & Config */
25 #include "gui\Core\GUIDebug.h"
26
27
28 /*
29 *********************************************************
30 * *
31 * Config defaults *
32 * *
33 *********************************************************
34 */
35 #ifndef LCD_SIZEOF_COLORCACHE
36 #define LCD_SIZEOF_COLORCACHE 0
37 #endif
38
39
40 /*
41 *********************************************************
42 * *
43 * Caching (optional) *
44 * *
45 *********************************************************
46 */
47
48 #if LCD_SIZEOF_COLORCACHE
static const LCD_LOGPALETTE * pLogPalCache;
#endif
51
52
53
54 /*
C51 COMPILER V8.05a LCDCOLOR 04/11/2008 14:19:03 PAGE 2
55 *********************************************************
56 * *
57 * Build color conversion table *
58 * *
59 *********************************************************
60 */
61 LCD_PIXELINDEX LCD__aConvTable[LCD_MAX_LOG_COLORS];
62
63 LCD_PIXELINDEX* LCD_GetpPalConvTableUncached(const LCD_LOGPALETTE* pLogPal) {
64 1 if (pLogPal == NULL) {
65 2 return NULL;
66 2 }
67 1 if (!pLogPal->pPalEntries) {
68 2 return NULL;
69 2 }
70 1 /* Check if sufficient space is available */
71 1 if (pLogPal->NumEntries > LCD_MAX_LOG_COLORS) {
72 2 return NULL;
73 2 }
74 1 /* Build conversion table */
75 1 {
76 2 int i;
77 2 int NumEntries = pLogPal->NumEntries;
78 2 const LCD_COLOR* pPalEntry = &pLogPal->pPalEntries[0];
79 2 for (i=0; i< NumEntries; i++) {
80 3 LCD__aConvTable[i] = LCD_Color2Index(*(pPalEntry+i));
81 3 }
82 2 }
83 1 return &LCD__aConvTable[0];
84 1 }
85
86 LCD_PIXELINDEX* LCD_GetpPalConvTable(const LCD_LOGPALETTE* pLogPal) {
87 1 /* Check cache */
88 1 #if LCD_SIZEOF_COLORCACHE
if (pLogPalCache == pLogPal) {
return &LCD__aConvTable[0];
}
pLogPalCache = pLogPal;
#endif
94 1 return LCD_GetpPalConvTableUncached(pLogPal);
95 1 }
96
97
98
99 /*
100 *********************************************************
101 * *
102 * LCD_InitLUT *
103 * *
104 *********************************************************
105 */
106
107 void LCD_InitLUT(void) {
108 1 #if (LCD_BITSPERPIXEL <= 8)
109 1 {
110 2 int i;
111 2 for (i=0; i < LCD_NUM_COLORS; i++) {
112 3 LCD_COLOR color = LCD_Index2Color((U8)i);
113 3 #if LCD_REVERSE_LUT
color ^= 0xffffff; /* Invert R,G,B components */
#endif
116 3 LCD_L0_SetLUTEntry((U8)i, color);
C51 COMPILER V8.05a LCDCOLOR 04/11/2008 14:19:03 PAGE 3
117 3 }
118 2 }
119 1 #endif
120 1 #if (LCD_NUM_DISPLAYS > 1)
#if (LCD_BITSPERPIXEL_1 <= 8)
{
int i;
int DisplayOld = GUI_SelLCD(1);
for (i=0; i < LCD_NUM_COLORS_1; i++) {
LCD_COLOR color = LCD_Index2Color((U8)i);
#if LCD_REVERSE_LUT
color ^= 0xffffff; /* Invert R,G,B components */
#endif
LCD_L0_1_SetLUTEntry((U8)i, color);
}
GUI_SelLCD(DisplayOld);
}
#endif
#endif
136 1 }
137
138
139
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 335 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = 256 16
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 + -