Monday, February 15, 2010

gnocl::pixBuf #4

This morning got the composite function working. The relevant snippet from the test script shows how it is to be used. The values passed to the actual library call are dummies at the moment and so the numeric values are just to aid the development process.

# composite images

set dest [gnocl::pixBuf new {100 100 8} \
   -alpha {255 255 255} \
   -foregroundColor red \
   -backgroundColor white \
   -baseFont {Sans 10} \
   -name LXY \
   -data {Jane & Georgia} ]

$dest fill red

set src [gnocl::pixBuf new {50 50 8} \
   -alpha {255 255 255} \
   -foregroundColor blue \
   -backgroundColor white \
   -baseFont {Sans 10} \
   -name LXY \
   -data {Jane & Georgia} ]

$src fill white

$dest composite $src \
   -destX 1 \
   -destY 2 \
   -destWidth 3 \
   -destHeight 4 \
   -offsetX 5 \
   -offsetY 6 \
   -scaleX 7 \
   -scaleY 8 \
   -interpType 9 \
   -alpha 10

$dest save testSave.png

This is what is produced:



Issues arising from this is that svg files, perhaps due to these being vector files, are not handled well by the gdk library calls. Perhaps this is why the Cairo is suggested as the best choice. The free rotation of the svg didn't work at all, besides which, the current algorithm used results in a very clear sawtooth edge around the resultant operation.

No comments: