Class CognexCameraManager

java.lang.Object
com.cognex.cmbsdk.cameramanager.CognexCameraManager
Direct Known Subclasses:
Camera2CognexCameraManager, CameraManager

public abstract class CognexCameraManager extends Object
  • Field Details

    • TAG

      public static String TAG
    • USE_FRONT_CAMERA

      public static boolean USE_FRONT_CAMERA
    • REFOCUSING_DELAY

      public static int REFOCUSING_DELAY
    • SHOW_CAMERA_DRIVER_ERRORS_AS_TOAST

      public static boolean SHOW_CAMERA_DRIVER_ERRORS_AS_TOAST
    • mDesiredResolution

      protected CameraPreviewResolution mDesiredResolution
    • cameraInitialized

      public boolean cameraInitialized
    • previewing

      public boolean previewing
    • focusTimer

      public Timer focusTimer
    • windowManager

      public android.view.WindowManager windowManager
    • resources

      public android.content.res.Resources resources
  • Constructor Details

    • CognexCameraManager

      public CognexCameraManager(android.view.WindowManager windowManager, android.content.res.Resources resources)
  • Method Details

    • setDesiredPreviewSize

      public void setDesiredPreviewSize(CameraPreviewResolution cameraPreviewResolution)
      Select desired camera resolution. Not all devices supports all resolutions, closest available will be chosen. If not selected, closest match to screen resolution will be chosen. High resolutions will slow down scanning process on slower devices.
      Parameters:
      cameraPreviewResolution - desired preview resolution
    • setCameraDisplay

      public abstract void setCameraDisplay()
    • getCurrentResolution

      public abstract android.graphics.Point getCurrentResolution()
    • getMaxZoom

      public abstract int getMaxZoom()
    • setZoom

      public abstract void setZoom(int zoom, boolean isPreviewing)
    • isTorchAvailable

      public abstract boolean isTorchAvailable()
    • setTorch

      public abstract void setTorch(boolean enabled)
    • getExposureCompensationRange

      public abstract float[] getExposureCompensationRange()
    • setExposureCompensation

      public abstract void setExposureCompensation(float value)
    • openDriver

      public void openDriver(android.view.TextureView textureView, CognexCameraManager.CameraStateCallback cameraStateCallback) throws RuntimeException
      Throws:
      RuntimeException
    • closeDriver

      public abstract void closeDriver()
    • startFocusing

      public abstract void startFocusing()
    • stopFocusing

      public void stopFocusing()
    • startPreview

      public abstract void startPreview() throws RuntimeException
      Throws:
      RuntimeException
    • stopPreview

      public abstract void stopPreview()
    • requestPreviewFrame

      public abstract void requestPreviewFrame(android.os.Handler handler, int message)
    • renderCroppedGreyscaleBitmap

      public android.graphics.Bitmap renderCroppedGreyscaleBitmap(byte[] data, int width, int height)
      Converts a YUV format frame to Bitmap grayscale frame.
      Parameters:
      data - YUV frame from camera
      width - frame width
      height - frame height
      Returns:
      Bitmap the Bitmap object that represents a grayscale frame