mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-19 10:02:45 -05:00
Slighly less confusing handling of inverted monochrome images
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8513 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
d563ac6caa
commit
62b22ba45f
1 changed files with 6 additions and 6 deletions
|
|
@ -222,8 +222,8 @@ int read_bmp_file(char* filename,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Use the darker palette color as foreground on mono bitmaps */
|
/* Use the darker palette color as foreground on mono bitmaps */
|
||||||
if(readshort(&fh.BitCount) == 1) {
|
if(depth == 1) {
|
||||||
if(brightness(palette[0]) > brightness(palette[1]))
|
if(brightness(palette[0]) < brightness(palette[1]))
|
||||||
invert_pixel = 1;
|
invert_pixel = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -260,12 +260,12 @@ int read_bmp_file(char* filename,
|
||||||
/* Mono -> Mono */
|
/* Mono -> Mono */
|
||||||
for (col = 0; col < width; col++) {
|
for (col = 0; col < width; col++) {
|
||||||
ret = getpix(col, bmpbuf) ^ invert_pixel;
|
ret = getpix(col, bmpbuf) ^ invert_pixel;
|
||||||
if (ret == 1) {
|
if (ret) {
|
||||||
bitmap[width * ((height - row - 1) / 8) + col]
|
|
||||||
&= ~ 1 << ((height - row - 1) % 8);
|
|
||||||
} else {
|
|
||||||
bitmap[width * ((height - row - 1) / 8) + col]
|
bitmap[width * ((height - row - 1) / 8) + col]
|
||||||
|= 1 << ((height - row - 1) % 8);
|
|= 1 << ((height - row - 1) % 8);
|
||||||
|
} else {
|
||||||
|
bitmap[width * ((height - row - 1) / 8) + col]
|
||||||
|
&= ~ 1 << ((height - row - 1) % 8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if LCD_DEPTH == 2
|
#if LCD_DEPTH == 2
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue