Getting rid of all the hard coded constants
This commit is contained in:
+3
-6
@@ -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
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user