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.

107 lines
3.0 KiB

  1. /*******************************************************************************
  2. *
  3. * (C) COPYRIGHT MICROSOFT CORPORATION, 1998
  4. *
  5. * TITLE: CONTRAST.H
  6. *
  7. * VERSION: 1.0
  8. *
  9. * AUTHOR: ShaunIv
  10. *
  11. * DATE: 1/11/2001
  12. *
  13. * DESCRIPTION: Small preview window for illustrating brightness and contrast settings
  14. *
  15. *******************************************************************************/
  16. #ifndef __CONTRAST_H_INCLUDED
  17. #define __CONTRAST_H_INCLUDED
  18. #include <windows.h>
  19. #include <gphelper.h>
  20. #define BCPWM_COLOR 0
  21. #define BCPWM_GRAYSCALE 1
  22. #define BCPWM_BW 2
  23. #define NUMPREVIEWIMAGES 3
  24. #define BCPWM_SETBRIGHTNESS (WM_USER+3141) // wParam=0, lParam=(int)brightness
  25. #define BCPWM_SETCONTRAST (WM_USER+3142) // wParam=0, lParam=(int)contrast
  26. #define BCPWM_SETINTENT (WM_USER+3143) // wParam=0, lParam=(int)intent
  27. #define BCPWM_LOADIMAGE (WM_USER+3144) // wParam = {BCPWM_COLOR, BCPWM_GRAYSCALE,BCPWM_BW}, wparam=(HBITMAP)previewBitmap
  28. #define BRIGHTNESS_CONTRAST_PREVIEW_WINDOW_CLASSW L"WiaBrightnessContrastPreviewWindow"
  29. #define BRIGHTNESS_CONTRAST_PREVIEW_WINDOW_CLASSA "WiaBrightnessContrastPreviewWindow"
  30. #define SHADOW_WIDTH 6
  31. #if defined(UNICODE) || defined(_UNICODE)
  32. #define BRIGHTNESS_CONTRAST_PREVIEW_WINDOW_CLASS BRIGHTNESS_CONTRAST_PREVIEW_WINDOW_CLASSW
  33. #else
  34. #define BRIGHTNESS_CONTRAST_PREVIEW_WINDOW_CLASS BRIGHTNESS_CONTRAST_PREVIEW_WINDOW_CLASSA
  35. #endif
  36. //
  37. // Brightness Contrast Preview Control
  38. //
  39. class CBrightnessContrast
  40. {
  41. protected:
  42. HWND m_hWnd;
  43. BYTE m_nBrightness;
  44. BYTE m_nContrast;
  45. LONG m_nIntent;
  46. HBITMAP m_hBmpPreviewImage;
  47. HBITMAP m_PreviewBitmaps[NUMPREVIEWIMAGES];
  48. #ifndef DONT_USE_GDIPLUS
  49. CGdiPlusHelper m_GdiPlusHelper;
  50. #endif
  51. private:
  52. explicit CBrightnessContrast( HWND hWnd );
  53. virtual ~CBrightnessContrast(void);
  54. int SetPreviewImage(LONG _fileName);
  55. static LRESULT CALLBACK WndProc( HWND, UINT, WPARAM, LPARAM );
  56. private:
  57. CBrightnessContrast(void);
  58. CBrightnessContrast( const CBrightnessContrast & );
  59. CBrightnessContrast &operator=( const CBrightnessContrast & );
  60. private:
  61. LRESULT ApplySettings();
  62. LRESULT SetContrast(int contrast);
  63. LRESULT SetBrightness(int brightness);
  64. LRESULT SetIntent( LONG intent);
  65. LRESULT KillBitmaps();
  66. protected:
  67. //
  68. // Standard windows messages
  69. //
  70. LRESULT OnPaint( WPARAM, LPARAM );
  71. LRESULT OnCreate( WPARAM, LPARAM );
  72. LRESULT OnEnable( WPARAM, LPARAM );
  73. //
  74. // The parent window needs to pass us bitmap handles
  75. //
  76. LRESULT OnLoadBitmap(WPARAM wParam, LPARAM lParam);
  77. //
  78. // Message interface functions
  79. //
  80. LRESULT OnSetBrightness( WPARAM wParam, LPARAM lParam);
  81. LRESULT OnSetContrast( WPARAM wParam, LPARAM lParam);
  82. LRESULT OnSetIntent( WPARAM wParam, LPARAM lParam);
  83. public:
  84. static BOOL RegisterClass( HINSTANCE hInstance );
  85. };
  86. #endif //__CONTRAST_H_INCLUDED