Rev 3478 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3478 | Rev 4628 | ||
---|---|---|---|
Line 174... | Line 174... | ||
174 | int color = *(uint32_t *)(src); |
174 | int color = *(uint32_t *)(src); |
175 | return ((color & 0xff) << 16) | (((color >> 8) & 0xff) << 8) | |
175 | return ((color & 0xff) << 16) | (((color >> 8) & 0xff) << 8) | |
176 | ((color >> 16) & 0xff); |
176 | ((color >> 16) & 0xff); |
177 | } |
177 | } |
178 | 178 | ||
- | 179 | static void bgr_byte8880(void *dst, int rgb) |
|
- | 180 | { |
|
- | 181 | uint8_t *scr = (uint8_t *) dst; |
|
- | 182 | scr[3] = RED(rgb, 8); |
|
- | 183 | scr[2] = GREEN(rgb, 8); |
|
- | 184 | scr[1] = BLUE(rgb, 8); |
|
- | 185 | } |
|
- | 186 | ||
- | 187 | static int byte8880_bgr(void *src) |
|
- | 188 | { |
|
- | 189 | uint8_t *scr = (uint8_t *) src; |
|
- | 190 | return scr[3] << 16 | scr[2] << 8 | scr[1]; |
|
- | 191 | } |
|
- | 192 | ||
- | 193 | ||
179 | static void |
194 | static void |
180 | rgb_byte888(void *dst, int rgb) |
195 | rgb_byte888(void *dst, int rgb) |
181 | { |
196 | { |
182 | uint8_t *scr = dst; |
197 | uint8_t *scr = dst; |
183 | #if defined(FB_INVERT_ENDIAN) |
198 | #if defined(FB_INVERT_ENDIAN) |
Line 558... | Line 573... | ||
558 | case VISUAL_BGR_0_8_8_8: |
573 | case VISUAL_BGR_0_8_8_8: |
559 | screen.rgb2scr = bgr_byte0888; |
574 | screen.rgb2scr = bgr_byte0888; |
560 | screen.scr2rgb = byte0888_bgr; |
575 | screen.scr2rgb = byte0888_bgr; |
561 | screen.pixelbytes = 4; |
576 | screen.pixelbytes = 4; |
562 | break; |
577 | break; |
- | 578 | case VISUAL_BGR_8_8_8_0: |
|
- | 579 | screen.rgb2scr = bgr_byte8880; |
|
- | 580 | screen.scr2rgb = byte8880_bgr; |
|
- | 581 | screen.pixelbytes = 4; |
|
- | 582 | break; |
|
563 | default: |
583 | default: |
564 | return false; |
584 | return false; |
565 | } |
585 | } |
566 | 586 | ||
567 | screen.fbaddress = (unsigned char *) addr; |
587 | screen.fbaddress = (unsigned char *) addr; |