# HG changeset patch # User sl # Date 1401205773 -7200 # Node ID ee1305f3a6bfd738a2fb42d3040f4bd02497a933 # Parent df50d7cb4dd06717b5038b98eff1e4b6927d45cf Experimenting with our bitmap to bitarray convertion. diff -r df50d7cb4dd0 -r ee1305f3a6bf inc/BitArray.h --- a/inc/BitArray.h Sat May 24 09:24:40 2014 +0200 +++ b/inc/BitArray.h Tue May 27 17:49:33 2014 +0200 @@ -89,6 +89,7 @@ }; /** +TODO: Derive a Bit Frame class from this one for X Y access to pixels. */ class BitArray { diff -r df50d7cb4dd0 -r ee1305f3a6bf src/BitArray.cpp --- a/src/BitArray.cpp Sat May 24 09:24:40 2014 +0200 +++ b/src/BitArray.cpp Tue May 27 17:49:33 2014 +0200 @@ -100,9 +100,9 @@ #define BIT_CHAR(bit) ((bit) / CHAR_BIT) /* array index for character containing bit */ -//SL: that for big endian? +//SL: We had to change that macro since bits in our frame buffer are the other way around +//TODO: Find a solution to tackle that problem //#define BIT_IN_CHAR(bit) (1 << (CHAR_BIT - 1 - ((bit) % CHAR_BIT))) -//SL: I guess we want little endian for our Futaba GP1212A01A #define BIT_IN_CHAR(bit) (1 << (((bit) % CHAR_BIT))) /* number of characters required to contain number of bits */ diff -r df50d7cb4dd0 -r ee1305f3a6bf src/test.cpp --- a/src/test.cpp Sat May 24 09:24:40 2014 +0200 +++ b/src/test.cpp Tue May 27 17:49:33 2014 +0200 @@ -797,7 +797,11 @@ for (int j=0;jgetPixel(i,j); - if (color!=0xffffffff) + int green=FXGREENVAL(color); + int red=FXREDVAL(color); + int blue=FXBLUEVAL(color); + if ((green+red+blue)/3<220) + //if (color!=0xffffffff) { iPixelBuffer->SetBit(i*h+j); }