StrengthLine.hpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*********************************************************************/
  2. /* */
  3. /* Copyright 2022-2023 Rémi Synave - remi.synave@univ-littoral.fr */
  4. /* */
  5. /* This file is part of DSL. */
  6. /* This software uses Qt to build the Graphical User Interface */
  7. /* https://www.qt.io/ */
  8. /* */
  9. /* DSL is free software: you can redistribute it and/or modify */
  10. /* it under the terms of the GNU General Public License as published */
  11. /* by the Free Software Foundation, either version 3 of the License, */
  12. /* or (at your option) any later version. */
  13. /* */
  14. /* DSL is distributed in the hope that it will be useful, */
  15. /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
  16. /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
  17. /* GNU General Public License for more details. */
  18. /* */
  19. /* You should have received a copy of the GNU General Public License */
  20. /* along with DSL. If not, see <http://www.gnu.org/licenses/>. */
  21. /* */
  22. /*********************************************************************/
  23. #ifndef STRENGTHLINE_HPP
  24. #define STRENGTHLINE_HPP
  25. #include <QPoint>
  26. #include <QImage>
  27. class StrengthLine
  28. {
  29. private:
  30. QPoint * p1, *p2;
  31. std::pair < float, float >equation () const;
  32. public:
  33. StrengthLine (QPoint * p1 = new QPoint (0, 0), QPoint * p2 =
  34. new QPoint (1, 1));
  35. std::pair < QPoint *, QPoint * >toDraw (QImage * img) const;
  36. std::pair < QPoint *, QPoint * >interpolateToEdge (QImage * img) const;
  37. };
  38. #endif