Add preprocessor definition for simulation

This commit is contained in:
Yohan Simard 2021-03-02 18:39:32 +01:00
parent 188683847a
commit 1bdadaa50f
3 changed files with 33 additions and 34 deletions

View file

@ -1,6 +1,6 @@
build/
src.sav/
cmake-build-debug/
cmake-build-*/
futur/
CMakeFiles/

View file

@ -27,6 +27,7 @@ add_library(lib
)
target_include_directories(lib PUBLIC lib)
target_link_libraries(lib base64)
target_compile_definitions(lib PUBLIC __FOR_PC__ __SIMULATION__ __WITH_ARUCO__)
# Compile main executable
add_executable(main main.cpp tasks.cpp tasks.h)

View file

@ -22,8 +22,7 @@
#include <opencv2/imgproc/imgproc.hpp>
#ifndef __FOR_PC__
// TODO install raspicam and uncomment
//#include "raspicam/raspicam_cv.h"
#include "raspicam/raspicam_cv.h"
#endif /* __FOR_PC__ */
#include "img.h"
@ -82,38 +81,37 @@ public:
*/
bool IsOpen();
/**
* Define size for sampled picture
* @param size Size of picture (@see captureSize)
*/
void SetSize(int size);
/**
* Define size for sampled picture
* @param size Size of picture (@see captureSize)
*/
void SetSize(int size);
/**
* Grab next image from camera
* @return Image taken from camera
*/
Img Grab();
/**
* Grab next image from camera
* @return Image taken from camera
*/
Img Grab();
private:
// TODO install raspicam and uncomment
//#ifdef __FOR_PC__
// /**
// * Camera descriptor
// */
// cv::VideoCapture cap;
//#else
// raspicam::RaspiCam_Cv cap;
//#endif /* __FOR_PC__ */
#ifdef __FOR_PC__
/**
* Camera descriptor
*/
cv::VideoCapture cap;
#else
raspicam::RaspiCam_Cv cap;
#endif /* __FOR_PC__ */
/**
* Size for image (default= small)
*/
int size = sm;
/**
* Size for image (default= small)
*/
int size = sm;
/**
* Width of image
*/
int width;
/**
* Width of image
*/
int width;
/**
* Height of image