Class CameraInfo

java.lang.Object
com.codename1.camera.CameraInfo

public final class CameraInfo extends Object

Describes a physical camera available on the device.

Returned by Camera#getCameras() and Camera#getDefault(CameraFacing). Instances are immutable and may be passed to Camera#open(CameraInfo, CameraSessionOptions).

  • Constructor Details

    • CameraInfo

      public CameraInfo(String id, CameraFacing facing, Dimension[] photoSizes, Dimension[] previewSizes, boolean hasFlash, boolean hasAutoFocus)
      Used by platform implementations. Application code obtains instances through Camera#getCameras().
  • Method Details

    • getId

      public String getId()
      Opaque, platform-specific identifier. Stable for the lifetime of the process.
    • getFacing

      public CameraFacing getFacing()
      Direction this camera faces relative to the device screen.
    • getPhotoSizes

      public Dimension[] getPhotoSizes()
      Supported still-photo resolutions, largest first. May be empty on platforms (e.g. the JavaSE simulator) that don't expose a discrete list.
    • getPreviewSizes

      public Dimension[] getPreviewSizes()
      Supported preview/frame-stream resolutions. May be empty on platforms that don't expose a discrete list.
    • hasFlash

      public boolean hasFlash()
      True if this camera has a flash/torch the application can drive via CameraSession#setFlashMode(FlashMode).
    • hasAutoFocus

      public boolean hasAutoFocus()
      True if this camera supports tap-to-focus / autofocus.