[mapserver-dev] mapgd2 - raster support

thomas bonfort thomas.bonfort at gmail.com
Thu Feb 25 04:21:19 EST 2010


By supporting the GD format we have to go through some loops anywhere
that direct pixel access is needed, namely in the raster layers and
the pixmap symbols. We would want to decide at what level these
alterations to the normal codepath should take place: either inside
the actual raster handling functions, or one level higher.
By putting a GdImgPtr inside the rasterBufferObj (or inside a higher
level structure that encapsulates a rasterBufferObj and a GdImgPtr) I
find that at least for the pixmap handling code I get a cleaner api as
I don't have handle different cases everywhere a pixmap symbol is
used.
For the raster layers, I'd say that it doesn't matter that much: it
would be at your preference in msDrawRasterLayer to either call
drawRasterLayerLow with a rasterBufferObj that contains a GdImgPtr, or
a version that takes a gdImgPtr directly (I would tend to prefer the
second option).

In pseudo code, msDrawRasterLayer would be:

if MS_RENDERER_PLUGIN:
  if MS_RENDERER_GD_PLUGIN:
    msDrawRasterLayerLowGD( (GdImgPtr)image->img->plugin)
  else:
    rasterBufferObj *rb = image->renderer->getRasterBuffer()
    msDrawRasterLayerLowPlugin(rb)

regards,
thomas


On Wed, Feb 24, 2010 at 19:57, Frank Warmerdam <warmerdam at pobox.com> wrote:
> Lime, Steve D (DNR) wrote:
>>
>> I think the gdImagePtr in the imageObj becomes obsolete if GD is
>> implemented solely as a plugin renderer (pdf and svg pointers too
>> potentially). Thomas has proposed
>> holding gdImagePtr instead in the rasterBufferObj. I think he's found it
>> will make pixmap symbol support much simpler.
>>
>> One other thing, we talked about GD supporting *only* PC256 image types
>> and really cutting back on the use cases.
>
> Steve,
>
> Ugg, this seems like such a foul hack on an otherwise fairly clean
> rasterBufferObj architecture.  Couldn't we just add an
> msGetGD2_gdImg(imageObj*) function which could call if we establish that
> the imageObj->format is the GD2 renderer and it would return the gdImg
> pointer?  We could even add a function in the VTable which would
> return an opaque "renderer object pointer" whose interpretation would
> depend on the specific renderer.  Then we could use that for the GD2
> renderer to get the gdImg.
>
> Best regards,
> --
> ---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up   | Frank Warmerdam,
> warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush    | Geospatial Programmer for Rent
>
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev
>


More information about the mapserver-dev mailing list