diff options
Diffstat (limited to 'bin')
-rw-r--r-- | bin/render.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/render.cpp b/bin/render.cpp index 6dd948204c..12ad1626ce 100644 --- a/bin/render.cpp +++ b/bin/render.cpp @@ -27,6 +27,7 @@ int main(int argc, char *argv[]) { double bearing = 0; double pitch = 0; + uint32_t pixelRatio = 1; uint32_t width = 512; uint32_t height = 512; static std::string output = "out.png"; @@ -46,6 +47,7 @@ int main(int argc, char *argv[]) { ("pitch,p", po::value(&pitch)->value_name("degrees")->default_value(pitch), "Pitch") ("width,w", po::value(&width)->value_name("pixels")->default_value(width), "Image width") ("height,h", po::value(&height)->value_name("pixels")->default_value(height), "Image height") + ("ratio,r", po::value(&pixelRatio)->value_name("number")->default_value(pixelRatio), "Image scale factor") ("class,c", po::value(&classes)->value_name("name"), "Class name") ("token,t", po::value(&token)->value_name("key")->default_value(token), "Mapbox access token") ("debug", po::bool_switch(&debug)->default_value(debug), "Debug mode") @@ -84,9 +86,9 @@ int main(int argc, char *argv[]) { } HeadlessBackend backend; - OffscreenView view(backend.getContext(), { width, height }); + OffscreenView view(backend.getContext(), { width * pixelRatio, height * pixelRatio }); ThreadPool threadPool(4); - Map map(backend, view.size, 1, fileSource, threadPool, MapMode::Still); + Map map(backend, mbgl::Size { width, height }, pixelRatio, fileSource, threadPool, MapMode::Still); map.setStyleJSON(style); map.setClasses(classes); |