Rev 3618 | Rev 3742 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3618 | Rev 3664 | ||
---|---|---|---|
Line 189... | Line 189... | ||
189 | { |
189 | { |
190 | *((uint8_t *) dst) = RED(rgb, 3) << 5 | GREEN(rgb, 2) << 3 | |
190 | *((uint8_t *) dst) = RED(rgb, 3) << 5 | GREEN(rgb, 2) << 3 | |
191 | BLUE(rgb, 3); |
191 | BLUE(rgb, 3); |
192 | } |
192 | } |
193 | 193 | ||
- | 194 | static void sb1500rgb_byte8(void *dst, int rgb) |
|
- | 195 | { |
|
- | 196 | if (RED(rgb, 1) && GREEN(rgb, 1) && BLUE(rgb, 1)) |
|
- | 197 | *((uint8_t *) dst) = 255; |
|
- | 198 | else if (RED(rgb, 1) && GREEN(rgb, 1)) |
|
- | 199 | *((uint8_t *) dst) = 150; |
|
- | 200 | else if (GREEN(rgb, 1) && BLUE(rgb, 1)) |
|
- | 201 | *((uint8_t *) dst) = 47; |
|
- | 202 | else if (RED(rgb, 1) && BLUE(rgb, 1)) |
|
- | 203 | *((uint8_t *) dst) = 48; |
|
- | 204 | else if (RED(rgb, 1)) |
|
- | 205 | *((uint8_t *) dst) = 32; |
|
- | 206 | else if (GREEN(rgb, 1)) |
|
- | 207 | *((uint8_t *) dst) = 47; |
|
- | 208 | else if (BLUE(rgb, 1)) |
|
- | 209 | *((uint8_t *) dst) = 2; |
|
- | 210 | else |
|
- | 211 | *((uint8_t *) dst) = 1; |
|
- | 212 | } |
|
- | 213 | ||
194 | /** Return pixel color - 8-bit depth (color palette/3:2:3) |
214 | /** Return pixel color - 8-bit depth (color palette/3:2:3) |
195 | * |
215 | * |
196 | * See the comment for rgb_byte(). |
216 | * See the comment for rgb_byte(). |
197 | */ |
217 | */ |
198 | static int byte8_rgb(void *src) |
218 | static int byte8_rgb(void *src) |
Line 445... | Line 465... | ||
445 | case VISUAL_INDIRECT_8: |
465 | case VISUAL_INDIRECT_8: |
446 | rgb2scr = rgb_byte8; |
466 | rgb2scr = rgb_byte8; |
447 | scr2rgb = byte8_rgb; |
467 | scr2rgb = byte8_rgb; |
448 | pixelbytes = 1; |
468 | pixelbytes = 1; |
449 | break; |
469 | break; |
- | 470 | case VISUAL_SB1500_PALETTE: |
|
- | 471 | rgb2scr = sb1500rgb_byte8; |
|
- | 472 | scr2rgb = byte8_rgb; |
|
- | 473 | pixelbytes = 1; |
|
- | 474 | break; |
|
450 | case VISUAL_RGB_5_5_5: |
475 | case VISUAL_RGB_5_5_5: |
451 | rgb2scr = rgb_byte555; |
476 | rgb2scr = rgb_byte555; |
452 | scr2rgb = byte555_rgb; |
477 | scr2rgb = byte555_rgb; |
453 | pixelbytes = 2; |
478 | pixelbytes = 2; |
454 | break; |
479 | break; |