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.

56 lines
1.8 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Copyright (C) Microsoft Corporation, 1998.
  3. //
  4. // EdgeFunc.hpp
  5. //
  6. // Direct3D Reference Rasterizer - Edge Function Processing
  7. //
  8. ///////////////////////////////////////////////////////////////////////////////
  9. #ifndef _EDGEFUNC_HPP
  10. #define _EDGEFUNC_HPP
  11. //-----------------------------------------------------------------------------
  12. //
  13. // Utility to compute determinant - must be computed in manner consistent with
  14. // other edge function processing.
  15. //
  16. //-----------------------------------------------------------------------------
  17. FLOAT
  18. ComputeDeterminant(
  19. FLOAT fX0, FLOAT fY0,
  20. FLOAT fX1, FLOAT fY1,
  21. FLOAT fX2, FLOAT fY2 );
  22. //-----------------------------------------------------------------------------
  23. //
  24. // Primitive edge function - Computes, stores, and evaluates linear function
  25. // for edges. Basic function is stored in fixed point. Gradient sign terms
  26. // are computed and stored separately to adhere to fill rules.
  27. //
  28. //-----------------------------------------------------------------------------
  29. class RREdgeFunc
  30. {
  31. private:
  32. INT32 m_iA; // n.4 fixed point
  33. INT32 m_iB; // n.4 fixed point
  34. INT64 m_iC; // n.8 fixed point
  35. BOOL m_bAPos; // carefully computed signs of A,B
  36. BOOL m_bBPos;
  37. public:
  38. // DEFINE
  39. void Set(
  40. FLOAT fX0, FLOAT fY0, FLOAT fX1, FLOAT fY1,
  41. FLOAT fDet, BOOL bFragProcEnable );
  42. // Point Sampling Test
  43. // returns 0000=outside, FFFF=inside
  44. RRCvgMask PSTest( INT16 iX, INT16 iY );
  45. // Anti Alias test
  46. // returns coverage mask (0000=outside, FFFF=completely inside, partial otherwise)
  47. RRCvgMask AATest( INT16 iX, INT16 iY );
  48. };
  49. //////////////////////////////////////////////////////////////////////////////
  50. #endif // _EDGEFUNC_HPP