Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
969 B

  1. /*============================================================================
  2. *
  3. * Copyright (C) 1999-2000 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: bezier.hpp
  6. * Content: Declarations for Beziers
  7. *
  8. ****************************************************************************/
  9. #ifndef _BEZIER_HPP
  10. #define _BEZIER_HPP
  11. #include "bspline.hpp"
  12. class RDBezier : public RDBSpline
  13. {
  14. public:
  15. RDBezier(DWORD dwOrderU, DWORD dwOrderV);
  16. virtual double TexCoordU(double u) const;
  17. virtual double TexCoordV(double v) const;
  18. private:
  19. double m_lut[13][13];
  20. virtual double Basis(unsigned i, unsigned n, double t) const;
  21. virtual double BasisPrime(unsigned i, unsigned n, double t) const;
  22. unsigned factorial(unsigned k) const
  23. {
  24. _ASSERT(k < 13, "Factorial out of range");
  25. for(unsigned i = 1, t = 1; i <= k; t *= i++);
  26. return t;
  27. }
  28. };
  29. #endif // _BEZIER_HPP