Skip to content

Instantly share code, notes, and snippets.

@mebjas
Created November 16, 2022 09:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mebjas/b2ec7a5d82c9e119228203d8c16649ce to your computer and use it in GitHub Desktop.
Save mebjas/b2ec7a5d82c9e119228203d8c16649ce to your computer and use it in GitHub Desktop.
Skeleton of JNI file for reading image in native layer.
#include <jni.h>
// Corresponding to NativeImageLoader class in
// dev.minhazav.samples package.
extern "C" JNIEXPORT jstring JNICALL
Java_dev_minhazav_samples_NativeImageLoader_readFile(
JNIEnv* env, jclass, jint fd) {
if (fd < 0) {
return env->NewStringUTF("Invalid fd");
}
// TODO: read the image.
return env->NewStringUTF("Dummy string");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment