Class VisionBackends

java.lang.Object
com.codename1.ai.vision.VisionBackends

public final class VisionBackends extends Object

Vision backend selectors. auto() chooses Apple Vision on iOS and ML Kit on Android. Feature-specific ML Kit methods are separate so one selector never adds unrelated OCR, barcode, face, pose, labeling, or segmentation pods.

Each ML Kit selector call is also a build-time dependency marker. The methods intentionally return the same runtime backend id but must remain distinct so the builder can include only the selected feature. Pass the selector that corresponds to the analyzer being constructed; for example, the face-detection selector cannot satisfy a text recognizer and that mismatched analyzer reports unsupported.

  • Method Details

    • auto

      public static VisionBackend auto()
      Returns:
      the dependency-minimal platform default
    • appleVision

      public static VisionBackend appleVision()
      Selects Apple Vision/Core Image without adding a third-party dependency.
      Returns:
      Apple-native backend selector
    • mlKitTextRecognition

      public static VisionBackend mlKitTextRecognition()
      Selects ML Kit for text recognition on iOS. Android already uses ML Kit for the automatic backend.
      Returns:
      the ML Kit backend selector
    • mlKitBarcodeScanning

      public static VisionBackend mlKitBarcodeScanning()
      Selects ML Kit for barcode scanning on iOS.
      Returns:
      the ML Kit backend selector
    • mlKitFaceDetection

      public static VisionBackend mlKitFaceDetection()
      Selects ML Kit for face detection on iOS.
      Returns:
      the ML Kit backend selector
    • mlKitImageLabeling

      public static VisionBackend mlKitImageLabeling()
      Selects ML Kit for image labeling on iOS.
      Returns:
      the ML Kit backend selector
    • mlKitPoseDetection

      public static VisionBackend mlKitPoseDetection()
      Selects ML Kit for pose detection on iOS.
      Returns:
      the ML Kit backend selector
    • mlKitSelfieSegmentation

      public static VisionBackend mlKitSelfieSegmentation()
      Selects ML Kit for selfie segmentation on iOS.
      Returns:
      the ML Kit backend selector