Files
MapLibreParticleLab/platform/android/src/bitmap_factory.cpp
Bart Louwers 550f64be22 core: rename mbgl namespace to mln (#4487)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-08-14 23:25:20 +02:00

27 lines
1.0 KiB
C++

#include "bitmap_factory.hpp"
namespace mln {
namespace android {
void BitmapFactory::registerNative(jni::JNIEnv& env) {
jni::Class<BitmapFactory>::Singleton(env);
}
jni::Local<jni::Object<Bitmap>> BitmapFactory::DecodeByteArray(jni::JNIEnv& env,
jni::Array<jni::jbyte>& data,
jni::jint offset,
jni::jint length) {
static auto& _class = jni::Class<BitmapFactory>::Singleton(env);
// Images are loaded with ARGB_8888 config, and premultiplied by default,
// which is exactly what we want, so we're not providing a
// BitmapFactory.Options object.
using Signature = jni::Object<Bitmap>(jni::Array<jni::jbyte>, jni::jint, jni::jint);
static auto method = _class.GetStaticMethod<Signature>(env, "decodeByteArray");
return _class.Call(env, method, data, offset, length);
}
} // namespace android
} // namespace mln