1
我目前正在研究Androids Camera 2 API,我遇到了問題,我無法設置「CONTROL_AE_EXPOSURE_COMPENSATION」。如何在Android的Camera2 API中設置''CONTROL_AE_EXPOSURE_COMPENSATION''?
我的代碼:
-1.0 < exposureAdjustment < 1.0
public void setExposure(double exposureAdjustment) {
Range<Integer> range1 = mCameraCharacteristics.get(CameraCharacteristics.CONTROL_AE_COMPENSATION_RANGE);
int minExposure = range1.getLower();
int maxExposure = range1.getUpper();
float newCalculatedValue = 0;
if (exposureAdjustment >= 0) {
newCalculatedValue = (float) (minExposure * exposureAdjustment);
} else {
newCalculatedValue = (float) (maxExposure * -1 * exposureAdjustment);
}
mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_EXPOSURE_COMPENSATION, (int) newCalculatedValue);
}
可惜,這是行不通的。