Changeset 19490ce in mainline for kernel/genarch/src/fb/fb.c
- Timestamp:
- 2009-08-03T21:06:35Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9035c5a
- Parents:
- dd2cfa7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/fb/fb.c
rdd2cfa7 r19490ce 146 146 } 147 147 148 static void bgr_555(void *dst, uint32_t rgb) 149 { 150 uint8_t hi = (BLUE(rgb, 5) | (GREEN(rgb, 5) << 5)) & 0xff; 151 uint8_t lo = (GREEN(rgb, 5) >> 3) | (RED(rgb, 5) << 2); 152 *((uint16_t *) dst) = host2uint16_t_be((hi << 8) | lo); 153 } 154 155 static void bgr_565(void *dst, uint32_t rgb) 156 { 157 uint8_t hi = (BLUE(rgb, 5) | (GREEN(rgb, 6) << 5)) & 0xff; 158 uint8_t lo = (GREEN(rgb, 6) >> 3) | (RED(rgb, 5) << 3); 159 *((uint16_t *) dst) = host2uint16_t_be((hi << 8) | lo); 148 static void rgb_555_be(void *dst, uint32_t rgb) 149 { 150 *((uint16_t *) dst) = host2uint16_t_be(RED(rgb, 5) << 10 | 151 GREEN(rgb, 5) << 5 | BLUE(rgb, 5)); 152 } 153 154 static void rgb_555_le(void *dst, uint32_t rgb) 155 { 156 *((uint16_t *) dst) = host2uint16_t_le(RED(rgb, 5) << 10 | 157 GREEN(rgb, 5) << 5 | BLUE(rgb, 5)); 158 } 159 160 static void rgb_565_be(void *dst, uint32_t rgb) 161 { 162 *((uint16_t *) dst) = host2uint16_t_be(RED(rgb, 5) << 11 | 163 GREEN(rgb, 6) << 5 | BLUE(rgb, 5)); 164 } 165 166 static void rgb_565_le(void *dst, uint32_t rgb) 167 { 168 *((uint16_t *) dst) = host2uint16_t_le(RED(rgb, 5) << 11 | 169 GREEN(rgb, 6) << 5 | BLUE(rgb, 5)); 160 170 } 161 171 … … 455 465 pixelbytes = 1; 456 466 break; 457 case VISUAL_ BGR_5_5_5:458 rgb_conv = bgr_555;467 case VISUAL_RGB_5_5_5_LE: 468 rgb_conv = rgb_555_le; 459 469 pixelbytes = 2; 460 470 break; 461 case VISUAL_BGR_5_6_5: 462 rgb_conv = bgr_565; 471 case VISUAL_RGB_5_5_5_BE: 472 rgb_conv = rgb_555_be; 473 pixelbytes = 2; 474 break; 475 case VISUAL_RGB_5_6_5_LE: 476 rgb_conv = rgb_565_le; 477 pixelbytes = 2; 478 break; 479 case VISUAL_RGB_5_6_5_BE: 480 rgb_conv = rgb_565_be; 463 481 pixelbytes = 2; 464 482 break;
Note:
See TracChangeset
for help on using the changeset viewer.