/*
  Image.h
  
  Author: Sergi Diaz Planas (2017)
*/
#ifndef IMAGE_H
#define IMAGE_H

/*  Class WFImage intended to be used as a model which
 *  can be interpreted and managed by both the PHP server
 *  and the C++ code. The name stands for 'Web Face Image'.
 *
 * */

#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#include "utils.h"

class Image
{
public:
    Image();
    bool load(std::string b64); // parse a base64 string
    std::string base64();       // get image as a base64 string
    bool isEmpty();

    // Getter and setter
    cv::Mat getImage();
    void setImage(cv::Mat image);

    // Get a portion of the image
    Image crop(int x, int y, int w, int h);

protected:
    cv::Mat image;
};

#endif // IMAGE_H
