[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libcaca] Re: Bitmap is shown vertically flipped



On Mon, Dec 15, 2003, Zeeshan Ali wrote:

> typedef struct
> {
>   unsigned char rgbtBlue;
>   unsigned char rgbtGreen;
>   unsigned char rgbtRed;
> } RGBTRIPLE;
> 
>    So should'nt this deal with the problem of Red &
> Blue being swapped? 

   You're right, I misread your code. You've just been bitten by an
endianness problem: on a PC, if you write the chars 0x12, 0x34, 0x56 and
0x78 in memory, the resulting word is 0x78563412 (and not 0x12345678),
so the bitmask for 0x12 should be 0x000000ff and not 0xff000000.

   You can have a look at cacaview's BMP loader (that will be shipped
with libcaca 0.3) here:

     http://sam.zoy.org/cgi-bin/viewcvs.cgi/trunk/examples/view.c?rev=152&root=libcaca&view=markup

>    Another thing that is bothering me is that the
> 'blank' parts of image 'blinks' on console but not on
> emuated terminals (xterm & gnome-terminal). Bye.

   The terminal emulators use the blink tag for light colours, while the
console still honours the blink tag. I will make usage of light colours
configurable in the future. If you want to avoid this behaviour, you can
try to enable the kernel's framebuffer console.

-- 
Sam.
-- 
This is the libcaca mailing-list, see http://sam.zoy.org/projects/libcaca/
Trouble unsubscribing? Please contact <sam@zoy.org>