summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2006-01-31 23:02:05 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2006-01-31 23:02:05 +0000
commit62b22ba45f8a43cb95a0330c494b421c863f07d6 (patch)
treecc40b0042be9e9618d1fab36d066967ccaa41d82 /apps
parentd563ac6caa595f0f8f6d9493b191973ee710581a (diff)
downloadrockbox-62b22ba45f8a43cb95a0330c494b421c863f07d6.zip
rockbox-62b22ba45f8a43cb95a0330c494b421c863f07d6.tar.gz
rockbox-62b22ba45f8a43cb95a0330c494b421c863f07d6.tar.bz2
rockbox-62b22ba45f8a43cb95a0330c494b421c863f07d6.tar.xz
Slighly less confusing handling of inverted monochrome images
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8513 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/recorder/bmp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/recorder/bmp.c b/apps/recorder/bmp.c
index 1d4d814..5f596ef 100644
--- a/apps/recorder/bmp.c
+++ b/apps/recorder/bmp.c
@@ -222,8 +222,8 @@ int read_bmp_file(char* filename,
}
/* Use the darker palette color as foreground on mono bitmaps */
- if(readshort(&fh.BitCount) == 1) {
- if(brightness(palette[0]) > brightness(palette[1]))
+ if(depth == 1) {
+ if(brightness(palette[0]) < brightness(palette[1]))
invert_pixel = 1;
}
@@ -260,12 +260,12 @@ int read_bmp_file(char* filename,
/* Mono -> Mono */
for (col = 0; col < width; col++) {
ret = getpix(col, bmpbuf) ^ invert_pixel;
- if (ret == 1) {
+ if (ret) {
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);
+ &= ~ 1 << ((height - row - 1) % 8);
}
}
#if LCD_DEPTH == 2