#include <DoQuBook/DegradationModel.hpp>
#include <QObject>
#include <QtGui/QApplication>
#include "window.h"
#include <PluginConfig.hpp>
/**
  * \mainpage
  *
  * \author kvcuong https://bitbucket.org/kvcuong
  *
  * - Plugin written for digidoc in labri. This degradation model aims at mimicking some challenging distortions for staff removal
algorithms, such as skews, curvatures and rotations. Differing from the 2D model used for GREC 2011, our new 3D model generates much more realistic images containing dents, small folds, torns. . . This 3D degradation model can distort the
staff lines, making their detection and removal more difficult. It is based on 3D meshes and texture coordinate generation. The
main idea is that we get multiple 3D meshes of old document pages using real ancient documents and a 3D scanner. Then,
we wrap any 2D image on these meshes using some wrapping functions which are specifically adapted to document images.
  *
  * - Licence LGLPL
  *
  * - Algorithm plugin type : DegradationModel
  * - Plugin name : labri.ThreeDDistortionModel.v0.1
  * - Parameters : \see ThreeDDistortionModel::degradate
  * - Exemple :
  *     image path = ../../test.png, mesh path = ../../livre01_v1_p01_NOR_TEX.obj
  */

class ThreeDDistortionModel : public DegradationModel
{
    Q_OBJECT
    DQB_PLUGIN(DegradationModel, "doqubook.degradationmodel")

public:
    ~ThreeDDistortionModel();
    virtual QList<DoQuBook::ExecutorParameterPtr> parameters () {
        QList<DoQuBook::ExecutorParameterPtr> params;
        params << DoQuBook::ExecutorParameter::create("Image path", "String", true);
        params << DoQuBook::ExecutorParameter::create("Mesh path", "String", true);
        return params;
    }
    /**
      * \mainpage      
      *  params["Image path"] type : string (required)// The path of image input
      *  params["Mesh path"] type : string (required)// The path of mesh input
      *
      */
    QImage degradate(const QImage &image, const QVariantMap &parameters = QVariantMap());

};
