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.

104 lines
3.6 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: xformobj.hxx *
  3. * *
  4. * User objects for transforms. *
  5. * *
  6. * Created: 13-Sep-1990 14:45:27 *
  7. * Author: Wendy Wu [wendywu] *
  8. * *
  9. * Copyright (c) 1990-1999 Microsoft Corporation *
  10. \**************************************************************************/
  11. #if defined(_AMD64_)
  12. #include "..\math\daytona\amd64\efloat.hxx"
  13. #elif defined(_IA64_)
  14. #include "..\math\daytona\ia64\efloat.hxx"
  15. #elif defined(BUILD_WOW6432) && defined(_X86_)
  16. #include "..\math\wow6432\i386\efloat.hxx"
  17. #else
  18. #include "..\math\daytona\i386\efloat.hxx"
  19. #endif
  20. class MATRIX
  21. {
  22. public:
  23. EFLOAT efM11;
  24. EFLOAT efM12;
  25. EFLOAT efM21;
  26. EFLOAT efM22;
  27. EFLOAT efDx;
  28. EFLOAT efDy;
  29. FIX fxDx;
  30. FIX fxDy;
  31. FLONG flAccel; // accelerators
  32. };
  33. typedef MATRIX *PMATRIX;
  34. #define PMXNULL ((PMATRIX) NULL)
  35. // These constants are used in the XFORMOBJ constructor.
  36. #define COORD_METAFILE 1
  37. #define COORD_WORLD 2
  38. #define COORD_PAGE 3
  39. #define COORD_DEVICE 4
  40. #define WORLD_TO_PAGE ((COORD_WORLD << 8) + COORD_PAGE)
  41. #define PAGE_TO_DEVICE ((COORD_PAGE << 8) + COORD_DEVICE)
  42. #define METAFILE_TO_DEVICE ((COORD_METAFILE << 8) + COORD_DEVICE)
  43. #define WORLD_TO_DEVICE ((COORD_WORLD << 8) + COORD_DEVICE)
  44. #define DEVICE_TO_PAGE ((COORD_DEVICE << 8) + COORD_PAGE)
  45. #define DEVICE_TO_WORLD ((COORD_DEVICE << 8) + COORD_WORLD)
  46. // The exponents of all the coefficients for the various transforms must be
  47. // within the following ranges:
  48. //
  49. // Metafile --
  50. // |--> -47 <= e <= 48
  51. // World --
  52. // |--> -47 <= e <= 48
  53. // Page --
  54. // |--> -31 <= e <= 31
  55. // Device --
  56. //
  57. // This will guarantee us a METAFILE_TO_DEVICE transform with
  58. //
  59. // -126 <= exponents <= 127
  60. //
  61. // for all the coefficients. The ranges are set so that transform coefficients
  62. // can fit nicely in the IEEE single precision floating point format which has
  63. // 8-bit exponent field that can hold values from -126 to 127. Note that when
  64. // the transforms have reached the limits the calculations of inverse transforms
  65. // might cause overflow
  66. // The max and min values for metafile and world transforms.
  67. #define MAX_METAFILE_XFORM_EXP 52
  68. #define MIN_METAFILE_XFORM_EXP -43
  69. #define MAX_WORLD_XFORM_EXP MAX_METAFILE_XFORM_EXP
  70. #define MIN_WORLD_XFORM_EXP MIN_METAFILE_XFORM_EXP
  71. #define MAX_METAFILE_XFORM 1024*1024*1024*1024*1024*4 // 2^52
  72. #define MIN_METAFILE_XFORM 1/(1024*1024*1024*1024*8) // 2^(-43)
  73. #define MAX_WORLD_XFORM MAX_METAFILE_XFORM
  74. #define MIN_WORLD_XFORM MIN_METAFILE_XFORM
  75. // flag values for matrix.flAccel
  76. // These constants are used in the XFORMOBJ constructor.
  77. #define IDENTITY 1
  78. #define DONT_COMPUTE_FLAGS 0
  79. #define COMPUTE_FLAGS 1
  80. #define XFORM_FORMAT (XFORM_FORMAT_LTOFX|XFORM_FORMAT_FXTOL|XFORM_FORMAT_LTOL)
  81. // Export this for xform.cxx to use
  82. extern MATRIX gmxIdentity_LToFx;