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.

67 lines
1.5 KiB

  1. class CDitherTable
  2. {
  3. friend class CDitherToRGB8;
  4. public:
  5. CDitherTable();
  6. ~CDitherTable();
  7. BOOL Match( ULONG nColors, const RGBQUAD* prgbColors );
  8. HRESULT SetColors( ULONG nColors, const RGBQUAD* prgbColors );
  9. protected:
  10. HRESULT BuildInverseMap();
  11. void inv_cmap( int colors, RGBQUAD *colormap, int bits, ULONG* dist_buf,
  12. BYTE* rgbmap );
  13. int redloop();
  14. int greenloop( int restart );
  15. int blueloop( int restart );
  16. void maxfill( ULONG* buffer, long side );
  17. public:
  18. BYTE m_abInverseMap[32768];
  19. protected:
  20. ULONG m_nRefCount;
  21. ULONG m_nColors;
  22. RGBQUAD m_argbColors[256];
  23. ULONG* m_pnDistanceBuffer;
  24. // Vars that were global in the original code
  25. int bcenter, gcenter, rcenter;
  26. long gdist, rdist, cdist;
  27. long cbinc, cginc, crinc;
  28. ULONG* gdp;
  29. ULONG* rdp;
  30. ULONG* cdp;
  31. BYTE* grgbp;
  32. BYTE* rrgbp;
  33. BYTE* crgbp;
  34. int gstride, rstride;
  35. long x, xsqr, colormax;
  36. int cindex;
  37. // Static locals from the original redloop(). Good coding at its finest.
  38. long rxx;
  39. // Static locals from the original greenloop()
  40. int greenloop_here;
  41. int greenloop_min;
  42. int greenloop_max;
  43. int greenloop_prevmin;
  44. int greenloop_prevmax;
  45. long ginc;
  46. long gxx;
  47. long gcdist;
  48. ULONG* gcdp;
  49. BYTE* gcrgbp;
  50. // Static locals from the original blueloop()
  51. int blueloop_here;
  52. int blueloop_min;
  53. int blueloop_max;
  54. int blueloop_prevmin;
  55. int blueloop_prevmax;
  56. long binc;
  57. };