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.

164 lines
4.4 KiB

  1. //==========================================================================;
  2. //
  3. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. // PURPOSE.
  7. //
  8. // Copyright (c) 1992 - 1996 Microsoft Corporation. All Rights Reserved.
  9. //
  10. //==========================================================================;
  11. #ifndef __SCALER_H
  12. #define __SCALER_H
  13. #include "mytypes.h"
  14. #define HDROP HANDLE
  15. #include "viddefs.h"
  16. #include "capmain.h"
  17. #include "register.h"
  18. // structure contains video information
  19. struct VideoInfoStruct
  20. {
  21. WORD Clkx1_HACTIVE;
  22. WORD Clkx1_HDELAY;
  23. WORD Min_Pixels;
  24. WORD Active_lines_per_field;
  25. WORD Min_UncroppedPixels;
  26. WORD Max_Pixels;
  27. WORD Min_Lines;
  28. WORD Max_Lines;
  29. WORD Max_VFilter1_Pixels;
  30. WORD Max_VFilter2_Pixels;
  31. WORD Max_VFilter3_Pixels;
  32. WORD Max_VFilter1_Lines;
  33. WORD Max_VFilter2_Lines;
  34. WORD Max_VFilter3_Lines;
  35. };
  36. /////////////////////////////////////////////////////////////////////////////
  37. // CLASS Scaler
  38. //
  39. // Description:
  40. // This class encapsulates the register fields in the scaler portion of
  41. // the Bt848.
  42. // A complete set of functions are developed to manipulate all the
  43. // register fields in the scaler registers for the Bt848.
  44. //
  45. // Methods:
  46. // See below
  47. //
  48. // Note:
  49. // For Bt848, instantiate as ...
  50. // Scaler evenScaler(VF_Even);
  51. // Scaler oddScaler(VF_Odd);
  52. //
  53. /////////////////////////////////////////////////////////////////////////////
  54. class Scaler
  55. {
  56. public:
  57. Scaler(PDEVICE_PARMS);
  58. ~Scaler();
  59. void * operator new(size_t size, void * pAllocation) { return(pAllocation);}
  60. void operator delete(void * pAllocation) {}
  61. void VideoFormatChanged(VideoFormat);
  62. void TurnVFilter(State st) { VFilterFlag_ = st; }
  63. void Scale(MRect &);
  64. ErrorCode SetAnalogWin(const MRect &);
  65. void GetAnalogWin(MRect &) const;
  66. ErrorCode SetDigitalWin(const MRect &);
  67. void GetDigitalWin(MRect &) const;
  68. // member functions for VBI support
  69. virtual void SetVBIEN(BOOL);
  70. virtual BOOL IsVBIEN();
  71. virtual void SetVBIFMT(BOOL);
  72. virtual BOOL IsVBIFMT();
  73. void DumpSomeState();
  74. protected:
  75. //===========================================================================
  76. // Scaler registers
  77. //===========================================================================
  78. RegisterB regCROP;
  79. RegField fieldVDELAY_MSB;
  80. RegField fieldVACTIVE_MSB;
  81. RegField fieldHDELAY_MSB;
  82. RegField fieldHACTIVE_MSB;
  83. RegisterB regVDELAY_LO;
  84. RegisterB regVACTIVE_LO;
  85. RegisterB regHDELAY_LO;
  86. RegisterB regHACTIVE_LO;
  87. RegisterB regHSCALE_HI;
  88. RegField fieldHSCALE_MSB;
  89. RegisterB regHSCALE_LO;
  90. RegisterB regSCLOOP;
  91. RegField fieldHFILT;
  92. RegisterB regVSCALE_HI;
  93. RegField fieldVSCALE_MSB;
  94. RegisterB regVSCALE_LO;
  95. RegisterB regVTC;
  96. RegField fieldVBIEN;
  97. RegField fieldVBIFMT;
  98. RegField fieldVFILT;
  99. CompositeReg regVDelay;
  100. CompositeReg regVActive;
  101. CompositeReg regVScale;
  102. CompositeReg regHDelay;
  103. CompositeReg regHActive;
  104. CompositeReg regHScale;
  105. // Since VDelay register in hardware is reversed;
  106. // i.e. odd reg is really even field and vice versa, need an extra cropping reg
  107. // for the opposite field
  108. RegisterB regReverse_CROP;
  109. VideoInfoStruct * m_ptrVideoIn;
  110. MRect AnalogWin_;
  111. MRect DigitalWin_;
  112. // member functions to set scaling registers
  113. virtual void SetHActive(MRect &);
  114. virtual void SetHDelay();
  115. virtual void SetHScale();
  116. virtual void SetHFilter();
  117. virtual void SetVActive();
  118. virtual void SetVDelay();
  119. virtual void SetVScale(MRect &);
  120. virtual void SetVFilter();
  121. private:
  122. VideoFormat m_videoFormat; // video format
  123. // this is to battle junk lines at the top of the video
  124. State VFilterFlag_;
  125. WORD m_HActive; // calcuated intermediate value
  126. WORD m_pixels; // calcuated intermediate value
  127. WORD m_lines; // calcuated intermediate value
  128. WORD m_VFilter; // calcuated intermediate value
  129. };
  130. #endif __SCALER_H