Ejemplo n.º 1
0
  public void StartTouchToFocus(FocusRect rect, FocusRect meteringarea, int width, int height) {
    if (parametersHandler == null
        || cameraUiWrapper == null
        || cameraHolder == null
        || parametersHandler.FocusMode == null) return;

    String focusmode = parametersHandler.FocusMode.GetValue();
    if (focusmode.equals("auto") || focusmode.equals("macro")) {
      try {
        if (parametersHandler.ExposureLock != null
            && parametersHandler.ExposureLock.IsSupported()) {
          if (parametersHandler.ExposureLock.GetValue().equals("true")) {
            parametersHandler.ExposureLock.SetValue("false", true);
            parametersHandler.ExposureLock.BackgroundValueHasChanged("false");
          }
        }
      } catch (Exception ex) {

      }
      final FocusRect targetFocusRect = getFocusRect(rect, width, height);

      if (targetFocusRect.left >= -1000
          && targetFocusRect.top >= -1000
          && targetFocusRect.bottom <= 1000
          && targetFocusRect.right <= 1000) {

        parametersHandler.SetFocusAREA(targetFocusRect, meteringarea);
        if (cameraHolder != null) cameraHolder.StartFocus(this);
        isFocusing = true;
        if (focusEvent != null) focusEvent.FocusStarted(rect);
      }
    }
  }
Ejemplo n.º 2
0
 @Override
 public void SetMeteringAreas(FocusRect meteringRect, int width, int height) {
   if (DeviceUtils.isZTEADV()) {
     final FocusRect targetFocusRect = getFocusRect(meteringRect, width, height);
     parametersHandler.SetMeterAREA(targetFocusRect);
   } else {
     final FocusRect targetFocusRect = getFocusRect(meteringRect, width, height);
     cameraHolder.SetMeteringAreas(targetFocusRect);
   }
 }