/*********************************************************************/
/* */
/* Copyright 2022-2023 RĂ©mi Synave - remi.synave@univ-littoral.fr */
/* */
/* This file is part of DSL. */
/* This software uses Qt to build the Graphical User Interface */
/* https://www.qt.io/ */
/* */
/* DSL is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published */
/* by the Free Software Foundation, either version 3 of the License, */
/* or (at your option) any later version. */
/* */
/* DSL is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with DSL. If not, see . */
/* */
/*********************************************************************/
#ifndef STRENGTHLINE_HPP
#define STRENGTHLINE_HPP
#include
#include
class StrengthLine
{
private:
QPoint *p1, *p2;
std::pair < float, float > equation () const;
public:
StrengthLine (QPoint * p1 = new QPoint (0, 0), QPoint * p2 =
new QPoint (1, 1));
QPoint* getP1() const;
QPoint* getP2() const;
std::pair < QPoint *, QPoint * > toDraw (QImage * img) const;
std::pair < QPoint *, QPoint * > interpolateToEdge (QImage * img) const;
static StrengthLine* getRandomLine (QImage * img);
static StrengthLine* getRandomLine (int width, int height);
};
#endif