Skip to content

Commit

Permalink
Add Java support
Browse files Browse the repository at this point in the history
  • Loading branch information
bejado committed Oct 6, 2023
1 parent c6beca3 commit b4010cd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions android/filament-android/src/main/cpp/ToneMapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ Java_com_google_android_filament_ToneMapper_nCreateFilmicToneMapper(JNIEnv*, jcl
return (jlong) new FilmicToneMapper();
}

extern "C" JNIEXPORT jlong JNICALL
Java_com_google_android_filament_ToneMapper_nCreateAgxToneMapper(JNIEnv*, jclass) {
return (jlong) new AgxToneMapper();
}

extern "C" JNIEXPORT jlong JNICALL
Java_com_google_android_filament_ToneMapper_nCreateGenericToneMapper(JNIEnv*, jclass,
jfloat contrast, jfloat midGrayIn, jfloat midGrayOut, jfloat hdrMax) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ public Filmic() {
}
}

/**
* AgX tone mapping operator.
*/
public static class Agx extends ToneMapper {
public Agx() {
super(nCreateAgxToneMapper());
}
}

/**
* Generic tone mapping operator that gives control over the tone mapping
* curve. This operator can be used to control the aesthetics of the final
Expand Down Expand Up @@ -194,6 +203,7 @@ public void setHdrMax(float hdrMax) {
private static native long nCreateACESToneMapper();
private static native long nCreateACESLegacyToneMapper();
private static native long nCreateFilmicToneMapper();
private static native long nCreateAgxToneMapper();
private static native long nCreateGenericToneMapper(
float contrast, float midGrayIn, float midGrayOut, float hdrMax);

Expand Down

0 comments on commit b4010cd

Please sign in to comment.