Click to See Complete Forum and Search --> : libart and aa


anshelm
04-02-2002, 02:00 PM
How does libart handle anti-aliasing?

I found online documentation for libart at http://www.gnome.org/~mathieu/libart/libart.html , and it included some sample code. I modified the code to try to get it to draw an aa'd triangle in the way I gathered from the documentation. The render code now looks like this:


art_u8 *buffer = NULL;
art_u32 color = (0x00 << 24) | (0x00 << 16) | (0xFF << 8) | (0xFF);
art_u32 colorback = (0xFF << 24) | (0xFF << 16) | (0xFF << 8) | (0xFF);

buffer = art_new (art_u8, WIDTH*HEIGHT*BYTES_PER_PIXEL); // 320*300*3
art_rgb_run_alpha (buffer, 0xFF, 0xFF, 0xFF, 0xFF, WIDTH*HEIGHT);
art_rgb_svp_alpha (path, 0, 0, WIDTH, HEIGHT, color, buffer, ROWSTRIDE, NULL);
art_rgb_svp_aa (path, 0, 0, WIDTH, HEIGHT, color, colorback, buffer, ROWSTRIDE, NULL);


(The only differences between the two functions are that I added the function call to 'art_rgb_svp_aa' and the declaration of 'colorback')

When I called the original function, it drew the triangle just fine (but with jagged edges).

When I call this function it only draws a thin anti-aliased border.

(Also, when I reversed the order of the last two function calls, it appeared identical to the original function's results)

Is it supposed to do that? Or am I doing something wrong?

I've had no luck looking for further online docs on libart... any references would be appreciated!

[ 02 April 2002: Message edited by: anshelm ]

[ 02 April 2002: Message edited by: anshelm ]