From 393070ae6c48886979e9947330ec5763a093152a Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Mon, 12 Oct 2015 10:10:08 -0700 Subject: [PATCH] remove unused code --- include/mapnik/grid/grid_util.hpp | 112 ------------------------------ 1 file changed, 112 deletions(-) delete mode 100644 include/mapnik/grid/grid_util.hpp diff --git a/include/mapnik/grid/grid_util.hpp b/include/mapnik/grid/grid_util.hpp deleted file mode 100644 index 826d2e15d..000000000 --- a/include/mapnik/grid/grid_util.hpp +++ /dev/null @@ -1,112 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2015 Artem Pavlenko - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - *****************************************************************************/ - -#ifndef GRID_UTIL_HPP -#define GRID_UTIL_HPP - -// mapnik -#include - -namespace mapnik { - -/* - * Nearest neighbor resampling for grids - */ - -static inline void scale_grid(mapnik::grid::data_type & target, - const mapnik::grid::data_type & source, - double x_off_f, double y_off_f) -{ - - int source_width=source.width(); - int source_height=source.height(); - - int target_width=target.width(); - int target_height=target.height(); - - if (source_width<1 || source_height<1 || - target_width<1 || target_height<1) return; - int x = 0; - int y = 0; - int xs = 0; - int ys = 0; - int tw2 = target_width/2; - int th2 = target_height/2; - int offs_x = rint((source_width-target_width-x_off_f*2*source_width)/2); - int offs_y = rint((source_height-target_height-y_off_f*2*source_height)/2); - unsigned yprt = 0; - unsigned yprt1 = 0; - unsigned xprt = 0; - unsigned xprt1 = 0; - - //no scaling or subpixel offset - if (target_height == source_height && target_width == source_width && offs_x == 0 && offs_y == 0){ - for (y=0;y=source_height) - ys1--; - if (ys<0) - ys=ys1=0; - if (source_height/2=source_width) - xs1--; - if (xs<0) - xs=xs1=0; - - mapnik::grid::value_type a = source(xs,ys); - mapnik::grid::value_type b = source(xs1,ys); - mapnik::grid::value_type c = source(xs,ys1); - mapnik::grid::value_type d = source(xs1,ys1); - - if ((a > 0) && (b > 0)) - target(x,y) = b; - else if ((c > 0) && (d > 0)) - target(x,y) = d; - else - target(x,y) = a; - } - } -} - -} - -#endif // GRID_UTIL_HPP