optimize gamma setting #1174

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

Comments

Projects
None yet
2 participants
@springmeyer
Member

springmeyer commented Apr 12, 2012

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

This comment has been minimized.

Show comment
Hide comment
@artemp

artemp Mar 14, 2013

Member

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

gamma_method_(GAMMA_NONE) -- is less expensive

Member

artemp commented Mar 14, 2013

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

gamma_method_(GAMMA_NONE) -- is less expensive

@springmeyer

This comment has been minimized.

Show comment
Hide comment
@springmeyer

springmeyer Mar 14, 2013

Member

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

Member

springmeyer commented Mar 14, 2013

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

@springmeyer

This comment has been minimized.

Show comment
Hide comment
@springmeyer

springmeyer Mar 15, 2013

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.

Member

springmeyer commented Mar 15, 2013

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