summaryrefslogtreecommitdiff
path: root/platform/default/mbgl/map/map_snapshotter.hpp
diff options
context:
space:
mode:
authorIvo van Dongen <info@ivovandongen.nl>2017-08-22 16:32:09 +0300
committerIvo van Dongen <ivovandongen@users.noreply.github.com>2017-08-30 17:18:37 +0300
commitfae9faab06a6fa800eee890f400035fb8c6a2eb9 (patch)
tree8840895616436e89f86c27e53afce3398ce61497 /platform/default/mbgl/map/map_snapshotter.hpp
parenteba6d58312d28b8e714928ecb9e02bad54455919 (diff)
downloadqtlocation-mapboxgl-fae9faab06a6fa800eee890f400035fb8c6a2eb9.tar.gz
[default] map snapshotter
Diffstat (limited to 'platform/default/mbgl/map/map_snapshotter.hpp')
-rw-r--r--platform/default/mbgl/map/map_snapshotter.hpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/platform/default/mbgl/map/map_snapshotter.hpp b/platform/default/mbgl/map/map_snapshotter.hpp
new file mode 100644
index 0000000000..0afa848fd8
--- /dev/null
+++ b/platform/default/mbgl/map/map_snapshotter.hpp
@@ -0,0 +1,40 @@
+#pragma once
+
+#include <mbgl/util/image.hpp>
+#include <mbgl/util/thread.hpp>
+#include <mbgl/util/optional.hpp>
+
+#include <exception>
+#include <string>
+#include <functional>
+
+namespace mbgl {
+
+template<class> class ActorRef;
+struct CameraOptions;
+class FileSource;
+class Size;
+class LatLngBounds;
+
+class MapSnapshotter {
+public:
+ MapSnapshotter(FileSource& fileSource,
+ Scheduler& scheduler,
+ const std::string& styleURL,
+ const Size&,
+ const float pixelRatio,
+ const CameraOptions&,
+ const optional<LatLngBounds> region,
+ const optional<std::string> cacheDir = {});
+
+ ~MapSnapshotter();
+
+ using Callback = std::function<void (std::exception_ptr, PremultipliedImage)>;
+ void snapshot(ActorRef<Callback>);
+
+private:
+ class Impl;
+ std::unique_ptr<util::Thread<Impl>> impl;
+};
+
+} // namespace mbgl