Add night adaptation control to ColorGrading (#4559)
In low-light conditions, peak luminance sensitivity of the eye shifts toward the blue end of the visible spectrum. This effect called the Purkinje effect occurs during the transition from photopic (cone-based) vision to scotopic (rod-based) vision. Because the rods and cones use the same neural pathways, a color shift is introduced as the rods take over to improve low-light perception. This function aims to (somewhat) replicate this color shift and peak luminance sensitivity increase to more faithfully reproduce scenes in low-light conditions as they would be perceived by a human observer (as opposed to an artificial observer such as a camera sensor). The night adaptation can be controlled using a 0..1 factor for artistic reasons: `ColorGrading::Builder::nightAdaptation()`.
This commit is contained in:
@@ -90,6 +90,13 @@ Java_com_google_android_filament_ColorGrading_nBuilderExposure(JNIEnv*, jclass,
|
||||
builder->exposure(exposure);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_com_google_android_filament_ColorGrading_nBuilderNightAdaptation(JNIEnv*, jclass,
|
||||
jlong nativeBuilder, jfloat adaptation) {
|
||||
ColorGrading::Builder* builder = (ColorGrading::Builder*) nativeBuilder;
|
||||
builder->nightAdaptation(adaptation);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_com_google_android_filament_ColorGrading_nBuilderWhiteBalance(JNIEnv*, jclass,
|
||||
jlong nativeBuilder, jfloat temperature, jfloat tint) {
|
||||
|
||||
Reference in New Issue
Block a user