AGG changes for MapScript maintainers

Tamas Szekeres szekerest at GMAIL.COM
Sun Aug 12 17:13:18 EDT 2007


Howard,

I would prefer the policy to keep any of the AGG/GD specific switches
inside the mapserver core if possible. In this regard we might want to
establish the corresponding renderer neutral functions like:

unsigned char *msSaveImageBuffer(imageObj *img, int *size_ptr,
outputFormatObj *format);

void imageFree(imageObj *img);

The latter would wrap gdFree inside. As far as I can see currently
gdFree is used by both of the renderers. However in the future we'll
possibly have a renderer specific destroy function for the
corresponding image that'll make the things more complicated.

Best regards,

Tamas



2007/8/12, Howard Butler <hobu.inc at gmail.com>:
> Language-specific MapScript typemaps or specializations need to be
> updated to not exclusively use MapServer GD functions.  Previously,
> the default implementation of getBytes in image.i did:
>
> buffer.data = msSaveImageBufferGD(self->img.gd, &buffer.size, self-
>  >format);
>
> Additionally, there is now an if test to check for the presence of an
> AGG driver and use the corresponding method to get the image buffer.
> If your MapScript language just uses getBytes for all of its buffer/
> image handling (other than the image.save() method which does not
> require any swig interface changes), you should be ok.  If you
> MapScript language has overrides or %extends of imageObj's methods,
> they will need to be updated to do the following in the case of an
> AGG format:
>
> buffer.data = msSaveImageBufferAGG(self->img.gd, &buffer.size, self-
>  >format);
>
> I have updated some of the Python extensions (I do not have its
> image.write() done yet for AGG), and a quick browse showed at least
> C# with some overrides that need to be updated.  Java and Ruby too?
> Hopefully we can the necessary changes in before the next beta as
> more folks start testing MapServer 5.0 to make pretty pictures :)
>
> Howard
>



More information about the mapserver-dev mailing list