LineT.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * NICE-Core - efficient algebra and computer vision methods
  3. * - libimage - An image/template for new NICE libraries
  4. * See file License for license information.
  5. */
  6. #ifndef _LINE_IMAGE_H
  7. #define _LINE_IMAGE_H
  8. #include <iostream>
  9. #include <core/image/Drawable.h>
  10. #include <core/image/CoordT.h>
  11. #include <core/image/ColorT.h>
  12. namespace NICE {
  13. /**
  14. * A Drawable line.
  15. */
  16. template<class P>
  17. class LineT : public Drawable<P>
  18. {
  19. private:
  20. bool steep;
  21. Coord begin;
  22. Coord end;
  23. protected:
  24. void doDraw(ColorImageT<P> &image, const ColorT<P>& color) const;
  25. void doDraw(ImageT<P> &image, const P& gray) const;
  26. public:
  27. //! Default constructor
  28. inline LineT() {}
  29. //! Constructor
  30. /** \param begin begin of the line
  31. * \param end end of the line
  32. */
  33. LineT(const Coord &begin, const Coord &end);
  34. //! Constructor
  35. /** \param begin begin of the line
  36. * \param end end of the line
  37. * \param _defaultColor color of the line
  38. */
  39. LineT(const Coord &begin, const Coord &end, const ColorT<P>& _defaultColor);
  40. //! Copy-Constructor
  41. /*! \param arg class to copy
  42. */
  43. LineT(const LineT<P>& arg);
  44. //! Destructor of LineT
  45. virtual ~LineT();
  46. //! Assignment operator
  47. /*! \param ex class to copy
  48. * \return a reference to this class
  49. */
  50. LineT<P>& operator=(const LineT<P>& ex);
  51. //! Compare operator
  52. /*! \param ex class to compare
  53. * \return true if class content is equal
  54. */
  55. bool operator==(const LineT<P>& ex) const;
  56. //! Compare operator
  57. /*! \param ex class to compare
  58. * \return true if class content is not equal
  59. */
  60. bool operator!=(const LineT<P>& ex) const;
  61. };
  62. typedef LineT<Ipp8u> Line;
  63. } // namespace NICE
  64. //#ifdef __GNUC__
  65. #include "core/image/LineT.tcc"
  66. //#endif
  67. #endif /* _LINE_IMAGE_H */