SLProject
4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
|
App::run implementation from App.h for the Android platform. More...
#include <App.h>
#include <SLGLState.h>
#include <SLEnums.h>
#include <SLInterface.h>
#include <AppCommon.h>
#include <SLAssetManager.h>
#include <SLScene.h>
#include <SLSceneView.h>
#include <CVCapture.h>
#include <Profiler.h>
#include <SLAssetLoader.h>
#include "mediapipe.h"
#include <jni.h>
Go to the source code of this file.
Functions | |
int | slAndroidMain (int argc, char *argv[]) |
JNIEXPORT void JNICALL | Java_ch_bfh_cpvrlab_AppAndroidJNI_onInit (JNIEnv *env, jclass obj, jint width, jint height, jint dpi, jstring filePath) |
Creates the scene and sceneview instance. More... | |
JNIEXPORT void JNICALL | Java_ch_bfh_cpvrlab_AppAndroidJNI_onTerminate (JNIEnv *env, jclass obj) |
JNIEXPORT bool JNICALL | Java_ch_bfh_cpvrlab_AppAndroidJNI_onPaintAllViews (JNIEnv *env, jclass obj) |
JNIEXPORT bool JNICALL | Java_ch_bfh_cpvrlab_AppAndroidJNI_onUpdate (JNIEnv *env, jclass obj) |
JNIEXPORT void JNICALL | Java_ch_bfh_cpvrlab_AppAndroidJNI_onResize (JNIEnv *env, jclass obj, jint width, jint height) |
JNIEXPORT void JNICALL | Java_ch_bfh_cpvrlab_AppAndroidJNI_onMouseDown (JNIEnv *env, jclass obj, jint button, jint x, jint y) |
JNIEXPORT void JNICALL | Java_ch_bfh_cpvrlab_AppAndroidJNI_onMouseUp (JNIEnv *env, jclass obj, jint button, jint x, jint y) |
JNIEXPORT void JNICALL | Java_ch_bfh_cpvrlab_AppAndroidJNI_onMouseMove (JNIEnv *env, jclass obj, jint x, jint y) |
JNIEXPORT void JNICALL | Java_ch_bfh_cpvrlab_AppAndroidJNI_onTouch2Down (JNIEnv *env, jclass obj, jint x1, jint y1, jint x2, jint y2) |
JNIEXPORT void JNICALL | Java_ch_bfh_cpvrlab_AppAndroidJNI_onTouch2Move (JNIEnv *env, jclass obj, jint x1, jint y1, jint x2, jint y2) |
JNIEXPORT void JNICALL | Java_ch_bfh_cpvrlab_AppAndroidJNI_onTouch2Up (JNIEnv *env, jclass obj, jint x1, jint y1, jint x2, jint y2) |
JNIEXPORT void JNICALL | Java_ch_bfh_cpvrlab_AppAndroidJNI_onDoubleClick (JNIEnv *env, jclass obj, jint button, jint x, jint y) |
JNIEXPORT void JNICALL | Java_ch_bfh_cpvrlab_AppAndroidJNI_onClose (JNIEnv *env, jclass obj) |
JNIEXPORT bool JNICALL | Java_ch_bfh_cpvrlab_AppAndroidJNI_usesRotation (JNIEnv *env, jclass obj) |
JNIEXPORT void JNICALL | Java_ch_bfh_cpvrlab_AppAndroidJNI_onRotationQUAT (JNIEnv *env, jclass obj, jfloat quatX, jfloat quatY, jfloat quatZ, jfloat quatW) |
JNIEXPORT bool JNICALL | Java_ch_bfh_cpvrlab_AppAndroidJNI_usesLocation (JNIEnv *env, jclass obj) |
Asks the SLApplicaiton class if the GPS sensor data is requested. More... | |
JNIEXPORT void JNICALL | Java_ch_bfh_cpvrlab_AppAndroidJNI_onLocationLatLonAlt (JNIEnv *env, jclass obj, jdouble latitudeDEG, jdouble longitudeDEG, jdouble altitudeM, jfloat accuracyM) |
Copies the GPS information to the SLApplicaiton class. More... | |
JNIEXPORT jint JNICALL | Java_ch_bfh_cpvrlab_AppAndroidJNI_getVideoType (JNIEnv *env, jclass obj) |
JNIEXPORT jint JNICALL | Java_ch_bfh_cpvrlab_AppAndroidJNI_getVideoSizeIndex (JNIEnv *env, jclass obj) |
JNIEXPORT void JNICALL | Java_ch_bfh_cpvrlab_AppAndroidJNI_grabVideoFileFrame (JNIEnv *env, jclass obj) |
Grabs a frame from a video file using OpenCV. More... | |
JNIEXPORT void JNICALL | Java_ch_bfh_cpvrlab_AppAndroidJNI_copyVideoImage (JNIEnv *env, jclass obj, jint imgWidth, jint imgHeight, jbyteArray imgBuffer) |
Copies the video image data to the CVCapture class. More... | |
JNIEXPORT void JNICALL | Java_ch_bfh_cpvrlab_AppAndroidJNI_onSetupExternalDir (JNIEnv *env, jclass obj, jstring externalDirPath) |
JNIEXPORT void JNICALL | Java_ch_bfh_cpvrlab_AppAndroidJNI_copyVideoYUVPlanes (JNIEnv *env, jclass obj, jint srcW, jint srcH, jbyteArray yBuf, jint ySize, jint yPixStride, jint yLineStride, jbyteArray uBuf, jint uSize, jint uPixStride, jint uLineStride, jbyteArray vBuf, jint vSize, jint vPixStride, jint vLineStride) |
This function is not in use and was an attempt to copy the data faster. More... | |
JNIEXPORT void JNICALL | Java_ch_bfh_cpvrlab_AppAndroidJNI_setCameraSize (JNIEnv *env, jclass obj, jint sizeIndex, jint sizeIndexMax, jint width, jint height) |
JNIEXPORT void JNICALL | Java_ch_bfh_cpvrlab_AppAndroidJNI_setDeviceParameter (JNIEnv *env, jclass obj, jstring parameter, jstring value) |
JNIEXPORT void JNICALL | Java_ch_bfh_cpvrlab_AppAndroidJNI_initMediaPipeAssetManager (JNIEnv *env, jclass obj, jobject assetManager, jstring cacheDirPath) |
bool | Java_renderRaytracingCallback () |
Native ray tracing callback function that calls the Java class method AppAndroidJNI.RaytracingCallback. More... | |
static void | printGLString (const char *name, GLenum s) |
Native OpenGL info string print functions used in onInit. More... | |
std::string | jstring2stdstring (JNIEnv *env, jstring jStr) |
Variables | |
static JNIEnv * | environment |
static int | svIndex = 0 |
Pointer to JAVA environment used in ray tracing callback. More... | |
App::run implementation from App.h for the Android platform.
The functions implement mostly the callbacks for the platform Android over the JNI interface into SLInterface.h. For more info on how to create a new app with SLProject see: https://github.com/cpvrlab/SLProject4/wiki/Creating-a-New-App For more info about App framework see: https://cpvrlab.github.io/SLProject4/app-framework.html
Definition in file AppAndroid.cpp.
JNIEXPORT void JNICALL Java_ch_bfh_cpvrlab_AppAndroidJNI_copyVideoImage | ( | JNIEnv * | env, |
jclass | obj, | ||
jint | imgWidth, | ||
jint | imgHeight, | ||
jbyteArray | srcBuffer | ||
) |
Copies the video image data to the CVCapture class.
Definition at line 296 of file AppAndroid.cpp.
JNIEXPORT void JNICALL Java_ch_bfh_cpvrlab_AppAndroidJNI_copyVideoYUVPlanes | ( | JNIEnv * | env, |
jclass | obj, | ||
jint | srcW, | ||
jint | srcH, | ||
jbyteArray | yBuf, | ||
jint | ySize, | ||
jint | yPixStride, | ||
jint | yLineStride, | ||
jbyteArray | uBuf, | ||
jint | uSize, | ||
jint | uPixStride, | ||
jint | uLineStride, | ||
jbyteArray | vBuf, | ||
jint | vSize, | ||
jint | vPixStride, | ||
jint | vLineStride | ||
) |
This function is not in use and was an attempt to copy the data faster.
Definition at line 318 of file AppAndroid.cpp.
JNIEXPORT jint JNICALL Java_ch_bfh_cpvrlab_AppAndroidJNI_getVideoSizeIndex | ( | JNIEnv * | env, |
jclass | obj | ||
) |
Definition at line 264 of file AppAndroid.cpp.
JNIEXPORT jint JNICALL Java_ch_bfh_cpvrlab_AppAndroidJNI_getVideoType | ( | JNIEnv * | env, |
jclass | obj | ||
) |
Definition at line 257 of file AppAndroid.cpp.
JNIEXPORT void JNICALL Java_ch_bfh_cpvrlab_AppAndroidJNI_grabVideoFileFrame | ( | JNIEnv * | env, |
jclass | obj | ||
) |
Grabs a frame from a video file using OpenCV.
Definition at line 270 of file AppAndroid.cpp.
JNIEXPORT void JNICALL Java_ch_bfh_cpvrlab_AppAndroidJNI_initMediaPipeAssetManager | ( | JNIEnv * | env, |
jclass | obj, | ||
jobject | assetManager, | ||
jstring | cacheDirPath | ||
) |
Definition at line 383 of file AppAndroid.cpp.
JNIEXPORT void JNICALL Java_ch_bfh_cpvrlab_AppAndroidJNI_onClose | ( | JNIEnv * | env, |
jclass | obj | ||
) |
Definition at line 244 of file AppAndroid.cpp.
JNIEXPORT void JNICALL Java_ch_bfh_cpvrlab_AppAndroidJNI_onDoubleClick | ( | JNIEnv * | env, |
jclass | obj, | ||
jint | button, | ||
jint | x, | ||
jint | y | ||
) |
Definition at line 234 of file AppAndroid.cpp.
JNIEXPORT void JNICALL Java_ch_bfh_cpvrlab_AppAndroidJNI_onInit | ( | JNIEnv * | env, |
jclass | obj, | ||
jint | width, | ||
jint | height, | ||
jint | dpi, | ||
jstring | filePath | ||
) |
Creates the scene and sceneview instance.
Java Native Interface (JNI) function declarations. These functions are called by the Java interface class AppAndroidJNI. The function name follows the pattern Java_{package name}_{JNI class name}_{function name}(JNIEnv* env,jclass obj,*); The functions mostly forward to the C-Interface functions of SLProject declared in SLInterface.h.
Definition at line 110 of file AppAndroid.cpp.
JNIEXPORT void JNICALL Java_ch_bfh_cpvrlab_AppAndroidJNI_onLocationLatLonAlt | ( | JNIEnv * | env, |
jclass | obj, | ||
jdouble | latitudeDEG, | ||
jdouble | longitudeDEG, | ||
jdouble | altitudeM, | ||
jfloat | accuracyM | ||
) |
Copies the GPS information to the SLApplicaiton class.
Definition at line 339 of file AppAndroid.cpp.
JNIEXPORT void JNICALL Java_ch_bfh_cpvrlab_AppAndroidJNI_onMouseDown | ( | JNIEnv * | env, |
jclass | obj, | ||
jint | button, | ||
jint | x, | ||
jint | y | ||
) |
Definition at line 204 of file AppAndroid.cpp.
JNIEXPORT void JNICALL Java_ch_bfh_cpvrlab_AppAndroidJNI_onMouseMove | ( | JNIEnv * | env, |
jclass | obj, | ||
jint | x, | ||
jint | y | ||
) |
Definition at line 214 of file AppAndroid.cpp.
JNIEXPORT void JNICALL Java_ch_bfh_cpvrlab_AppAndroidJNI_onMouseUp | ( | JNIEnv * | env, |
jclass | obj, | ||
jint | button, | ||
jint | x, | ||
jint | y | ||
) |
Definition at line 209 of file AppAndroid.cpp.
JNIEXPORT bool JNICALL Java_ch_bfh_cpvrlab_AppAndroidJNI_onPaintAllViews | ( | JNIEnv * | env, |
jclass | obj | ||
) |
Definition at line 168 of file AppAndroid.cpp.
JNIEXPORT void JNICALL Java_ch_bfh_cpvrlab_AppAndroidJNI_onResize | ( | JNIEnv * | env, |
jclass | obj, | ||
jint | width, | ||
jint | height | ||
) |
Definition at line 199 of file AppAndroid.cpp.
JNIEXPORT void JNICALL Java_ch_bfh_cpvrlab_AppAndroidJNI_onRotationQUAT | ( | JNIEnv * | env, |
jclass | obj, | ||
jfloat | quatX, | ||
jfloat | quatY, | ||
jfloat | quatZ, | ||
jfloat | quatW | ||
) |
Definition at line 239 of file AppAndroid.cpp.
JNIEXPORT void JNICALL Java_ch_bfh_cpvrlab_AppAndroidJNI_onSetupExternalDir | ( | JNIEnv * | env, |
jclass | obj, | ||
jstring | externalDirPath | ||
) |
Definition at line 355 of file AppAndroid.cpp.
JNIEXPORT void JNICALL Java_ch_bfh_cpvrlab_AppAndroidJNI_onTerminate | ( | JNIEnv * | env, |
jclass | obj | ||
) |
Definition at line 163 of file AppAndroid.cpp.
JNIEXPORT void JNICALL Java_ch_bfh_cpvrlab_AppAndroidJNI_onTouch2Down | ( | JNIEnv * | env, |
jclass | obj, | ||
jint | x1, | ||
jint | y1, | ||
jint | x2, | ||
jint | y2 | ||
) |
Definition at line 219 of file AppAndroid.cpp.
JNIEXPORT void JNICALL Java_ch_bfh_cpvrlab_AppAndroidJNI_onTouch2Move | ( | JNIEnv * | env, |
jclass | obj, | ||
jint | x1, | ||
jint | y1, | ||
jint | x2, | ||
jint | y2 | ||
) |
Definition at line 224 of file AppAndroid.cpp.
JNIEXPORT void JNICALL Java_ch_bfh_cpvrlab_AppAndroidJNI_onTouch2Up | ( | JNIEnv * | env, |
jclass | obj, | ||
jint | x1, | ||
jint | y1, | ||
jint | x2, | ||
jint | y2 | ||
) |
Definition at line 229 of file AppAndroid.cpp.
JNIEXPORT bool JNICALL Java_ch_bfh_cpvrlab_AppAndroidJNI_onUpdate | ( | JNIEnv * | env, |
jclass | obj | ||
) |
Definition at line 173 of file AppAndroid.cpp.
JNIEXPORT void JNICALL Java_ch_bfh_cpvrlab_AppAndroidJNI_setCameraSize | ( | JNIEnv * | env, |
jclass | obj, | ||
jint | sizeIndex, | ||
jint | sizeIndexMax, | ||
jint | width, | ||
jint | height | ||
) |
Definition at line 363 of file AppAndroid.cpp.
JNIEXPORT void JNICALL Java_ch_bfh_cpvrlab_AppAndroidJNI_setDeviceParameter | ( | JNIEnv * | env, |
jclass | obj, | ||
jstring | parameter, | ||
jstring | value | ||
) |
Definition at line 373 of file AppAndroid.cpp.
JNIEXPORT bool JNICALL Java_ch_bfh_cpvrlab_AppAndroidJNI_usesLocation | ( | JNIEnv * | env, |
jclass | obj | ||
) |
Asks the SLApplicaiton class if the GPS sensor data is requested.
Definition at line 350 of file AppAndroid.cpp.
JNIEXPORT bool JNICALL Java_ch_bfh_cpvrlab_AppAndroidJNI_usesRotation | ( | JNIEnv * | env, |
jclass | obj | ||
) |
Definition at line 250 of file AppAndroid.cpp.
bool Java_renderRaytracingCallback | ( | ) |
Native ray tracing callback function that calls the Java class method AppAndroidJNI.RaytracingCallback.
Definition at line 85 of file AppAndroid.cpp.
std::string jstring2stdstring | ( | JNIEnv * | env, |
jstring | jStr | ||
) |
Definition at line 99 of file AppAndroid.cpp.
|
static |
Native OpenGL info string print functions used in onInit.
Definition at line 93 of file AppAndroid.cpp.
int slAndroidMain | ( | int | argc, |
char * | argv[] | ||
) |
|
static |
Definition at line 35 of file AppAndroid.cpp.
|
static |
Pointer to JAVA environment used in ray tracing callback.
SceneView index
Definition at line 36 of file AppAndroid.cpp.