update static image rendering executable

This commit is contained in:
Konstantin Käfer
2015-02-04 20:08:12 +01:00
committed by Konstantin Käfer
parent 5821be029c
commit 8e42582c52
4 changed files with 23 additions and 10 deletions

View File

@@ -3,10 +3,6 @@
#include <mbgl/util/std.hpp>
#include <mbgl/util/io.hpp>
#include <rapidjson/document.h>
#include <rapidjson/writer.h>
#include <rapidjson/stringbuffer.h>
#include <mbgl/platform/default/headless_view.hpp>
#include <mbgl/platform/default/headless_display.hpp>
#include <mbgl/storage/default_file_source.hpp>
@@ -32,8 +28,8 @@ int main(int argc, char *argv[]) {
double zoom = 0;
double bearing = 0;
int width = 256;
int height = 256;
int width = 512;
int height = 512;
double pixelRatio = 1.0;
std::string output = "out.png";
std::string cache_file = "cache.sqlite";
@@ -100,16 +96,14 @@ int main(int argc, char *argv[]) {
view.resize(width, height, pixelRatio);
map.resize(width, height, pixelRatio);
map.setLatLonZoom(LatLng(lat, lon), zoom);
map.setLatLngZoom({ lat, lon }, zoom);
map.setBearing(bearing);
std::unique_ptr<uint32_t[]> pixels;
// Run the loop. It will terminate when we don't have any further listeners.
map.run();
// Get the data from the GPU.
pixels = view.readPixels();
auto pixels = view.readPixels();
const unsigned int w = width * pixelRatio;
const unsigned int h = height * pixelRatio;