author | francesco-ST <francesco.abbate@st.com> | 2010年07月26日 10:30:04 +0200 |
---|---|---|
committer | francesco-ST <francesco.abbate@st.com> | 2010年07月26日 10:30:04 +0200 |
commit | 4a8742d4109af38b035b97c0a55e9152ff5a762f (patch) | |
tree | c82b31e50d9c4843ee10353f3a2f47d668cb24ff | |
parent | 4a55ed9a3a350d354eef6705408bd2ae3fec3b0b (diff) | |
download | gsl-shell-4a8742d4109af38b035b97c0a55e9152ff5a762f.tar.gz |
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | agg-plot/canvas.h | 17 | ||||
-rw-r--r-- | makeconfig | 3 |
@@ -76,7 +76,6 @@ else endif ifeq ($(strip $(ENABLE_AGG_PLOT)), yes) -# C_SRC_FILES += lua-plot.c INCLUDES += $(PTHREADS_CFLAGS) -Iagg-plot SUBDIRS += agg-plot DEFS += -DAGG_PLOT_ENABLED @@ -85,6 +84,11 @@ ifeq ($(strip $(ENABLE_AGG_PLOT)), yes) LIBS += $(PTHREADS_LIBS) $(AGG_LIBS) endif +ifneq ($(strip $(ENABLE_GAMMA_CORR)), no) + DEFS += -DENABLE_GAMMA_CORR + SUBDIRS_DEFS += -DENABLE_GAMMA_CORR +endif + ifeq ($(strip $(ENABLE_COMPLEX)), yes) C_SRC_FILES += cmatrix.c cnlinfit.c code.c fft.c DEFS += -DLNUM_COMPLEX diff --git a/agg-plot/canvas.h b/agg-plot/canvas.h index 4cffc5d2..6599a246 100644 --- a/agg-plot/canvas.h +++ b/agg-plot/canvas.h @@ -13,19 +13,28 @@ #include "agg_trans_viewport.h" #include "agg_rasterizer_outline_aa.h" #include "agg_renderer_outline_aa.h" + +#ifdef ENABLE_GAMMA_CORR #include "agg_gamma_lut.h" +#endif #include "utils.h" class canvas { +#ifdef ENABLE_GAMMA_CORR typedef agg::gamma_lut<agg::int8u, agg::int16u, 8, 12> gamma_type; typedef agg::pixfmt_bgr24_gamma<gamma_type> pixel_fmt; +#else + typedef agg::pixfmt_bgr24 pixel_fmt; +#endif typedef agg::renderer_base<pixel_fmt> renderer_base; typedef agg::renderer_scanline_aa_solid<renderer_base> renderer_solid; typedef agg::renderer_outline_aa<renderer_base> renderer_oaa; typedef agg::rasterizer_outline_aa<renderer_oaa> rasterizer_outline_aa; +#ifdef ENABLE_GAMMA_CORR gamma_type m_gamma; +#endif pixel_fmt pixf; renderer_base rb; renderer_solid rs; @@ -47,13 +56,21 @@ class canvas { public: canvas(agg::rendering_buffer& ren_buf, double width, double height, agg::rgba bgcol): +#ifdef ENABLE_GAMMA_CORR m_gamma(2.2), pixf(ren_buf, m_gamma), rb(pixf), rs(rb), +#else + pixf(ren_buf), rb(pixf), rs(rb), +#endif prof(), ren_oaa(rb, prof), ras_oaa(ren_oaa), ras(), sl(), bg_color(bgcol), m_width(width), m_height(height) { mtx.scale(width, height); +#ifdef ENABLE_GAMMA_CORR prof.width(1.5); +#else + prof.width(1.0); +#endif }; double width() const { return m_width; }; diff --git a/makeconfig b/makeconfig index 0cbd95fc..f07e915e 100644 --- a/makeconfig +++ b/makeconfig @@ -3,6 +3,9 @@ ENABLE_COMPLEX = yes ENABLE_AGG_PLOT = yes BUILD_LUA_DLL = no +# set this to "no" if you want to disable gamma correction +# ENABLE_GAMMA_CORR = no + # PLATFORM should can be linux or mingw PLATFORM = none |