[general] moving ios and android project under ./platform folder

This commit is contained in:
Petr Pokorny
2020-12-20 12:38:56 +01:00
parent 8e759a51e4
commit 41f0be34e7
9877 changed files with 141 additions and 2889 deletions

View File

@@ -0,0 +1,21 @@
#include <mbgl/util/image.hpp>
#include <mbgl/util/string.hpp>
#include <string>
#include "attach_env.hpp"
#include "bitmap_factory.hpp"
namespace mbgl {
PremultipliedImage decodeImage(const std::string& string) {
auto env{ android::AttachEnv() };
auto array = jni::Array<jni::jbyte>::New(*env, string.size());
jni::SetArrayRegion(*env, *array, 0, string.size(),
reinterpret_cast<const signed char*>(string.data()));
return android::Bitmap::GetImage(*env, android::BitmapFactory::DecodeByteArray(*env, array, 0, string.size()));
}
} // namespace mbgl