-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPGMimageProcessor.h
37 lines (33 loc) · 1.37 KB
/
PGMimageProcessor.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
#pragma once
#include <iostream>
#include <fstream>
#include <vector>
#include <memory>
#include <string.h>
#include "ConnectedComponent.cpp"
#include "image.h"
#define print(x) std::cout << x << std::endl;
#define log(x) std::clog << x << std::endl;
class PGMimageProcessor
{
public:
image inputImage;
std::vector<ConnectedComponent> components;
PGMimageProcessor(); // Default
PGMimageProcessor(const std::string filename); // Custom
PGMimageProcessor(const PGMimageProcessor &rhs); // Copy
PGMimageProcessor(PGMimageProcessor &&rhs); // Move
PGMimageProcessor &operator=(const PGMimageProcessor &rhs); // Copy Assing
PGMimageProcessor operator=(PGMimageProcessor &&rhs); // Move assign
~PGMimageProcessor(); // Destructor
int extractComponents(unsigned char threshold, int minValidSize);
int filterComponentBySize(int minSize, int maxSize);
bool writeComponents(const std::string &outFileName);
int getComponentCount(void) const;
int getLargestSize(void) const;
int getSmallestSize(void) const;
void printComponentData(const ConnectedComponent &theComponent) const;
void printData(void);
void save_image(const char *filename, const image &img);
ConnectedComponent search(int startx, int starty);
};