Skip to content

Commit

Permalink
Update LibcameraGpuSettables.java
Browse files Browse the repository at this point in the history
  • Loading branch information
BytingBulldogs3539 committed Jan 2, 2024
1 parent 0eae544 commit 1d36080
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ public void setExposure(double exposure) {
// Auto-exposure is active right now, don't set anything.
return;
}

// Store the exposure for use when we need to recreate the camera.
lastManualExposure = exposure;

// Minimum exposure can't be below 1uS cause otherwise it would be 0 and 0 is auto exposure.
double minExposure = 1;

Expand All @@ -151,7 +155,6 @@ public void setExposure(double exposure) {
// enough control over exposure.
exposure = MathUtils.map(exposure, 0, 100, minExposure, 80000);

lastManualExposure = exposure;
var success = LibCameraJNI.setExposure(r_ptr, (int) exposure);
if (!success) LibcameraGpuSource.logger.warn("Couldn't set Pi Camera exposure");
}
Expand Down

0 comments on commit 1d36080

Please sign in to comment.