2024-04-16 01:09:42 +00:00
|
|
|
/**
|
|
|
|
* This class exists for the purpose of loading and manipulating
|
|
|
|
* iamges before displaying them. All OpenCV operations are
|
|
|
|
* handled by this class.
|
|
|
|
*
|
|
|
|
* Licence: MIT
|
|
|
|
* 2024 Matthew McWilliams
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef IMAGE_h
|
|
|
|
#define IMAGE_h
|
|
|
|
|
|
|
|
#include <opencv2/core.hpp>
|
|
|
|
#include <opencv2/core/opengl.hpp>
|
|
|
|
#include <opencv2/imgcodecs.hpp>
|
|
|
|
#include <opencv2/imgproc/imgproc.hpp>
|
|
|
|
#include <opencv2/highgui.hpp>
|
2024-04-24 19:58:30 +00:00
|
|
|
#include <iostream>
|
2024-04-16 01:09:42 +00:00
|
|
|
|
2024-11-24 15:38:36 +00:00
|
|
|
#include "dpx/include/dpx.h"
|
2024-11-07 03:37:15 +00:00
|
|
|
|
2024-04-24 19:58:30 +00:00
|
|
|
using namespace std;
|
2024-04-16 01:09:42 +00:00
|
|
|
using namespace cv;
|
|
|
|
|
|
|
|
class Image {
|
|
|
|
private:
|
|
|
|
uint16_t width;
|
|
|
|
uint16_t height;
|
|
|
|
Mat blank;
|
2024-10-22 19:20:27 +00:00
|
|
|
Mat loaded;
|
|
|
|
Mat resized;
|
|
|
|
Mat image;
|
2024-11-07 03:37:15 +00:00
|
|
|
string getExtLower(const string& path);
|
|
|
|
|
2024-04-16 01:09:42 +00:00
|
|
|
public:
|
2024-04-20 01:48:14 +00:00
|
|
|
Image();
|
2024-04-24 19:58:30 +00:00
|
|
|
void setDimensions(uint16_t w, uint16_t h) { width = w; height = h; };
|
2024-04-16 01:09:42 +00:00
|
|
|
Mat getBlank();
|
2024-04-24 19:58:30 +00:00
|
|
|
Mat loadImage(string& image_path, uint64_t& x, uint64_t& y, uint64_t& w, uint64_t& h);
|
2024-04-16 01:09:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|