12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- /*********************************************************************/
- /* */
- /* 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 <http://www.gnu.org/licenses/>. */
- /* */
- /*********************************************************************/
- #ifndef STRENGTHLINE_HPP
- #define STRENGTHLINE_HPP
- #include <QPoint>
- #include <QImage>
- 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
|