summaryrefslogtreecommitdiff
path: root/platform/android/src/text/local_glyph_rasterizer_jni.hpp
blob: 1c83ea5f58439aace13afcdd36944863834071fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#pragma once

#include <mbgl/util/image.hpp>

#include <jni/jni.hpp>

/*
    android::LocalGlyphRasterizer is the JNI wrapper of
    com/mapbox/mapboxsdk/text/LocalGlyphRasterizer

    mbgl::LocalGlyphRasterizer is the portable interface
    Both implementations are in local_glyph_rasterizer.cpp
 */

namespace mbgl {
namespace android {

class LocalGlyphRasterizer {
public:
    static constexpr auto Name() { return "com/mapbox/mapboxsdk/text/LocalGlyphRasterizer"; };

    static jni::Class<LocalGlyphRasterizer> javaClass;

    static void registerNative(jni::JNIEnv&);

    LocalGlyphRasterizer();

    PremultipliedImage drawGlyphBitmap(const std::string& fontFamily, const bool bold, const char16_t glyphID);

private:
    jni::UniqueObject<LocalGlyphRasterizer> javaObject;
};

} // namespace android
} // namespace mbgl