Experimenting with our bitmap to bitarray convertion. default tip
authorsl
Tue, 27 May 2014 17:49:33 +0200
changeset 27ee1305f3a6bf
parent 26 df50d7cb4dd0
Experimenting with our bitmap to bitarray convertion.
inc/BitArray.h
src/BitArray.cpp
src/test.cpp
     1.1 --- a/inc/BitArray.h	Sat May 24 09:24:40 2014 +0200
     1.2 +++ b/inc/BitArray.h	Tue May 27 17:49:33 2014 +0200
     1.3 @@ -89,6 +89,7 @@
     1.4  };
     1.5  
     1.6  /**
     1.7 +TODO: Derive a Bit Frame class from this one for X Y access to pixels.
     1.8  */
     1.9  class BitArray
    1.10  {
     2.1 --- a/src/BitArray.cpp	Sat May 24 09:24:40 2014 +0200
     2.2 +++ b/src/BitArray.cpp	Tue May 27 17:49:33 2014 +0200
     2.3 @@ -100,9 +100,9 @@
     2.4  #define BIT_CHAR(bit)         ((bit) / CHAR_BIT)
     2.5  
     2.6  /* array index for character containing bit */
     2.7 -//SL: that for big endian?
     2.8 +//SL: We had to change that macro since bits in our frame buffer are the other way around
     2.9 +//TODO: Find a solution to tackle that problem
    2.10  //#define BIT_IN_CHAR(bit)      (1 << (CHAR_BIT - 1 - ((bit)  % CHAR_BIT)))
    2.11 -//SL: I guess we want little endian for our Futaba GP1212A01A
    2.12  #define BIT_IN_CHAR(bit)      (1 << (((bit)  % CHAR_BIT)))
    2.13  
    2.14  /* number of characters required to contain number of bits */
     3.1 --- a/src/test.cpp	Sat May 24 09:24:40 2014 +0200
     3.2 +++ b/src/test.cpp	Tue May 27 17:49:33 2014 +0200
     3.3 @@ -797,7 +797,11 @@
     3.4  			for (int j=0;j<h;j++)
     3.5  				{				
     3.6  				FXColor color=iFontImage->getPixel(i,j);
     3.7 -				if (color!=0xffffffff)
     3.8 +				int green=FXGREENVAL(color);
     3.9 +				int red=FXREDVAL(color);
    3.10 +				int blue=FXBLUEVAL(color);
    3.11 +				if ((green+red+blue)/3<220)
    3.12 +				//if (color!=0xffffffff)
    3.13  					{
    3.14  					iPixelBuffer->SetBit(i*h+j);
    3.15  					}