diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2006-01-31 23:02:05 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2006-01-31 23:02:05 +0000 |
commit | 62b22ba45f8a43cb95a0330c494b421c863f07d6 (patch) | |
tree | cc40b0042be9e9618d1fab36d066967ccaa41d82 /apps/recorder/bmp.c | |
parent | d563ac6caa595f0f8f6d9493b191973ee710581a (diff) | |
download | rockbox-62b22ba45f8a43cb95a0330c494b421c863f07d6.tar.gz rockbox-62b22ba45f8a43cb95a0330c494b421c863f07d6.zip |
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/recorder/bmp.c')
-rw-r--r-- | apps/recorder/bmp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/recorder/bmp.c b/apps/recorder/bmp.c index 1d4d8147b1..5f596efdda 100644 --- a/apps/recorder/bmp.c +++ b/apps/recorder/bmp.c | |||
@@ -222,8 +222,8 @@ int read_bmp_file(char* filename, | |||
222 | } | 222 | } |
223 | 223 | ||
224 | /* Use the darker palette color as foreground on mono bitmaps */ | 224 | /* Use the darker palette color as foreground on mono bitmaps */ |
225 | if(readshort(&fh.BitCount) == 1) { | 225 | if(depth == 1) { |
226 | if(brightness(palette[0]) > brightness(palette[1])) | 226 | if(brightness(palette[0]) < brightness(palette[1])) |
227 | invert_pixel = 1; | 227 | invert_pixel = 1; |
228 | } | 228 | } |
229 | 229 | ||
@@ -260,12 +260,12 @@ int read_bmp_file(char* filename, | |||
260 | /* Mono -> Mono */ | 260 | /* Mono -> Mono */ |
261 | for (col = 0; col < width; col++) { | 261 | for (col = 0; col < width; col++) { |
262 | ret = getpix(col, bmpbuf) ^ invert_pixel; | 262 | ret = getpix(col, bmpbuf) ^ invert_pixel; |
263 | if (ret == 1) { | 263 | if (ret) { |
264 | bitmap[width * ((height - row - 1) / 8) + col] | 264 | bitmap[width * ((height - row - 1) / 8) + col] |
265 | &= ~ 1 << ((height - row - 1) % 8); | 265 | |= 1 << ((height - row - 1) % 8); |
266 | } else { | 266 | } else { |
267 | bitmap[width * ((height - row - 1) / 8) + col] | 267 | bitmap[width * ((height - row - 1) / 8) + col] |
268 | |= 1 << ((height - row - 1) % 8); | 268 | &= ~ 1 << ((height - row - 1) % 8); |
269 | } | 269 | } |
270 | } | 270 | } |
271 | #if LCD_DEPTH == 2 | 271 | #if LCD_DEPTH == 2 |