#pragma once #include #include #include #include "../file_source.hpp" #include "../geometry/lat_lng_bounds.hpp" #include "../map/camera_position.hpp" #include #include "../jni/generic_global_ref_deleter.hpp" #include namespace mbgl { namespace android { class SnapshotterRendererFrontend; class MapSnapshotter { public: static constexpr auto Name() { return "com/mapbox/mapboxsdk/snapshotter/MapSnapshotter"; }; static jni::Class javaClass; static void registerNative(jni::JNIEnv&); MapSnapshotter(jni::JNIEnv&, jni::Object, jni::Object, jni::jfloat pixelRatio, jni::jint width, jni::jint height, jni::String styleURL, jni::Object region, jni::Object position, jni::String programCacheDir); ~MapSnapshotter(); void start(JNIEnv&); void cancel(JNIEnv&); private: MBGL_STORE_THREAD(tid); JavaVM *vm = nullptr; GenericUniqueWeakObject javaPeer; float pixelRatio; std::shared_ptr threadPool; std::unique_ptr> snapshotCallback; std::unique_ptr snapshotter; }; } // namespace android } // namespace mbgl