Skip to contentSkip to conversation

fb_imageblit semantic

DISCUSSION Petr Vandrovec 3 participants 3 messages Mar 14, 2003 – Mar 17, 2003 Framebuffer layer

lore
Share & tools
lore
#0 lore raw
Quoted 15 lines · Geert Uytterhoeven
Quoted 14 lines · Petr Vandrovec
Quoted 12 lines · Geert Uytterhoeven
Quoted 3 lines · Petr Vandrovec

Why do you pass image.depth == 16 (or 24 or 32) to fb_imageblit when logo image is in reality always 8bpp, as quick look at cfb_imageblit revealed?

Should indeed be 8.

Quoted 3 lines

Should I just assume that image.depth == 1 means that data are 1bpp with fgcol/bgcol valid, and all other depths mean 8bpp input?

This was changed from 1 to 0 in James' latest tree.

Quoted 8 lines
Quoted 3 lines

WTF? Color depth 0 means that whole picture is single-color, and imageblit degenerates to rectfill in such case. Please, either use 'depth' as source image color depth, or do not name it depth.

It's 0 (expand [bf]gcol) to differentiate from 1 (copy monochrome).

Splitting imageblit into separate routines for both operations would be trivial, though.

There is no such thing as copy monochrome if target is not monochrome, you have to put palette somewhere. If you'll look at cfb_imageblit, you'll find that there is already defined way to do that: code uses artifically created 256 entry pseudopalette... If target is monochrome, it just copies data. If target is not monochrome, it has somehow expand data to fit to screen format. Nothing differs between font painting and copying 1bpp bitmap to Xbpp display.

OK, so rule is that if depth=0, input is 1bpp with palette in bgcol/fgcol, while if depth != 0, then palette is in info->pseudo_palette ?
Thanks,
Petr Vandrovec [email protected]

-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! Get cracking and register here for some mind boggling fun and the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en

#1 lore raw
Quoted 25 lines · Petr Vandrovec
Quoted 15 lines · Geert Uytterhoeven
Quoted 14 lines · Petr Vandrovec
Quoted 12 lines · Geert Uytterhoeven
Quoted 3 lines · Petr Vandrovec

Why do you pass image.depth == 16 (or 24 or 32) to fb_imageblit when logo image is in reality always 8bpp, as quick look at cfb_imageblit revealed?

Should indeed be 8.

Quoted 3 lines

Should I just assume that image.depth == 1 means that data are 1bpp with fgcol/bgcol valid, and all other depths mean 8bpp input?

This was changed from 1 to 0 in James' latest tree.

Quoted 8 lines
Quoted 3 lines

WTF? Color depth 0 means that whole picture is single-color, and imageblit degenerates to rectfill in such case. Please, either use 'depth' as source image color depth, or do not name it depth.

It's 0 (expand [bf]gcol) to differentiate from 1 (copy monochrome).

Splitting imageblit into separate routines for both operations would be trivial, though.

Quoted 8 lines

There is no such thing as copy monochrome if target is not monochrome, you have to put palette somewhere. If you'll look at cfb_imageblit, you'll find that there is already defined way to do that: code uses artifically created 256 entry pseudopalette... If target is monochrome, it just copies data. If target is not monochrome, it has somehow expand data to fit to screen format. Nothing differs between font painting and copying 1bpp bitmap to Xbpp display.

It's mainly code consistency and simplicity.

1. character painting - monochrome input with color in fg_color and bg_color

2. logo drawing - array of 8-bit color indices which may or may not point to info->pseudo_palette

Unfortunately, monochrome framebuffers will be affected (how does it interpret if request is character painting or logo drawing). One solution is to make an exception for monochrome so we always pass it packed mono data whether character or logo drawing. The second, to avoid the former's inconsistency but has a more confusing semantics, is make image->depth=0 to mean monochrome expansion.

As Geert said, it's not just trivial, but logical to split fb_imageblit into two.

Quoted 2 lines

OK, so rule is that if depth=0, input is 1bpp with palette in bgcol/fgcol, while if depth != 0, then palette is in info->pseudo_palette ?

Yes. You can also say that if image->depth != var->bits_per_pixel, do color expansion or reduction, whatever the case may be.

Tony

-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! Get cracking and register here for some mind boggling fun and the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en

#2 lore raw
Quoted 2 lines · Antonino Daplas

As Geert said, it's not just trivial, but logical to split fb_imageblit into two.

So, are we gonna split it? This will also make hardware acceleration support more clean. E.g. most sbus drivers do color expansion in hardware, and fall back to cfb_imageblit() for the logo.

Quoted 5 lines
Quoted 2 lines

OK, so rule is that if depth=0, input is 1bpp with palette in bgcol/fgcol, while if depth != 0, then palette is in info->pseudo_palette ?

Yes. You can also say that if image->depth != var->bits_per_pixel, do color expansion or reduction, whatever the case may be.

Hmmm... Note that image->depth can be larger than 8, while the image data is still 8-bit. This is an inconsistency.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! Get cracking and register here for some mind boggling fun and the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en