⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lcd_drawbitmap_565.txt

📁 STM32F103ZET6+UCOSII+UCGUI源码
💻 TXT
📖 第 1 页 / 共 2 页
字号:
; generated by ARM C/C++ Compiler with , RVCT4.0 [Build 524] for uVision
; commandline ArmCC [--split_sections --debug -c --asm --interleave -o.\Obj\lcd_drawbitmap_565.o --depend=.\Obj\lcd_drawbitmap_565.d --device=DARMSTM --apcs=interwork -O3 -I..\..\include -I..\..\..\FWLib\library\inc -I..\..\..\USBLib\library\inc -I..\..\Config -I..\..\GUI\Core -I..\..\GUI\Font -I..\..\GUI\ConvertColor -I..\..\GUI\AntiAlias -I..\..\GUI\ConvertMono -I..\..\GUI\JPEG -I..\..\GUI\MemDev -I..\..\GUI\MultiLayer -I..\..\GUI\Widget -I..\..\GUI\WM -IC:\Keil\ARM\INC\ST\STM32F10x ..\..\GUI\Core\LCD_DrawBitmap_565.c]
                          THUMB

                          AREA ||i._DrawBitmap_565||, CODE, READONLY, ALIGN=2

                  _DrawBitmap_565 PROC
;;;33     */
;;;34     static void _DrawBitmap_565(int x0,int y0,int xsize, int ysize, const U8 GUI_UNI_PTR * pPixel, const LCD_LOGPALETTE GUI_UNI_PTR * pLogPal, int xMag, int yMag) {
000000  e92d4fff          PUSH     {r0-r11,lr}
000004  b089              SUB      sp,sp,#0x24
000006  4682              MOV      r10,r0
000008  4616              MOV      r6,r2
00000a  469b              MOV      r11,r3
;;;35       const U16 * pData;
;;;36       int y, OldIndex, PrevIndex, Mode, SwapRB, Mag, BytesPerLine, UseDrawBitmap = 0;
;;;37       GUI_USE_PARA(pLogPal);
;;;38       OldIndex = LCD_GetColorIndex();
00000c  9c16              LDR      r4,[sp,#0x58]
00000e  f7fffffe          BL       LCD_GetColorIndex
;;;39       PrevIndex = OldIndex;
;;;40       pData = (const U16 *)pPixel;
;;;41       Mode = LCD_GetFixedPaletteEx(GUI_Context.SelLayer);
000012  4f6e              LDR      r7,|L1.460|
000014  4605              MOV      r5,r0                 ;39
000016  9007              STR      r0,[sp,#0x1c]
000018  7b78              LDRB     r0,[r7,#0xd]  ; GUI_Context
00001a  f7fffffe          BL       LCD_GetFixedPaletteEx
00001e  4680              MOV      r8,r0
;;;42       SwapRB = LCD_GetSwapRBEx(GUI_Context.SelLayer);
000020  7b78              LDRB     r0,[r7,#0xd]  ; GUI_Context
000022  f7fffffe          BL       LCD_GetSwapRBEx
000026  4602              MOV      r2,r0
;;;43       Mag = (xMag | yMag);
000028  e9dd0118          LDRD     r0,r1,[sp,#0x60]
00002c  4308              ORRS     r0,r0,r1
;;;44       BytesPerLine = xsize * 2;
00002e  0071              LSLS     r1,r6,#1
;;;45       #if GUI_SUPPORT_MEMDEV == 0
;;;46       if ((Mode == 565) && (SwapRB == 0) && (Mag == 1)) {
;;;47         UseDrawBitmap = 1;
;;;48       }
;;;49       #else
;;;50       if (GUI_Context.pDeviceAPI->pMemDevAPI) {
000030  9106              STR      r1,[sp,#0x18]
000032  6cb9              LDR      r1,[r7,#0x48]  ; GUI_Context
000034  6b89              LDR      r1,[r1,#0x38]
000036  b309              CBZ      r1,|L1.124|
;;;51         if (((GUI_Context.hDevData && (GUI_Context.pDeviceAPI->pMemDevAPI->pfIndex2Color == LCD_Index2Color_565)) ||
000038  463b              MOV      r3,r7
00003a  f8b3304c          LDRH     r3,[r3,#0x4c]  ; GUI_Context
00003e  b123              CBZ      r3,|L1.74|
000040  6849              LDR      r1,[r1,#4]
000042  4a63              LDR      r2,|L1.464|
000044  4291              CMP      r1,r2
000046  d119              BNE      |L1.124|
000048  e004              B        |L1.84|
                  |L1.74|
;;;52             ((GUI_Context.hDevData == 0) && (Mode == 565) && (SwapRB == 0)))  && (Mag == 1)) {
00004a  f5a87300          SUB      r3,r8,#0x200
00004e  3b35              SUBS     r3,r3,#0x35
000050  d114              BNE      |L1.124|
000052  b99a              CBNZ     r2,|L1.124|
                  |L1.84|
000054  2801              CMP      r0,#1
000056  d170              BNE      |L1.314|
;;;53           UseDrawBitmap = 1;
;;;54         }
;;;55       }
;;;56       #endif
;;;57       if (UseDrawBitmap) {
;;;58         LCD_DrawBitmap(x0, y0, xsize, ysize, 1, 1, 16, BytesPerLine, pPixel, 0);
000058  2010              MOVS     r0,#0x10
00005a  9906              LDR      r1,[sp,#0x18]
00005c  aa02              ADD      r2,sp,#8
00005e  c213              STM      r2!,{r0,r1,r4}
000060  2300              MOVS     r3,#0
000062  9305              STR      r3,[sp,#0x14]
000064  2301              MOVS     r3,#1
000066  9300              STR      r3,[sp,#0]
000068  9301              STR      r3,[sp,#4]
00006a  465b              MOV      r3,r11
00006c  4632              MOV      r2,r6
00006e  4650              MOV      r0,r10
000070  990a              LDR      r1,[sp,#0x28]
000072  f7fffffe          BL       LCD_DrawBitmap
                  |L1.118|
;;;59       } else {
;;;60         if (Mag == 1) {
;;;61           /* Perform clipping */
;;;62           int x1, y1, Diff;
;;;63           y1 = y0 + ysize - 1;
;;;64           x1 = x0 + xsize - 1;
;;;65           /* Clip Y */
;;;66           if (y0 < GUI_Context.ClipRect.y0) {
;;;67             Diff = GUI_Context.ClipRect.y0 -y0;
;;;68             y0   = GUI_Context.ClipRect.y0;
;;;69             #if GUI_SUPPORT_LARGE_BITMAPS                       /* Required only for 16 bit CPUs if some bitmaps are >64kByte */
;;;70               pData += (U32)Diff * (U32)BytesPerLine / 2;
;;;71             #else
;;;72               pData += (unsigned)Diff * (unsigned)BytesPerLine / 2;
;;;73             #endif
;;;74             ysize -= Diff;
;;;75           }
;;;76           Diff = y1 - GUI_Context.ClipRect.y1;
;;;77           if (Diff > 0) {
;;;78             ysize -= Diff;
;;;79           }
;;;80           if (ysize <=0) {
;;;81     		    return;
;;;82           }
;;;83           /* Clip right side */
;;;84           Diff = x1 - GUI_Context.ClipRect.x1;
;;;85           if (Diff > 0) {
;;;86             xsize -= Diff;
;;;87           }
;;;88           /* Clip left side */
;;;89           Diff =0;
;;;90           if (x0 < GUI_Context.ClipRect.x0) {
;;;91             Diff = GUI_Context.ClipRect.x0-x0;
;;;92     			  xsize -= Diff;
;;;93             pData += Diff; 
;;;94             x0 += Diff; 
;;;95           }
;;;96           if (xsize <=0) {
;;;97     		    return;
;;;98           }
;;;99           /* Simple, unmagnified output using LCD_L0_SetPixel() */
;;;100          for (y = 0; y < ysize; y++) {
;;;101            int x;
;;;102            const U16 * p = pData;
;;;103            for (x = 0; x < xsize; x++) {
;;;104              U16 Index;
;;;105              Index = *p++;
;;;106              if (Index != PrevIndex) {
;;;107                LCD_SetColor(LCD_Index2Color_565(Index));
;;;108                PrevIndex = Index;
;;;109              }
;;;110              LCDDEV_L0_SetPixelIndex(x + x0, y + y0, LCD_COLORINDEX);
;;;111            }
;;;112            pData += BytesPerLine / 2;
;;;113          }
;;;114        } else {
;;;115          /* Magnified output using LCD_FillRect() */
;;;116          int x,y;
;;;117          int yi;
;;;118          for (y = y0, yi = 0; yi < ysize; yi++, y += yMag, pPixel += BytesPerLine) {
;;;119            int yMax;
;;;120            yMax = y + yMag - 1;
;;;121            /* Draw if within clip area */
;;;122            if ((yMax >= GUI_Context.ClipRect.y0) && (y <= GUI_Context.ClipRect.y1)) {
;;;123              int xi;
;;;124              const U16 GUI_UNI_PTR * p = pData;
;;;125              for (x = x0, xi = 0; xi < xsize; xi++, x += xMag) {
;;;126                U16 Index;
;;;127                Index = *p++;
;;;128                if (Index != PrevIndex) {
;;;129                  LCD_SetColor(LCD_Index2Color_565(Index));
;;;130                  PrevIndex = Index;
;;;131                }
;;;132                LCD_FillRect(x, y, x + xMag - 1, yMax);
;;;133              }
;;;134            }
;;;135            pData += BytesPerLine / 2;
;;;136          }
;;;137        }
;;;138        GUI_SetColorIndex(OldIndex);
;;;139      }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -