[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Rendering onto background image
From: |
Sven Neumann |
Subject: |
Re: Rendering onto background image |
Date: |
Wed, 07 Jun 2000 21:24:33 +0200 |
Hi,
>
> I previously posted a message regarding
> rendering onto a background image and indicated
> that, to blend, I was using :
>
> (pen.red( x) + background.red( 1-x)) /x
>
> where x is the number in the glyph pixmap ( 0-4),
> for each color component
>
> I am acutally using
>
> (pen.red( x) + background.red( 4-x)) /x
>
> and getting results that are not as good as I would
> like ( see attachment for example )
>
It depends how your image data is stored. Assuming you use
RGB with 8 bit per channel, you will want to use the
following pseudo-code:
result.red = pen.red * x + background.red (255 - x)
Please not that the values of x are in the range [0..255].
If you use the smooth renderer, it will be 0,1,2,...,255,
otherwise 0,64,127,195,255. At least that's true for
freetype2.
Salut, Sven