Esempio n. 1
0
bool is_solid(image_view<image_data_32> const& view)
{
    if (view.width() > 0 && view.height() > 0)
    {
        mapnik::image_view<image_data_32>::pixel_type const* first_row = view.getRow(0);
        mapnik::image_view<image_data_32>::pixel_type const first_pixel = first_row[0];
        for (unsigned y = 0; y < view.height(); ++y)
        {
            mapnik::image_view<image_data_32>::pixel_type const * row = view.getRow(y);
            for (unsigned x = 0; x < view.width(); ++x)
            {
                if (first_pixel != row[x])
                {
                    return false;
                }
            }
        }
    }
    return true;
}