home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / graphics / icm20 / icmview / dibinfo.h < prev    next >
Text File  |  1997-09-07  |  4KB  |  102 lines

  1. //THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  2. //ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  3. //THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  4. // PARTICULAR PURPOSE.
  5. //
  6. // Copyright  1994-1997  Microsoft Corporation.  All Rights Reserved.
  7. //
  8. //  FILE:
  9. //    DIBINFO.H
  10. //
  11. //  PURPOSE:
  12. //
  13. //
  14. //  PLATFORMS:
  15. //    Windows 95, Windows NT,
  16. //
  17. //  SPECIAL INSTRUCTIONS: N/A
  18. //
  19.  
  20. // General pre-processor macros
  21.  
  22. // Default stretch mode
  23. #define ICMV_STRETCH_DEFAULT                STRETCH_DELETESCANS
  24.  
  25. // LCS Intent default
  26. #define ICMV_LCSINTENT_DEFAULT              LCS_GM_IMAGES
  27.  
  28. // ICM rendering intents
  29. #define ICMV_RENDER_INTENT_DEFAULT      INTENT_PERCEPTUAL
  30. #define ICMV_PROOFING_INTENT_DEFAULT    INTENT_ABSOLUTE_COLORIMETRIC
  31.  
  32. // Flags for use in the dwPrintOption member of DIBINFO
  33. #define ICMV_PRINT_ACTUALSIZE               0x00000001
  34. #define ICMV_PRINT_BESTFIT                  0x00000002
  35. #define ICMV_PRINT_DEFAULTSIZE              ICMV_PRINT_ACTUALSIZE
  36.  
  37. // Flags for use in the dwICMFlags field of the ICMINFO structure
  38. #define ICMVFLAGS_ENABLE_ICM                0x00000001
  39. #define ICMVFLAGS_PROOFING                  0x00000002
  40. #define ICMVFLAGS_ICM20                     0x00000004
  41. #define ICMVFLAGS_CREATE_TRANSFORM          0x00000008
  42. #define ICMVFLAGS_DEFAULT_ICMFLAGS          (ICMVFLAGS_ICM20 | ICMVFLAGS_ENABLE_ICM)
  43.  
  44. // General STRUCTS && TYPEDEFS
  45. typedef struct
  46. {
  47.     // Handle to window which owns this structure
  48.     HWND          hWndOwner;
  49.  
  50.     // Handles to access information
  51.     LPTSTR        lpszImageFileName;    // Name of image to open/display
  52.     HGLOBAL       hDIB;                 // Handle to the DIB spec
  53.     HGLOBAL       hDIBTransformed;      // Handle to the DDB or DIBSection.
  54.     HPALETTE      hPal;
  55.  
  56.     // Image attributes
  57.     DWORD         dwDIBBits;            // Bits per pixel
  58.     UINT          uiDIBWidth;           // Print width of the DIB
  59.     UINT          uiDIBHeight;          // Print height of the DIB
  60.     BMFORMAT      bmFormat;             // Bitmap format used by TranslateBitmapBits
  61.  
  62.     // Display options
  63.     RECT          rcClip;               // Clipboard cut rectangle.
  64.     DWORD         dwStretchBltMode;     // Mode to use for StretchBlt calls
  65.                                         // when painting.
  66.     BOOL          bStretch;             // True = stretch to window
  67.  
  68.     // Printing options
  69.     DWORD         dwPrintOption;        // See defines below
  70.     DWORD         dwXScale;             // X Scale Edit control value
  71.     DWORD         dwYScale;             // Y Scale Edit control value
  72.     PDEVMODE      pDevMode;
  73.  
  74.     // ICM Control structure
  75.     HCOLORSPACE   hLCS;
  76.     LPTSTR        lpszMonitorName;
  77.     LPTSTR        lpszMonitorProfile;
  78.     LPTSTR        lpszPrinterName;
  79.     LPTSTR        lpszPrinterProfile;
  80.     LPTSTR        lpszTargetProfile;
  81.     DWORD         dwICMFlags;
  82.     DWORD         dwRenderIntent;
  83.     DWORD         dwProofingIntent;
  84. } DIBINFO, FAR *LPDIBINFO;
  85.  
  86. // Function prototypes
  87. HGLOBAL   CreateDIBInfo(void);
  88. BOOL      GetDefaultICMInfo(void);
  89. LPDIBINFO GetDIBInfoPtr(HWND hWnd);
  90. HGLOBAL   GetDIBInfoHandle (HWND hWnd);
  91.  
  92.  
  93. BOOL      fFreeDIBInfo(HGLOBAL hDIBInfo, BOOL bFreeDIBHandles);LPTSTR    GetDefaultICMProfile(HDC hDC);
  94. LPDIBINFO fDuplicateDIBInfo(LPDIBINFO lpDISource, LPDIBINFO lpDITarget);
  95. BOOL      fDuplicateICMInfo(LPDIBINFO lpDIDest, LPDIBINFO lpDISrc);
  96. BOOL      InitDIBInfo(LPDIBINFO lpDIBINFO);
  97. void      CopyDIBInfo(LPDIBINFO lpDITarget, LPDIBINFO lpDISource);
  98. BOOL      fReadDIBInfo(LPTSTR lpszFileName, LPDIBINFO lpDIBInfo);
  99. HANDLE    GetDIBHandleFromDIBInfo(HANDLE hDIBInfo);
  100. void      DumpDIBINFO(LPTSTR lpszMsg, LPDIBINFO lpDIBInfo);
  101.  
  102. BOOL SetupDC(HDC hDC, LPDIBINFO lpDIBInfo, HPALETTE *phOldPalette, HDC *phDCPrinter);