📄 gui_streambmp.lst
字号:
C51 COMPILER V8.05a GUI_STREAMBMP 04/11/2008 14:18:51 PAGE 1
C51 COMPILER V8.05a, COMPILATION OF MODULE GUI_STREAMBMP
OBJECT MODULE PLACED IN GUI_StreamBMP.obj
COMPILER INVOKED BY: D:\Program Files\keil\C51\BIN\C51.EXE gui\Core\GUI_StreamBMP.c LARGE BROWSE MDU_F120 DEBUG OBJECTEX
-TEND PRINT(.\GUI_StreamBMP.lst) OBJECT(GUI_StreamBMP.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 : GUI_StreamBMP.C
16 Purpose : Draw stream data bitmaps
17 ---------------------------END-OF-HEADER------------------------------
18 */
19
20
21 #include <stddef.h> /* needed for definition of NULL */
22 #include "gui\Core\GUI_Private.h"
23 #include "gui\Core\GUIDebug.h"
24
25 #define BI_RGB 0 /* Windows define */
26
27
28 static void StreamU16 (U16 Data, GUI_CALLBACK_VOID_U8_P* pfStream, void* p) {
29 1 (*pfStream) (Data, p);
30 1 (*pfStream) (Data >> 8, p);
31 1 }
32
33 static void StreamU32 (U32 Data, GUI_CALLBACK_VOID_U8_P* pfStream, void* p) {
34 1 StreamU16(Data, pfStream, p);
35 1 StreamU16(Data >> 16, pfStream, p);
36 1 }
37
38
39 /************************************************
40 * *
41 * Draw point *
42 * *
43 *************************************************
44 */
45
46 void GUI_StreamBMP (GUI_RECT* pRect, GUI_CALLBACK_VOID_U8_P* pfStream, void *p) {
47 1 GUI_RECT r;
48 1 int i, x, y, BPP;
49 1 int NumColors;
50 1 U32 Size;
51 1 GUI_LOCK();
52 1 if (pRect) {
53 2 r = *pRect;
54 2 } else {
C51 COMPILER V8.05a GUI_STREAMBMP 04/11/2008 14:18:51 PAGE 2
55 2 r.x0 = r.y0 = 0;
56 2 r.x1 = LCD_GetXSize() -1;
57 2 r.y1 = LCD_GetYSize() -1;
58 2 }
59 1 Size = (r.x1 - r.x0 + 1) * (r.y1 - r.y0 + 1);
60 1 BPP = LCD_GetBitsPerPixel();
61 1 NumColors = (BPP <= 8) ? (1 << BPP) : 0;
62 1 /* Save Bitmap fileheader : BITMAPFILEHEADER : 14 bytes */
63 1 (*pfStream) ('B', p); /* WORD Type */
64 1 (*pfStream) ('M', p);
65 1 StreamU32(Size, pfStream, p); /* DWORD bfSize */
66 1 StreamU32(0, pfStream, p); /* WORD aReserved[2]: Has to be 0 */
67 1 StreamU32(0x76, pfStream, p); /* DWORD bfOffBits: Offset to bits (constant) */
68 1 /* BITMAPINFOHEADER: 40 bytes */
69 1 StreamU32(0x28, pfStream, p); /* DWORD sizeof(BITMAPINFOHEADER) */
70 1 StreamU32(r.x1 - r.x0 +1, pfStream, p); /* I32 biWidth */
71 1 StreamU32(r.y1 - r.y0 +1, pfStream, p); /* I32 biHeigth */
72 1 StreamU16(1, pfStream, p); /* WORD biPlanes; */
73 1 StreamU16(BPP, pfStream, p); /* WORD biBitCount */
74 1 StreamU32(BI_RGB, pfStream, p); /* DWORD biCompression; */
75 1 StreamU32(0, pfStream, p); /* DWORD biSizeImage; (may be 0 for BI_RGB) */
76 1 StreamU32(0, pfStream, p); /* LONG biXPelsPerMeter; */
77 1 StreamU32(0, pfStream, p); /* LONG biYPelsPerMeter; */
78 1 StreamU32(0, pfStream, p); /* DWORD biClrUsed; 0 means max. number fitting into bits
-*/
79 1 StreamU32(0, pfStream, p); /* DWORD biClrImportant; 0 means all colors are required
-*/
80 1 /* RGBQuads */
81 1 for (i = 0; i < NumColors; i++) {
82 2 LCD_COLOR Color;
83 2 Color = GUI_Index2Color(i);
84 2 StreamU32(Color, pfStream, p);
85 2 }
86 1 /* Store indices */
87 1 for (y = r.y0; y <= r.y1; y++) {
88 2 for (x = r.x0; x <= r.x1; x++) {
89 3 U8 Data;
90 3 Data = LCD_L0_GetPixelIndex(x, y);
91 3 (*pfStream) (Data, p);
92 3 }
93 2 }
94 1 GUI_UNLOCK();
95 1 }
96
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 1039 ----
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 + -