From c5b7cd0e3e1c8318feebe32fc009512bc667b44d Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 23 Jul 2013 16:10:00 -0400 Subject: [PATCH] remove dead code --- include/mapnik/graphics.hpp | 53 ------------------------------------ include/mapnik/grid/grid.hpp | 24 ---------------- 2 files changed, 77 deletions(-) diff --git a/include/mapnik/graphics.hpp b/include/mapnik/graphics.hpp index ae7681304..b9a3c8f31 100644 --- a/include/mapnik/graphics.hpp +++ b/include/mapnik/graphics.hpp @@ -137,59 +137,6 @@ public: data_(x,y)=rgba; } } - inline void blendPixel(int x,int y,unsigned int rgba1,int t) - { - blendPixel2(x,y,rgba1,t,1.0); // do not change opacity - } - - inline void blendPixel2(int x,int y,unsigned int rgba1,int t,double opacity) - { - if (checkBounds(x,y)) - { - unsigned rgba0 = data_(x,y); -#ifdef MAPNIK_BIG_ENDIAN - unsigned a1 = (unsigned)((rgba1 & 0xff) * opacity) & 0xff; // adjust for desired opacity - a1 = (t*a1) / 255; - if (a1 == 0) return; - unsigned r1 = (rgba1 >> 24) & 0xff; - unsigned g1 = (rgba1 >> 16 ) & 0xff; - unsigned b1 = (rgba1 >> 8) & 0xff; - - unsigned a0 = (rgba0 & 0xff); - unsigned r0 = ((rgba0 >> 24 ) & 0xff) * a0; - unsigned g0 = ((rgba0 >> 16 ) & 0xff) * a0; - unsigned b0 = ((rgba0 >> 8) & 0xff) * a0; - - a0 = ((a1 + a0) << 8) - a0*a1; - - r0 = ((((r1 << 8) - r0) * a1 + (r0 << 8)) / a0); - g0 = ((((g1 << 8) - g0) * a1 + (g0 << 8)) / a0); - b0 = ((((b1 << 8) - b0) * a1 + (b0 << 8)) / a0); - a0 = a0 >> 8; - data_(x,y)= (a0)| (b0 << 8) | (g0 << 16) | (r0 << 24) ; -#else - unsigned a1 = (unsigned)(((rgba1 >> 24) & 0xff) * opacity) & 0xff; // adjust for desired opacity - a1 = (t*a1) / 255; - if (a1 == 0) return; - unsigned r1 = rgba1 & 0xff; - unsigned g1 = (rgba1 >> 8 ) & 0xff; - unsigned b1 = (rgba1 >> 16) & 0xff; - - unsigned a0 = (rgba0 >> 24) & 0xff; - unsigned r0 = (rgba0 & 0xff) * a0; - unsigned g0 = ((rgba0 >> 8 ) & 0xff) * a0; - unsigned b0 = ((rgba0 >> 16) & 0xff) * a0; - - a0 = ((a1 + a0) << 8) - a0*a1; - - r0 = ((((r1 << 8) - r0) * a1 + (r0 << 8)) / a0); - g0 = ((((g1 << 8) - g0) * a1 + (g0 << 8)) / a0); - b0 = ((((b1 << 8) - b0) * a1 + (b0 << 8)) / a0); - a0 = a0 >> 8; - data_(x,y)= (a0 << 24)| (b0 << 16) | (g0 << 8) | (r0) ; -#endif - } - } void composite_pixel(unsigned op, int x,int y,unsigned c, unsigned cover, double opacity); diff --git a/include/mapnik/grid/grid.hpp b/include/mapnik/grid/grid.hpp index bdbceae78..e9d7e85c1 100644 --- a/include/mapnik/grid/grid.hpp +++ b/include/mapnik/grid/grid.hpp @@ -198,30 +198,6 @@ public: return height_; } - inline void blendPixel(value_type feature_id,int x,int y,unsigned int rgba1,int t) - { - blendPixel2(feature_id ,x,y,rgba1,t,1.0); // do not change opacity - } - - inline void blendPixel2(value_type feature_id,int x,int y,unsigned int rgba1,int t,double opacity) - { - if (checkBounds(x,y)) - { - -#ifdef MAPNIK_BIG_ENDIAN - unsigned a = (int)((rgba1 & 0xff) * opacity) & 0xff; // adjust for desired opacity -#else - unsigned a = (int)(((rgba1 >> 24) & 0xff) * opacity) & 0xff; // adjust for desired opacity -#endif - // if the pixel is more than a tenth - // opaque then burn in the feature id - if (a >= 25) - { - data_(x,y) = feature_id; - } - } - } - inline void set_rectangle(value_type id,image_data_32 const& data,int x0,int y0) { box2d ext0(0,0,width_,height_);