diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2018-12-13 18:45:29 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2018-12-14 11:03:03 +0100 |
commit | 1d8235f5b899a2cd8414522b2d72b96fab91577b (patch) | |
tree | 2ab56dce064de872525db7f24ba150a9065c4757 /platform/default/include/mbgl/map/map_snapshotter.hpp | |
parent | c2a4a8822ce9577c972975da61034a30fb0fe3e9 (diff) | |
download | qtlocation-mapboxgl-1d8235f5b899a2cd8414522b2d72b96fab91577b.tar.gz |
[build] rework platform/default directory and add -files.txt for vendored libs
Diffstat (limited to 'platform/default/include/mbgl/map/map_snapshotter.hpp')
-rw-r--r-- | platform/default/include/mbgl/map/map_snapshotter.hpp | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/platform/default/include/mbgl/map/map_snapshotter.hpp b/platform/default/include/mbgl/map/map_snapshotter.hpp new file mode 100644 index 0000000000..2deb2b3cda --- /dev/null +++ b/platform/default/include/mbgl/map/map_snapshotter.hpp @@ -0,0 +1,66 @@ +#pragma once + +#include <mbgl/util/image.hpp> +#include <mbgl/util/thread.hpp> +#include <mbgl/util/optional.hpp> +#include <mbgl/util/geo.hpp> + +#include <exception> +#include <memory> +#include <string> +#include <vector> +#include <functional> + +namespace mbgl { + +template<class> class ActorRef; +struct CameraOptions; +class FileSource; +class Size; +class LatLngBounds; + +namespace style { +class Style; +} // namespace style + +class MapSnapshotter { +public: + MapSnapshotter(FileSource* fileSource, + std::shared_ptr<Scheduler> scheduler, + const std::pair<bool, std::string> style, + const Size&, + const float pixelRatio, + const optional<CameraOptions> cameraOptions, + const optional<LatLngBounds> region, + const optional<std::string> cacheDir = {}, + const optional<std::string> localFontFamily = {}); + + ~MapSnapshotter(); + + void setStyleURL(const std::string& styleURL); + std::string getStyleURL() const; + + void setStyleJSON(const std::string& styleJSON); + std::string getStyleJSON() const; + + void setSize(const Size&); + Size getSize() const; + + void setCameraOptions(const CameraOptions&); + CameraOptions getCameraOptions() const; + + void setRegion(const LatLngBounds&); + LatLngBounds getRegion() const; + + using PointForFn = std::function<ScreenCoordinate (const LatLng&)>; + using LatLngForFn = std::function<LatLng (const ScreenCoordinate&)>; + using Attributions = std::vector<std::string>; + using Callback = std::function<void (std::exception_ptr, PremultipliedImage, Attributions, PointForFn, LatLngForFn)>; + void snapshot(ActorRef<Callback>); + +private: + class Impl; + std::unique_ptr<util::Thread<Impl>> impl; +}; + +} // namespace mbgl |