Skip to content

optimize gamma setting #1174

Closed
springmeyer opened this Issue Apr 12, 2012 · 3 comments

2 participants

@springmeyer
Mapnik member

To allow fine control over antialiasing level we allow users to set gamma and gamma-method properties on many symbolizers, like the polygon_symbolizer here

However, it appears the gamma setting is taking up a non-trivial amount of time:

The gamma array is not free, which is why AGG by default only calculates it once in the constructor:

https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_rasterizer_scanline_aa.h#L148-173

Perhaps we could expose a public setter that can trigger returning to the default gamma without having to recalculate based on a function?

@artemp
Mapnik member
artemp commented Mar 14, 2013

@springmeyer - why do we ---> gamma_method_(GAMMA_POWER) by default?

gamma_method_(GAMMA_NONE) -- is less expensive

@springmeyer
Mapnik member

Gamma power came in from tomtom pull req. also a mailing list entry about it being slightly higher quality than linear.

@springmeyer
Mapnik member

did some light perf testing against above changes: I rendered all of processed_p at z0. Rendering with a single <PolygonSymbolizer> took 4 seconds before this change and 3 after. Rendering with a single <LineSymbolizer> took 14 seconds before this change and 13 after.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.