public CLEyeCamera(CLEyeCameraColorMode colorMode, CLEyeCameraResolution resolution) { int cameraImageWidth = 0; int cameraImageHeight = 0; hwCameraIntPtr = CLEyeCreateCamera(CameraUUID(0), colorMode, resolution, 30); if (hwCameraIntPtr == IntPtr.Zero) { return; } CLEyeSetCameraParameter(hwCameraIntPtr, CLEyeCameraParameter.CLEYE_VFLIP, 1); CLEyeSetCameraParameter(hwCameraIntPtr, CLEyeCameraParameter.CLEYE_AUTO_EXPOSURE, 0); CLEyeSetCameraParameter(hwCameraIntPtr, CLEyeCameraParameter.CLEYE_AUTO_GAIN, 0); CLEyeSetCameraParameter(hwCameraIntPtr, CLEyeCameraParameter.CLEYE_AUTO_WHITEBALANCE, 0); CLEyeSetCameraParameter(hwCameraIntPtr, CLEyeCameraParameter.CLEYE_WHITEBALANCE_GREEN, 128); CLEyeSetCameraParameter(hwCameraIntPtr, CLEyeCameraParameter.CLEYE_WHITEBALANCE_BLUE, 128); CLEyeSetCameraParameter(hwCameraIntPtr, CLEyeCameraParameter.CLEYE_WHITEBALANCE_RED, 128); CLEyeCameraGetFrameDimensions(hwCameraIntPtr, ref cameraImageWidth, ref cameraImageHeight); currentImage = new ImageBuffer(cameraImageWidth, cameraImageHeight, 32, new BlenderBGRA()); cameraCopyBufferIntPtr = Marshal.AllocHGlobal(cameraImageWidth * cameraImageHeight * 4); // create thread exit event _exitEvent = new ManualResetEvent(false); // start capture here ThreadPool.QueueUserWorkItem(Capture); }
public CLEyeCameraDevice(CLEyeCameraResolution resolution, CLEyeCameraColorMode colorMode, int fps) { // set default values Framerate = fps; ColorMode = colorMode; Resolution = resolution; }
private TColorFormat GetColor(CLEyeCameraColorMode color) { switch (color) { case CLEyeCameraColorMode.CLEYE_BAYER_RAW: return(TColorFormat.L8); case CLEyeCameraColorMode.CLEYE_COLOR_PROCESSED: return(TColorFormat.RGBA8); case CLEyeCameraColorMode.CLEYE_COLOR_RAW: return(TColorFormat.RGBA8); case CLEyeCameraColorMode.CLEYE_MONO_PROCESSED: return(TColorFormat.L8); case CLEyeCameraColorMode.CLEYE_MONO_RAW: return(TColorFormat.L8); default: throw (new Exception("Color mode unsupported")); } }
public static extern IntPtr CLEyeCreateCamera(Guid camUUID, CLEyeCameraColorMode mode, CLEyeCameraResolution res, float frameRate);