PointT.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. /*****************************************************************************/
  7. #ifndef _POINT_IMAGE_H
  8. #define _POINT_IMAGE_H
  9. #include <iostream>
  10. #include <core/image/Drawable.h>
  11. #include <core/image/CoordT.h>
  12. #include <core/image/ColorT.h>
  13. namespace NICE {
  14. /**
  15. * A Drawable point.
  16. */
  17. template<class P>
  18. class PointT : public Drawable<P>
  19. {
  20. private:
  21. Coord coord;
  22. protected:
  23. void doDraw(ColorImageT<P> &image, const ColorT<P>& color) const;
  24. void doDraw(ImageT<P> &image, const P& gray) const;
  25. public:
  26. //! Default constructor
  27. PointT() {}
  28. //! Constructor of optional argument with default-value
  29. /*! \param x
  30. * \param y
  31. */
  32. PointT(int x, int y) : coord(x,y) {}
  33. PointT(int x, int y, const ColorT<P>& _defaultColor)
  34. : Drawable<P>(_defaultColor), coord(x,y) {}
  35. //! Constructor with given coordinatens \c coords
  36. /*! \param coords coordinates of the point
  37. */
  38. PointT(Coord coords) : coord(coords) {};
  39. //! Copy-Constructor
  40. /*! \param arg class to copy
  41. */
  42. PointT(const PointT<P>& arg);
  43. //! Destructor of PointT
  44. virtual ~PointT();
  45. //! Assignment operator
  46. /*! \param ex class to copy
  47. * \return a reference to this class
  48. */
  49. PointT<P>& operator=(const PointT<P>& ex);
  50. //! Compare operator
  51. /*! \param ex class to compare
  52. * \return true if class content is equal
  53. */
  54. bool operator==(const PointT<P>& ex) const;
  55. //! Compare operator
  56. /*! \param ex class to compare
  57. * \return true if class content is not equal
  58. */
  59. bool operator!=(const PointT<P>& ex) const;
  60. };
  61. typedef PointT<Ipp8u> Point;
  62. } // namespace NICE
  63. //#ifdef __GNUC__
  64. #include "core/image/PointT.tcc"
  65. //#endif
  66. #endif /* _POINT_IMAGE_H */