>How is the framebuffer memory organized?  e.g. if I open /dev/fb0,
>mmap it and try to draw stuff, is each pixel 18 bits, or 3 bytes
>aligned in a particular way?

It sort of funky.  Here's a couple of macros:

#define xze2_writeRGBpixelTo666(p,R,G,B) { p[0]=((G&0x0C)<<4)|(B>>2); 
p[1]=((R&0x3C)<<2)|((G&0xF0)>>4); p[2]=R>>6; }

#define xze2_writeRGBpixelTo666inc(p, R, G, B) { *p=((G&0x0C)<<4)|(B>>2); p++; 
*p=((R&0x3C)<<2)|((G&0xF0)>>4); p++; *p=R>>6; }


Where 'p' is a unsigned char pointer to the framebuffer memory, and R, G, and B 
are 0-255 values.  (Each pixel is 3-bytes.  Pixels are contiguous row to row.)

-Pat



      
____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

Reply via email to