Skip to content
Browse files

updating some progress

  • Loading branch information...
1 parent 7c58eec commit 84c4588bf1d93f88c534149dffacbaad5abbcb22 @paulobarcelos committed
View
1 example/bin/data/.gitignore
@@ -0,0 +1 @@
+!.gitignore
View
1 example/ofxUeyeExample.vcxproj
@@ -122,6 +122,7 @@ if not exist "$(ProjectDir)\bin\data" mkdir "$(ProjectDir)\bin\data"
<ClCompile Include="..\..\ofxXmlSettings\libs\tinyxmlparser.cpp" />
<ClCompile Include="..\..\ofxXmlSettings\src\ofxXmlSettings.cpp" />
<ClCompile Include="..\src\ofxUeye.cpp" />
+ <ClCompile Include="..\src\ofxUeyeSettings.cpp" />
<ClCompile Include="src\main.cpp" />
<ClCompile Include="src\testApp.cpp" />
</ItemGroup>
View
3 example/ofxUeyeExample.vcxproj.filters
@@ -25,6 +25,9 @@
<ClCompile Include="..\src\ofxUeye.cpp">
<Filter>addons\ofxUeye\src</Filter>
</ClCompile>
+ <ClCompile Include="..\src\ofxUeyeSettings.cpp">
+ <Filter>addons\ofxUeye\src</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<Filter Include="src">
View
19 example/src/testApp.cpp
@@ -2,7 +2,8 @@
//--------------------------------------------------------------
void testApp::setup(){
-
+ ofxXmlSettings test;
+ test.saveFile("cu");
ofSetVerticalSync(true);
ofAddListener(ueye.events.dimensionChanged, this, &testApp::ueyeDimensionChanged);
@@ -11,11 +12,12 @@ void testApp::setup(){
if(ueye.init())
{
+ //cout << (IS_BINNING_8X_VERTICAL | IS_BINNING_8X_HORIZONTAL) << endl;
// Get full area of the sensor, but skipping every second pixel
ueye.setBinning(IS_BINNING_4X_VERTICAL | IS_BINNING_4X_HORIZONTAL); // difference from subsamplimg? (apparently same bandwith but smoother image)
// smooth the bad pixels (apparently they come from factory with bad pixels...)
- ueye.enableBadPixelsCorrection();
+ //ueye.enableBadPixelsCorrection();
// Set AOI (always set AOI after binning, subsampling or scaler, otherwise you might not get the desired result)
ofRectangle fullHD;
@@ -27,24 +29,25 @@ void testApp::setup(){
//ueye.setAOINormalized(ofRectangle(0,0, 0.6, 0.6));
// Start grabbing pixels
- ueye.enableLive();
+ //ueye.enableLive();
+
+ settings.setup(&ueye);
}
- settings.init(&ueye);
+
}
//--------------------------------------------------------------
void testApp::ueyeDimensionChanged(ofxUeyeEventArgs &args){
// If we got here, bandwith has changed.
// Pixel Clock, FPS and Exposure should be adjusted.
- ueye.setPixelClock(ueye.getPixelClockMax());
+ //ueye.setPixelClock(ueye.getPixelClockMax());
//ueye.setFPS(ueye.getFPSMax());
- ueye.setFPS(60);
+ //ueye.setFPS(60);
tex.clear();
tex.allocate(ueye.getWidth(), ueye.getHeight(),GL_RGB);
}
//--------------------------------------------------------------
-bool once =false;
void testApp::update(){
ueye.update();
if(ueye.isReady() && ueye.isFrameNew())
@@ -62,7 +65,7 @@ void testApp::exit(){
}
//--------------------------------------------------------------
void testApp::keyPressed(int key){
- settings.processInput(key);
+ settings.keyPressed(key);
}
View
16 src/ofxUeye.cpp
@@ -522,13 +522,15 @@ int ofxUeye::setFPS(double fps)
//////////////////////////////////////////////////////////////////////////////////
// setOptimalCameraTiming --------------------------------------------------------
//////////////////////////////////////////////////////////////////////////////////
-void ofxUeye::setOptimalCameraTiming()
+void ofxUeye::setOptimalCameraTiming(bool value)
{
- int pixelClock;
- double fps;
- int result = is_SetOptimalCameraTiming (m_hCam, IS_BEST_PCLK_RUN_ONCE, 10000, &pixelClock, &fps);
- is_SetPixelClock (m_hCam, pixelClock);
- is_SetFrameRate (m_hCam, fps, &fps);
+ if(value){
+ int pixelClock;
+ double fps;
+ int result = is_SetOptimalCameraTiming (m_hCam, IS_BEST_PCLK_RUN_ONCE, 10000, &pixelClock, &fps);
+ is_SetPixelClock (m_hCam, pixelClock);
+ is_SetFrameRate (m_hCam, fps, &fps);
+ }
}
//////////////////////////////////////////////////////////////////////////////////
// setOptimalCameraTiming --------------------------------------------------------
@@ -547,6 +549,7 @@ int ofxUeye::setColorCorrection(double factor){
//////////////////////////////////////////////////////////////////////////////////
int ofxUeye::enableBadPixelsCorrection()
{
+ _badPixelCorrection = true;
INT nRet;
nRet = is_HotPixel(m_hCam, IS_HOTPIXEL_ENABLE_SENSOR_CORRECTION, NULL, NULL);
if (nRet == IS_SUCCESS) return nRet;
@@ -560,6 +563,7 @@ int ofxUeye::enableBadPixelsCorrection()
//////////////////////////////////////////////////////////////////////////////////
int ofxUeye::disableBadPixelsCorrection()
{
+ _badPixelCorrection = false;
INT nRet = is_HotPixel(m_hCam, IS_HOTPIXEL_DISABLE_CORRECTION, NULL, NULL);
return nRet;
}
View
95 src/ofxUeye.h
@@ -14,7 +14,7 @@ class ofxUeye{
ofxUeye();
~ofxUeye();
- // actions
+ // actions ---------------------------------------------------
void setVerbose(bool bTalkToMe);
void listDevices();
bool init(int id = 0); // 0: The first available camera will be initialized.
@@ -22,96 +22,124 @@ class ofxUeye{
void close();
void update();
- // getters
+ // Flags ------------------------------------------------------
bool isReady();
bool isFrameNew();
+ // Pixels -----------------------------------------------------
unsigned char* getPixels();
+ // Sensor Dimensions ------------------------------------------
int getSensorHeight();
int getSensorWidth();
int getHeight();
int getWidth();
+
+ // Bandwidth -------------------------------------------------
+ inline int getBandwidth(){return is_GetUsedBandwidth(m_hCam);};
+
+ // Live ----------------------------------------------------
+ void setLive(bool value = true){if (value) enableLive(); else disableLive();};
+ bool isLive(){return bLive;};
+ void enableLive();
+ void disableLive();
+
+ // Binnig, subsampling ans scaler ------------------------
+ int setBinning(int mode);
+ int setSubSampling(int mode);
+ int setScaler(double factor);
+ // AOI -----------------------------------------------------
+ int setAOI(ofRectangle aoi);
ofRectangle getAOI();
+ int setAOINormalized(ofRectangle aoi);
ofRectangle getAOINormalized();
ofRectangle getAOIMax();
-
+
+
+ // Pixel Clock -------------------------------------------
+ int setPixelClock(int clock);
int getPixelClock();
int getPixelClockMin();
int getPixelClockMax();
int getPixelClockStep();
+ // FPS ---------------------------------------------------
+ int setFPS(double fps);
double getFPS();
double getFPSMin();
double getFPSMax();
double getFPSStep();
-
- inline int getBandwidth(){return is_GetUsedBandwidth(m_hCam);};
+ // Optimal Camera timing --------------------------------
+ void setOptimalCameraTiming(bool value = true);
+
+ // Bad Pixel Correction ---------------------------------
+ void setBadPixelsCorrection(bool value = true){if (value) enableBadPixelsCorrection(); else disableBadPixelsCorrection();};
+ bool isBadPixelsCorrection(){return _badPixelCorrection;};
+ int enableBadPixelsCorrection();
+ int disableBadPixelsCorrection();
+
+ // Exposure -----------------------------------------------
+ void setAutoExposureTime(bool value = true){if (value) enableAutoExposureTime(); else disableAutoExposureTime();};
inline bool isExposureTimeAuto(){double e ; is_SetAutoParameter (m_hCam, IS_GET_ENABLE_AUTO_SHUTTER, &e, 0); return (e == 1.0)?true:false;};
+ inline int enableAutoExposureTime(){double e = 1; return is_SetAutoParameter (m_hCam, IS_SET_ENABLE_AUTO_SHUTTER, &e, 0);};
+ inline int disableAutoExposureTime(){double e = 0; return is_SetAutoParameter (m_hCam, IS_SET_ENABLE_AUTO_SHUTTER, &e, 0);};
+
+ inline int setExposureTime(double exposure){return is_Exposure (m_hCam, IS_EXPOSURE_CMD_SET_EXPOSURE, (void*)&exposure, sizeof(exposure));};
inline double getExposureTime(){double exposure; is_Exposure (m_hCam, IS_EXPOSURE_CMD_GET_EXPOSURE, (void*)&exposure, sizeof(exposure)); return exposure;};
inline double getExposureTimeMin(){double min; is_Exposure (m_hCam, IS_EXPOSURE_CMD_GET_EXPOSURE_RANGE_MIN, (void*)&min, sizeof(min)); return min;};
inline double getExposureTimeMax(){double max; is_Exposure (m_hCam, IS_EXPOSURE_CMD_GET_EXPOSURE_RANGE_MAX, (void*)&max, sizeof(max)); return max;};
inline double getExposureTimeStep(){double step; is_Exposure (m_hCam, IS_EXPOSURE_CMD_GET_EXPOSURE_RANGE_INC, (void*)&step, sizeof(step)); return step;};
+ // White Balance -----------------------------------------
+ void setAutoWhiteBalance(bool value = true){if (value) enableAutoWhiteBalance(); else disableAutoWhiteBalance();};
+ int enableAutoWhiteBalance(){double e = WB_MODE_AUTO; return is_SetAutoParameter (m_hCam, IS_SET_ENABLE_AUTO_SENSOR_WHITEBALANCE, &e, 0);};
+ int disableAutoWhiteBalance(){double e = WB_MODE_DISABLE; return is_SetAutoParameter (m_hCam, IS_SET_ENABLE_AUTO_SENSOR_WHITEBALANCE, &e, 0);};
+
+ // Gain -------------------------------------------
+ void setAutoGain(bool value = true){if (value) enableAutoGain(); else disableAutoGain();};
inline bool isGainAuto(){double e ; is_SetAutoParameter (m_hCam, IS_GET_ENABLE_AUTO_GAIN, &e, 0); return (e == 1.0)?true:false;};
+ inline int enableAutoGain(){double e = 1; return is_SetAutoParameter (m_hCam, IS_SET_ENABLE_AUTO_GAIN, &e, 0);};
+ inline int disableAutoGain(){double e = 0; return is_SetAutoParameter (m_hCam, IS_SET_ENABLE_AUTO_GAIN, &e, 0);};
+
+ inline int setGainMaster(int gain){return is_SetHardwareGain(m_hCam, gain, IS_IGNORE_PARAMETER, IS_IGNORE_PARAMETER, IS_IGNORE_PARAMETER);};
inline int getGainMaster(){return is_SetHardwareGain (m_hCam, IS_GET_MASTER_GAIN, IS_IGNORE_PARAMETER, IS_IGNORE_PARAMETER, IS_IGNORE_PARAMETER);};
inline int getGainMasterMin(){return 0;};
inline int getGainMasterMax(){return 100;};
inline int getGainMasterStep(){return 1;};
-
+
+ inline int setGainRed(int gain){return is_SetHardwareGain (m_hCam, IS_IGNORE_PARAMETER, gain, IS_IGNORE_PARAMETER, IS_IGNORE_PARAMETER);};
inline int getGainRed(){return is_SetHardwareGain (m_hCam, IS_GET_RED_GAIN, IS_IGNORE_PARAMETER, IS_IGNORE_PARAMETER, IS_IGNORE_PARAMETER);};
inline int getGainRedMin(){return 0;};
inline int getGainRedMax(){return 100;};
inline int getGainRedStep(){return 1;};
+ inline int setGainGreen(int gain){return is_SetHardwareGain (m_hCam, IS_IGNORE_PARAMETER, IS_IGNORE_PARAMETER, gain, IS_IGNORE_PARAMETER);};
inline int getGainGreen(){return is_SetHardwareGain (m_hCam, IS_GET_GREEN_GAIN, IS_IGNORE_PARAMETER, IS_IGNORE_PARAMETER, IS_IGNORE_PARAMETER);};
inline int getGainGreenMin(){return 0;};
inline int getGainGreenMax(){return 100;};
inline int getGainGreenStep(){return 1;};
+ inline int setGainBlue(int gain){return is_SetHardwareGain (m_hCam, IS_IGNORE_PARAMETER, IS_IGNORE_PARAMETER, IS_IGNORE_PARAMETER, gain);};
inline int getGainBlue(){return is_SetHardwareGain (m_hCam, IS_GET_BLUE_GAIN, IS_IGNORE_PARAMETER, IS_IGNORE_PARAMETER, IS_IGNORE_PARAMETER);};
inline int getGainBlueMin(){return 0;};
inline int getGainBlueMax(){return 100;};
inline int getGainBlueStep(){return 1;};
+ // Color Saturation ---------------------------------
+ inline int setColorSaturation(int saturation){return is_SetSaturation (m_hCam, saturation,saturation);};
inline int getColorSaturation(){return is_SetSaturation(m_hCam, IS_GET_SATURATION_U,IS_GET_SATURATION_V);};
inline int getColorSaturationMin(){return 0;};
inline int getColorSaturationMax(){return 200;};
inline int getColorSaturationStep(){return 1;};
+ // Color Corection ---------------------------------
+ int setColorCorrection(double factor);
inline double getColorCorrection(){return _colorCorrection;};
inline double getColorCorrectionMin(){return 0;};
inline double getColorCorrectionMax(){return 1.0;};
inline double getColorCorrectionStep(){return 0.1;};
-
- // setters
- void enableLive();
- void disableLive();
- int enableBadPixelsCorrection();
- int disableBadPixelsCorrection();
- int enableAutoGain(){double e = 1; return is_SetAutoParameter (m_hCam, IS_SET_ENABLE_AUTO_GAIN, &e, 0);};
- int disableAutoGain(){double e = 0; return is_SetAutoParameter (m_hCam, IS_SET_ENABLE_AUTO_GAIN, &e, 0);};
- int enableAutoExposureTime(){double e = 1; return is_SetAutoParameter (m_hCam, IS_SET_ENABLE_AUTO_SHUTTER, &e, 0);};
- int disableAutoExposureTime(){double e = 0; return is_SetAutoParameter (m_hCam, IS_SET_ENABLE_AUTO_SHUTTER, &e, 0);};
- int enableAutoWhiteBalance(){double e = WB_MODE_AUTO; return is_SetAutoParameter (m_hCam, IS_SET_ENABLE_AUTO_SENSOR_WHITEBALANCE, &e, 0);};
- int disableAutoWhiteBalance(){double e = WB_MODE_DISABLE; return is_SetAutoParameter (m_hCam, IS_SET_ENABLE_AUTO_SENSOR_WHITEBALANCE, &e, 0);};
- int setBinning(int mode);
- int setSubSampling(int mode);
- int setScaler(double factor);
- int setAOINormalized(ofRectangle aoi);
- int setAOI(ofRectangle aoi);
- int setPixelClock(int clock);
- int setFPS(double fps);
- void setOptimalCameraTiming();
- inline int setExposureTime(double exposure){return is_Exposure (m_hCam, IS_EXPOSURE_CMD_SET_EXPOSURE, (void*)&exposure, sizeof(exposure));};
- inline int setGainMaster(int gain){return is_SetHardwareGain(m_hCam, gain, IS_IGNORE_PARAMETER, IS_IGNORE_PARAMETER, IS_IGNORE_PARAMETER);};
- inline int setGainRed(int gain){return is_SetHardwareGain (m_hCam, IS_IGNORE_PARAMETER, gain, IS_IGNORE_PARAMETER, IS_IGNORE_PARAMETER);};
- inline int setGainGreen(int gain){return is_SetHardwareGain (m_hCam, IS_IGNORE_PARAMETER, IS_IGNORE_PARAMETER, gain, IS_IGNORE_PARAMETER);};
- inline int setGainBlue(int gain){return is_SetHardwareGain (m_hCam, IS_IGNORE_PARAMETER, IS_IGNORE_PARAMETER, IS_IGNORE_PARAMETER, gain);};
- inline int setColorSaturation(int saturation){return is_SetSaturation (m_hCam, saturation,saturation);};
- int setColorCorrection(double factor);
// events
ofxUeyeEvents events;
@@ -144,6 +172,7 @@ class ofxUeye{
int _bitsPerPixel;
int _bytesPerPixel;
double _colorCorrection;
+ bool _badPixelCorrection;
// helpers
void calculateMaxAOI();
View
95 src/ofxUeyeSettings.cpp
@@ -0,0 +1,95 @@
+/*
+ * ofxUeyeSettings.cpp
+ * ofxUeye
+ *
+ * Created by Paulo Barcelos on 7/26/11.
+ * Copyright 2011 paulobarcelos.com. All rights reserved.
+ *
+ */
+
+#include "ofxUeyeSettings.h"
+
+///////////////////////////////////////////////////////////////////////////////////
+// Constructor --------------------------------------------------------------------
+///////////////////////////////////////////////////////////////////////////////////
+ofxUeyeSettings::ofxUeyeSettings()
+{
+ ueye = NULL;
+}
+///////////////////////////////////////////////////////////////////////////////////
+// Destructor --------------------------------------------------------------------
+///////////////////////////////////////////////////////////////////////////////////
+ofxUeyeSettings::~ofxUeyeSettings()
+{
+ if(ueye != NULL) delete ueye;
+}
+///////////////////////////////////////////////////////////////////////////////////
+// setup --------------------------------------------------------------------------
+///////////////////////////////////////////////////////////////////////////////////
+void ofxUeyeSettings::setup(ofxUeye* ueye, int accessKey, string label)
+{
+ this->ueye = ueye;
+ settings.setup(accessKey, label);
+
+ /*settings.addMonitor(ueye, &ofxUeye::getBandwidth, "Bandwidth");
+ settings.addMonitor(ueye, &ofxUeye::getSensorWidth, "Sensor_Width");
+ settings.addMonitor(ueye, &ofxUeye::getSensorHeight, "Sensor_Height");
+ settings.addMonitor(ueye, &ofxUeye::getWidth, "AOI_Width");
+ settings.addMonitor(ueye, &ofxUeye::getHeight, "AOI_Height");*/
+
+ settings.addProperty(ueye, &ofxUeye::isLive,
+ ueye, &ofxUeye::setLive,
+ "Is_Live",
+ true);
+
+ settings.addProperty(ueye, &ofxUeye::getPixelClock,
+ ueye, &ofxUeye::setPixelClock,
+ "Pixel_Clock",
+ ueye, &ofxUeye::getPixelClockMin,
+ ueye, &ofxUeye::getPixelClockMax,
+ ueye, &ofxUeye::getPixelClockStep,
+ ueye->getPixelClockMax());
+
+ settings.addProperty(ueye, &ofxUeye::getFPS,
+ ueye, &ofxUeye::setFPS,
+ "FPS",
+ ueye, &ofxUeye::getFPSMin,
+ ueye, &ofxUeye::getFPSMax,
+ ueye, &ofxUeye::getFPSStep,
+ ueye->getFPSMax());
+
+ settings.addProperty(ueye, &ofxUeye::isBadPixelsCorrection,
+ ueye, &ofxUeye::setBadPixelsCorrection,
+ "Bad_pixels_correction",
+ true);
+
+ /*settings.addProperty(cm, &ColorsOfMovement::getNumStoredFrames,
+ cm, &ColorsOfMovement::setNumStoredFrames,
+ "Number_of_stored_frames",
+ cm, &ColorsOfMovement::getNumStoredFramesMin,
+ cm, &ColorsOfMovement::getNumStoredFramesMax,
+ cm, &ColorsOfMovement::getNumStoredFramesStep,
+ CM_DEFAULT_NUM_STORED_FRAMES);
+
+ settings.addProperty(cm, &ColorsOfMovement::getMode,
+ cm, &ColorsOfMovement::setMode,
+ "Mode",
+ cm, &ColorsOfMovement::getModeMin,
+ cm, &ColorsOfMovement::getModeMax,
+ cm, &ColorsOfMovement::getModeStep,
+ (int)CM_DEFAULT_MODE);*/
+}
+///////////////////////////////////////////////////////////////////////////////////
+// keyPressed ---------------------------------------------------------------------
+///////////////////////////////////////////////////////////////////////////////////
+void ofxUeyeSettings::keyPressed(int key)
+{
+ settings.keyPressed(key);
+}
+///////////////////////////////////////////////////////////////////////////////////
+// draw ---------------------------------------------------------------------------
+///////////////////////////////////////////////////////////////////////////////////
+void ofxUeyeSettings::draw(float x, float y)
+{
+ settings.draw(x, y);
+}
View
106 src/ofxUeyeSettings.h
@@ -1,92 +1,34 @@
+/*
+ * ofxUeyeSettings.h
+ * ofxUeye
+ *
+ * Created by Paulo Barcelos on 7/26/11.
+ * Copyright 2011 paulobarcelos.com. All rights reserved.
+ *
+ */
+
#ifndef _OFX_UEYE_SETTINGS
#define _OFX_UEYE_SETTINGS
#include "ofMain.h"
#include "ofxUeye.h"
+#include "ofxKeyboardSettings.h"
-// keyboard settings
-#define EXPOSURE 'e'
-#define GAIN_MASTER 'm'
-#define GAIN_RED 'r'
-#define GAIN_GREEN 'g'
-#define GAIN_BLUE 'b'
-#define SATURATION 's'
-#define COLOR_CORRECTION 'c'
-
-class ofxUeyeSettings{
-public:
- ofxUeyeSettings() {ueye = NULL;};
- ~ofxUeyeSettings() {if(ueye != NULL) delete ueye;};
-
- void init(ofxUeye * ueyeRef){ueye = ueyeRef;};
+////////////////////////////////////////////////////////////
+// CLASS DEFINITION ----------------------------------------
+////////////////////////////////////////////////////////////
+class ofxUeyeSettings {
- void processInput(int key){
- if( key == EXPOSURE ||
- key == GAIN_MASTER ||
- key == GAIN_RED ||
- key == GAIN_GREEN ||
- key == GAIN_BLUE ||
- key == SATURATION ||
- key == COLOR_CORRECTION) curSetting = key;
+public:
+ ofxUeyeSettings();
+ ~ofxUeyeSettings();
+ void setup(ofxUeye* ueye, int accessKey = 'u', string label = "uEye");
+ void keyPressed(int key);
+ void draw(float x, float y);
- switch (curSetting)
- {
- case EXPOSURE:
- if(key == OF_KEY_UP) ueye->setExposureTime(ueye->getExposureTime() + ueye->getExposureTimeStep());
- else if(key == OF_KEY_DOWN) ueye->setExposureTime(ueye->getExposureTime() - ueye->getExposureTimeStep());
- else if(key == '.') (ueye->isExposureTimeAuto()) ? ueye->disableAutoExposureTime() : ueye->enableAutoExposureTime();
- break;
- case GAIN_MASTER:
- if(key == OF_KEY_UP) ueye->setGainMaster(ueye->getGainMaster() + ueye->getGainMasterStep());
- else if(key == OF_KEY_DOWN) ueye->setGainMaster(ueye->getGainMaster() - ueye->getGainMasterStep());
- else if(key == '.') (ueye->isGainAuto()) ? ueye->disableAutoGain() : ueye->enableAutoGain();
- break;
- case GAIN_RED:
- if(key == OF_KEY_UP) ueye->setGainRed(ueye->getGainRed() + ueye->getGainRedStep());
- else if(key == OF_KEY_DOWN) ueye->setGainRed(ueye->getGainRed() - ueye->getGainRedStep());
- break;
- case GAIN_GREEN:
- if(key == OF_KEY_UP) ueye->setGainGreen(ueye->getGainGreen() + ueye->getGainGreenStep());
- else if(key == OF_KEY_DOWN) ueye->setGainGreen(ueye->getGainGreen() - ueye->getGainGreenStep());
- break;
- case GAIN_BLUE:
- if(key == OF_KEY_UP) ueye->setGainBlue(ueye->getGainBlue() + ueye->getGainBlueStep());
- else if(key == OF_KEY_DOWN) ueye->setGainBlue(ueye->getGainBlue() - ueye->getGainBlueStep());
- break;
- case SATURATION:
- if(key == OF_KEY_UP) ueye->setColorSaturation(ueye->getColorSaturation() + ueye->getColorSaturationStep());
- else if(key == OF_KEY_DOWN) ueye->setColorSaturation(ueye->getColorSaturation() - ueye->getColorSaturationStep());
- break;
- case COLOR_CORRECTION:
- if(key == OF_KEY_UP) ueye->setColorCorrection(ueye->getColorCorrection() + ueye->getColorCorrectionStep());
- else if(key == OF_KEY_DOWN) ueye->setColorCorrection(ueye->getColorCorrection() - ueye->getColorCorrectionStep());
- break;
- }
- };
-
- void draw(int x, int y){
- stringstream reportStream;
- reportStream << "APP FPS: " << ofGetFrameRate() << endl;
- reportStream << "Used Bandwidth: " << ueye->getBandwidth() << endl;
- reportStream << "AOI: " << "(" << ueye->getAOI().x << ", " << ueye->getAOI().y << ", " << ueye->getAOI().width << ", " << ueye->getAOI().height << ")" << endl;
- reportStream << "FPS: " << ueye->getFPS() << " (min: " << ueye->getFPSMin() << " | max: " << ueye->getFPSMax() << " | step: " << ueye->getFPSStep() << ")" << endl;
- reportStream << "Pixel Clock: " << ueye->getPixelClock() << " (min: " << ueye->getPixelClockMin() << " | max: " << ueye->getPixelClockMax() << " | step: " << ueye->getPixelClockStep() << ")" << endl;
- reportStream << ((curSetting == EXPOSURE)?"*": "") << "(e) Exposure Time: " << ((ueye->isExposureTimeAuto()) ?"(auto) ": "") << ueye->getExposureTime() << " (min: " << ueye->getExposureTimeMin() << " | max: " << ueye->getExposureTimeMax() << " | step: " << ueye->getExposureTimeStep() << ")" << endl;
- reportStream << ((curSetting == GAIN_MASTER)?"*": "") << "(m) Gain Master: " << ((ueye->isGainAuto()) ?"(auto) ": "") << ueye->getGainMaster() << " (min: " << ueye->getGainMasterMin() << " | max: " << ueye->getGainMasterMax() << " | step: " << ueye->getGainMasterStep() << ")" << endl;
- reportStream << ((curSetting == GAIN_RED)?"*": "") << "(r) Gain Red: " << ueye->getGainRed() << " (min: " << ueye->getGainRedMin() << " | max: " << ueye->getGainRedMax() << " | step: " << ueye->getGainRedStep() << ")" << endl;
- reportStream << ((curSetting == GAIN_GREEN)?"*": "") << "(g) Gain Green: " << ueye->getGainGreen() << " (min: " << ueye->getGainGreenMin() << " | max: " << ueye->getGainGreenMax() << " | step: " << ueye->getGainGreenStep() << ")" << endl;
- reportStream << ((curSetting == GAIN_BLUE)?"*": "") << "(b) Gain Blue: " << ueye->getGainBlue() << " (min: " << ueye->getGainBlueMin() << " | max: " << ueye->getGainBlueMax() << " | step: " << ueye->getGainBlueStep() << ")" << endl;
- reportStream << ((curSetting == SATURATION)?"*": "") << "(s) Color Saturation: " << ueye->getColorSaturation() << " (min: " << ueye->getColorSaturationMin() << " | max: " << ueye->getColorSaturationMax() << " | step: " << ueye->getColorSaturationStep() << ")" << endl;
- reportStream << ((curSetting == COLOR_CORRECTION)?"*": "")<<"(c) Color Correction: " << ueye->getColorCorrection() << " (min: " << ueye->getColorCorrectionMin() << " | max: " << ueye->getColorCorrectionMax() << " | step: " << ueye->getColorCorrectionStep() << ")" << endl;
-
- ofSetColor(0);
- ofDrawBitmapString(reportStream.str(), x+1, y+1);
- ofSetColor(255);
- ofDrawBitmapString(reportStream.str(), x, y);
- };
private:
- ofxUeye * ueye;
- int curSetting;
+
+ ofxUeye* ueye;
+ ofxKeyboardSettings settings;
};
-
-#endif
+#endif

0 comments on commit 84c4588

Please sign in to comment.
Something went wrong with that request. Please try again.