EllipseT.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 _ELLIPSE_IMAGE_H
  7. #define _ELLIPSE_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 ellipse.
  15. */
  16. template<class P>
  17. class EllipseT : public Drawable<P>
  18. {
  19. private:
  20. Coord center;
  21. Coord axis;
  22. float angle;
  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. EllipseT();
  29. /** Constructor
  30. * \param center center of the ellipse
  31. * \param axis axis of the ellipse
  32. * \param angle angle of the ellipse
  33. */
  34. EllipseT(const Coord &center, const Coord &axis, float angle=0.0);
  35. /** Constructor
  36. * \param center center of the ellipse
  37. * \param axis axis of the ellipse
  38. * \param angle angle of the ellipse
  39. * \param _defaultColor color of the ellipse
  40. */
  41. EllipseT(const Coord &center, const Coord &axis, float angle,
  42. const ColorT<P>& _defaultColor);
  43. //! Copy-Constructor
  44. /*! \param arg class to copy
  45. */
  46. EllipseT(const EllipseT<P>& arg);
  47. //! Destructor of EllipseT
  48. virtual ~EllipseT();
  49. //! Assignment operator
  50. /*! \param ex class to copy
  51. * \return a reference to this class
  52. */
  53. EllipseT<P>& operator=(const EllipseT<P>& ex);
  54. //! Compare operator
  55. /*! \param ex class to compare
  56. * \return true if class content is equal
  57. */
  58. bool operator==(const EllipseT<P>& ex) const;
  59. //! Compare operator
  60. /*! \param ex class to compare
  61. * \return true if class content is not equal
  62. */
  63. bool operator!=(const EllipseT<P>& ex) const;
  64. };
  65. typedef EllipseT<Ipp8u> Ellipse;
  66. } // namespace NICE
  67. //#ifdef __GNUC__
  68. #include "core/image/EllipseT.tcc"
  69. //#endif
  70. #endif /* _ELLIPSE_IMAGE_H */