return the grid::value_type instead of hardcoding int
This commit is contained in:
parent
3df8574c84
commit
e53914463a
1 changed files with 3 additions and 4 deletions
|
@ -39,13 +39,12 @@ bool painted(mapnik::grid const& grid)
|
||||||
return grid.painted();
|
return grid.painted();
|
||||||
}
|
}
|
||||||
|
|
||||||
int get_pixel(mapnik::grid const& grid, int x, int y)
|
mapnik::grid::value_type get_pixel(mapnik::grid const& grid, int x, int y)
|
||||||
{
|
{
|
||||||
if (x < static_cast<int>(grid.width()) && y < static_cast<int>(grid.height()))
|
if (x < static_cast<int>(grid.width()) && y < static_cast<int>(grid.height()))
|
||||||
{
|
{
|
||||||
mapnik::grid::value_type const * row = grid.getRow(y);
|
mapnik::grid::data_type const & data = grid.data();
|
||||||
mapnik::grid::value_type const pixel = row[x];
|
return data(x,y);
|
||||||
return pixel;
|
|
||||||
}
|
}
|
||||||
PyErr_SetString(PyExc_IndexError, "invalid x,y for grid dimensions");
|
PyErr_SetString(PyExc_IndexError, "invalid x,y for grid dimensions");
|
||||||
boost::python::throw_error_already_set();
|
boost::python::throw_error_already_set();
|
||||||
|
|
Loading…
Reference in a new issue