[Tuxpaint-devel] some more investigation on grass plugin
An award-winning drawing program for children of all ages
Brought to you by:
wkendrick
|
From: Alessandro P. <apa...@gm...> - 2007-12-10 15:53:47
|
Hi,
I'm still having problem but maybe I've found where to look for errors.
I seems like the function getpixel() return wrong values.
If I've got it right, the plugin reads a rgba pixel value from
grass_data.png, then applies some transformations on that value and
draws the new pixel on the canvas.
I put some printf in the code
printf("Getpixel %d %d img_grass rgba : %d %d %d %d\n", xx + src.x, yy
+ src.y, r, g, b, a);
and I see this output (alternatively):
Getpixel 124 63 img_grass rgba : 82 180 0 0
Getpixel 125 63 img_grass rgba : 17 0 0 0
the pixel values in the image have a fixed rgb and a variable alpha
channel, the bytes are hence
82 180 17 xx
where xx is the alpha and changes from 0% to 100% among the image.
Perhaps the problem is the following:
the api passes to the plugin a getpixel function pointer chosen from
the getpixels pool with the canvas color depth, which could be
different from the color depth of the image.
Since I'm running the test in a Xephyr maemo SDK emulator, the color
depth is probably lower than a standard true color X display.
Any comment?
--
Alessandro Pasotti
w3: www.itopen.it
|