Beispiel #1
0
 @Override
 public void SetValue(String valueToSet, boolean setToCamera) {
   if (valueToSet.equals("") || valueToSet.isEmpty()) return;
   if (valueToSet.contains("unknown")) {
     String t = valueToSet.substring(valueToSet.length() - 2);
     int i = Integer.parseInt(t);
     ((CameraHolderApi2) cameraUiWrapper.GetCameraHolder())
         .SetParameterRepeating(CaptureRequest.CONTROL_AWB_MODE, i);
   } else {
     WhiteBalanceValues sceneModes = Enum.valueOf(WhiteBalanceValues.class, valueToSet);
     setWbMode(sceneModes);
     ((CameraHolderApi2) cameraUiWrapper.GetCameraHolder())
         .SetParameterRepeating(CaptureRequest.CONTROL_AWB_MODE, sceneModes.ordinal());
   }
   BackgroundValueHasChanged(valueToSet);
 }
Beispiel #2
0
 @Override
 public String[] GetValues() {
   int[] values =
       ((CameraHolderApi2) cameraUiWrapper.GetCameraHolder())
           .characteristics.get(CameraCharacteristics.CONTROL_AWB_AVAILABLE_MODES);
   String[] retvals = new String[values.length];
   for (int i = 0; i < values.length; i++) {
     try {
       WhiteBalanceValues sceneModes = WhiteBalanceValues.values()[values[i]];
       retvals[i] = sceneModes.toString();
     } catch (Exception ex) {
       if (i < 10) retvals[i] = "unknown awb 0" + values[i];
       else retvals[i] = "unknown awb " + values[i];
     }
   }
   return retvals;
 }
Beispiel #3
0
    @Override
    public String GetValue() {
      if (cameraUiWrapper.GetCameraHolder() != null
          || !((CameraHolderApi2) cameraUiWrapper.GetCameraHolder())
              .get(CaptureRequest.CONTROL_AWB_MODE)
              .equals("null")) {
        try {
          int i =
              ((CameraHolderApi2) cameraUiWrapper.GetCameraHolder())
                  .get(CaptureRequest.CONTROL_AWB_MODE);
          WhiteBalanceValues sceneModes = WhiteBalanceValues.values()[i];
          return sceneModes.toString();
        } catch (NullPointerException ex) {
          Logger.exception(ex);
          return "AUTO";
        }

      } else return "AUTO";
    }