Getting rid of all the hard coded constants

This commit is contained in:
2022-11-10 20:55:23 +01:00
parent cd3b613b0a
commit d00cd2945b
5 changed files with 22 additions and 12 deletions
+3 -6
View File
@@ -1,12 +1,9 @@
#include "input.h"
Input::Input(/* args */) : cap(0)
Input::Input(int video_height, int video_width) : cap(0), video_height(video_height), video_width(video_width)
{
const int VID_HEIGHT = 240;
const int VID_WIDTH = 320;
this->cap.set(CAP_PROP_FRAME_HEIGHT, VID_HEIGHT);
this->cap.set(CAP_PROP_FRAME_WIDTH, VID_WIDTH);
this->cap.set(CAP_PROP_FRAME_HEIGHT, video_height);
this->cap.set(CAP_PROP_FRAME_WIDTH, video_width);
}
Input::~Input()
+4 -1
View File
@@ -17,7 +17,10 @@ private:
VideoCapture cap;
public:
Input(/* args */);
int video_height;
int video_width;
Input(int video_height, int video_width);
Input() = delete;
~Input();
Mat readFile(String filePath);
Mat readWebcam();