-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFrame.h
64 lines (50 loc) · 1.61 KB
/
Frame.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//*****************************************************************************
//
// Frame.h : Defines the class operations on images
//
// Author - Aditya Dhulipala - based on starter code by Prof. Parag Havaldar
// Main Frame class structure
//
//*****************************************************************************
// C RunTime Header Files
#pragma once
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <opencv2/core/core.hpp>
using namespace cv;
// Class structure of Frame
// Use to encapsulate an RGB image
class Frame {
private:
int Width; // Width of Frame
int Height; // Height of Frame
char ImagePath[100]; // Frame location
char *Data; // RGB data of the image
Mat MatData;
public:
// Constructor
Frame();
// Copy Constructor
Frame(Frame *otherImage);
// Destructor
~Frame();
// operator overload
Frame &operator=(const Frame &otherImage);
// Reader & Writer functions
void setWidth(const int w) { Width = w; };
void setHeight(const int h) { Height = h; };
void setImageData(const char *img) { Data = (char *) img; };
void setImagePath(const char *path) { strcpy(ImagePath, path); }
void setMatData(const Mat data) { MatData = data; }
int getWidth() { return Width; };
int getHeight() { return Height; };
char *getImageData() { return Data; };
char *getImagePath() { return ImagePath; }
Mat getMatData() { return MatData; }
// Input Output operations
bool ReadImage();
bool WriteImage();
// Modifications
bool Modify();
};