Adds mutations
This commit is contained in:
+39
@@ -0,0 +1,39 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <Magick++.h>
|
||||
|
||||
#include <bitset> //in which we store our feature vectors
|
||||
#include <algorithm> //for sorting
|
||||
|
||||
using namespace std;
|
||||
using namespace Magick;
|
||||
|
||||
namespace fs = boost::filesystem;
|
||||
|
||||
//Virtual base class
|
||||
//Holds definitions for all common functions of descriptors,
|
||||
//but should be overloaded by a child class
|
||||
class Mutation {
|
||||
public:
|
||||
//virtual void mutate(Image* img) = 0;
|
||||
virtual Image* getMutated(Image* img) = 0;
|
||||
|
||||
virtual string ToString() = 0;
|
||||
virtual fs::path ToPath() {
|
||||
return fs::path(this->ToString());
|
||||
}
|
||||
};
|
||||
|
||||
//Just the way dogs see
|
||||
class Grayscale : public Mutation {
|
||||
public:
|
||||
Image* getMutated(Image* img) {
|
||||
Image* mut = new Image(*img);
|
||||
mut->type(GrayscaleType);
|
||||
return mut;
|
||||
}
|
||||
string ToString() {
|
||||
return "Grayscale";
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user