MCPcopy Create free account
hub / github.com/KAlO2/PerfectShow / getNativePoint

Function getNativePoint

jni/platform/jni_bridge.cpp:27–38  ·  view source on GitHub ↗

This is the Point that reside in android.graphic.Point, not org.opencv.core.Point

Source from the content-addressed store, hash-verified

25
26// This is the Point that reside in android.graphic.Point, not org.opencv.core.Point
27cv::Point2f getNativePoint(JNIEnv *env, jobject _point)
28{
29 jclass class_PointF = env->FindClass("android/graphics/PointF");
30 jfieldID field_x = env->GetFieldID(class_PointF, "x", "F");
31 jfieldID field_y = env->GetFieldID(class_PointF, "y", "F");
32 assert(class_PointF != nullptr);
33 assert(field_x != nullptr && field_y != nullptr);
34
35 jfloat x = env->GetFloatField(_point, field_x);
36 jfloat y = env->GetFloatField(_point, field_y);
37 return cv::Point2f(x, y);
38}
39
40std::vector<cv::Point2f> getNativePointArray(JNIEnv *env, jobjectArray _points)
41{

Calls

no outgoing calls

Tested by

no test coverage detected