[mapguide-internals] RFC 40 - Support for using the AGG renderer
Traian Stanev
traian.stanev at autodesk.com
Fri Oct 19 18:47:37 EDT 2007
Yeah of course I'll share the code, but I have not yet run it, to see if it actually works :-)... The destination color needs to be scaled by its own alpha in addition to the inverse of the source alpha. This also implies three additional multiplications, additions and shifts, which makes it slower, but inevitably so. It's equivalent to a fix that Frank added to GD at some point in the past (I saw his name in the comments in GD's sources).
Traian
-----Original Message-----
From: mapguide-internals-bounces at lists.osgeo.org on behalf of Paul Spencer (External)
Sent: Fri 10/19/2007 5:47 PM
To: MapGuide Internals Mail List
Cc:
Subject: Re: [mapguide-internals] RFC 40 - Support for using the AGG renderer
Thanks for the clarifications Traian. I believe Frank corrected my
statement of the problem in his reply. As you are avoiding GD, my
other concerns are no longer relevant anyway.
It may be nice to share your alpha solution with MapServer folks :)
Paul
On 19-Oct-07, at 5:03 PM, Traian Stanev wrote:
> Rendering will be done into a non-GD buffer. This is because GD has a
> strange idea of what alpha is, and also it drops one bit of precision
> from the alpha.
>
> For PNG output, I wrote code to write the PNG directly, rather than go
> via GD. Again, due to GD dropping one bit out of the alpha. For JPG
> and
> GIF output, it goes via GD, since the alpha is not important in those
> cases.
>
> Alpha blending in AGG did not take into account blending over a
> transparent background (maybe that's what you mean by transparency
> between layers?). I wrote a new blender routine for agg to do that
> correctly.
>
>
> Traian
>
>
>> -----Original Message-----
>> From: mapguide-internals-bounces at lists.osgeo.org [mailto:mapguide-
>> internals-bounces at lists.osgeo.org] On Behalf Of Paul Spencer
> (External)
>> Sent: Friday, October 19, 2007 4:47 PM
>> To: MapGuide Internals Mail List
>> Subject: Re: [mapguide-internals] RFC 40 - Support for using the AGG
>> renderer
>>
>> I am concerned about maintaining a fork independently of MapServer
>> and other OSGeo projects that might use AGG. I propose that the fork
>> be maintained in a separate repository on OSGeo infrastructure with
>> the intention of involving at least the MapServer folks, and possibly
>> others that care since they have the same license issues. Initially,
>> commit access can be limited to Traian ;)
>>
>> I am assuming that the AGG renderer will render into a GD buffer and
>> GD will still be used to do image I/O. Is this correct?
>>
>> MapServer 5.0 includes a capability to convert PNG24 into PNG8 with a
>> predetermined palette of colours that must be preserved during the
>> quantization process. I would recommend that this is looked at as
>> part of this work and perhaps made available as an option.
>>
>> There is a known issue with GD and how it handles the alpha channel
>> that made it impossible to support alpha transparency between layers
>> when MapServer implemented AGG. I believe the issue was that GD had
>> a non-standard way of looking at the 4th byte in a 32 byte buffer,
>> more of an opacity rather than transparency (or the other way
>> around). Are you aware of this issue and prepared to work around
>> it? I believe the current maintainer of GD (part of PHP now) is
>> aware of the issue and may fix it in a future version.
>>
>> Cheers
>>
>> Paul
>>
>> On 19-Oct-07, at 4:35 PM, Tom Fukushima wrote:
>>
>>> Hi,
>>>
>>> Please take a look at "RFC 40 - Support for using the AGG renderer"
>>> (http://trac.osgeo.org/mapguide/wiki/MapGuideRfc40) and post
>>> feedback to
>>> the list.
>>>
>>> Thanks
>>> Tom
>>> _______________________________________________
>>> mapguide-internals mailing list
>>> mapguide-internals at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/mapguide-internals
>>
>> +-----------------------------------------------------------------+
>> |Paul Spencer pspencer at dmsolutions.ca |
>> +-----------------------------------------------------------------+
>> |Chief Technology Officer |
>> |DM Solutions Group Inc http://www.dmsolutions.ca/ |
>> +-----------------------------------------------------------------+
>>
>>
>>
>>
>>
>> _______________________________________________
>> mapguide-internals mailing list
>> mapguide-internals at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapguide-internals
>
>
> _______________________________________________
> mapguide-internals mailing list
> mapguide-internals at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-internals
+-----------------------------------------------------------------+
|Paul Spencer pspencer at dmsolutions.ca |
+-----------------------------------------------------------------+
|Chief Technology Officer |
|DM Solutions Group Inc http://www.dmsolutions.ca/ |
+-----------------------------------------------------------------+
_______________________________________________
mapguide-internals mailing list
mapguide-internals at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-internals
More information about the mapguide-internals
mailing list