mapnik/test/visual/config.hpp

91 lines
2.3 KiB
C++
Raw Normal View History

2015-02-17 16:28:49 +00:00
/*****************************************************************************
*
* This file is part of Mapnik (c++ mapping toolkit)
*
2021-01-05 14:39:07 +00:00
* Copyright (C) 2021 Artem Pavlenko
2015-02-17 16:28:49 +00:00
*
* 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 CONFIG_HPP
#define CONFIG_HPP
// stl
#include <vector>
#include <set>
2015-02-17 16:28:49 +00:00
#include <string>
2015-07-07 12:35:28 +00:00
#include <chrono>
2015-02-17 16:28:49 +00:00
// boost
#include <boost/filesystem.hpp>
#include <mapnik/geometry/box2d.hpp>
2022-01-26 22:25:53 +00:00
namespace visual_tests {
2015-02-17 16:28:49 +00:00
struct map_size
{
2022-01-26 22:25:53 +00:00
map_size(std::size_t _width, std::size_t _height)
: width(_width)
, height(_height)
{}
map_size() {}
2015-06-15 12:34:20 +00:00
std::size_t width = 0;
std::size_t height = 0;
2015-02-17 16:28:49 +00:00
};
struct config
{
2022-01-26 22:25:53 +00:00
config()
: status(true)
, scales({1.0, 2.0})
, sizes({{500, 100}})
, tiles({{1, 1}})
, bbox()
, ignored_renderers()
{}
2015-02-17 16:28:49 +00:00
bool status;
std::vector<double> scales;
std::vector<map_size> sizes;
2015-06-30 12:25:35 +00:00
std::vector<map_size> tiles;
mapnik::box2d<double> bbox;
std::set<std::string> ignored_renderers;
2015-02-17 16:28:49 +00:00
};
2022-01-26 22:25:53 +00:00
enum result_state : std::uint8_t { STATE_OK, STATE_FAIL, STATE_ERROR, STATE_OVERWRITE };
2015-02-17 16:28:49 +00:00
struct result
{
std::string name;
result_state state;
std::string renderer_name;
2015-02-17 16:28:49 +00:00
map_size size;
2015-06-30 12:25:35 +00:00
map_size tiles;
2015-02-17 16:28:49 +00:00
double scale_factor;
boost::filesystem::path actual_image_path;
boost::filesystem::path reference_image_path;
std::string error_message;
unsigned diff;
2015-07-07 12:35:28 +00:00
std::chrono::high_resolution_clock::duration duration;
2015-02-17 16:28:49 +00:00
};
using result_list = std::vector<result>;
2022-01-26 22:25:53 +00:00
} // namespace visual_tests
2015-02-17 16:28:49 +00:00
#endif