summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaman Bemel-Benrud <saman@mapbox.com>2016-11-23 11:08:43 -0500
committerGitHub <noreply@github.com>2016-11-23 11:08:43 -0500
commit5a4b73f3be07aaceb689f0f50290facdc692e281 (patch)
treeefa21f5db34bbc2d52c99fc0c22fbb0af885a646
parentedb487b74d800d46f04b27dd7610a028720de79a (diff)
downloadqtlocation-mapboxgl-5a4b73f3be07aaceb689f0f50290facdc692e281.tar.gz
Add ratio argument to render.cpp (#7161)
-rw-r--r--bin/render.cpp6
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);