Palettes.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:11k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       Palettes.h
  3.  
  4.      Contains:   Palette Manager Interfaces.
  5.  
  6.      Version:    Technology: Mac OS 8
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1987-2001 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:      For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __PALETTES__
  18. #define __PALETTES__
  19. #ifndef __QUICKDRAW__
  20. #include "Quickdraw.h"
  21. #endif
  22. #if PRAGMA_ONCE
  23. #pragma once
  24. #endif
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. #if PRAGMA_IMPORT
  29. #pragma import on
  30. #endif
  31. #if PRAGMA_STRUCT_ALIGN
  32.     #pragma options align=mac68k
  33. #elif PRAGMA_STRUCT_PACKPUSH
  34.     #pragma pack(push, 2)
  35. #elif PRAGMA_STRUCT_PACK
  36.     #pragma pack(2)
  37. #endif
  38. enum {
  39.     pmCourteous                 = 0,                            /*Record use of color on each device touched.*/
  40.     pmDithered                  = 0x0001,
  41.     pmTolerant                  = 0x0002,                       /*render ciRGB if ciTolerance is exceeded by best match.*/
  42.     pmAnimated                  = 0x0004,                       /*reserve an index on each device touched and render ciRGB.*/
  43.     pmExplicit                  = 0x0008,                       /*no reserve, no render, no record; stuff index into port.*/
  44.     pmWhite                     = 0x0010,
  45.     pmBlack                     = 0x0020,
  46.     pmInhibitG2                 = 0x0100,
  47.     pmInhibitC2                 = 0x0200,
  48.     pmInhibitG4                 = 0x0400,
  49.     pmInhibitC4                 = 0x0800,
  50.     pmInhibitG8                 = 0x1000,
  51.     pmInhibitC8                 = 0x2000,                       /* NSetPalette Update Constants */
  52.     pmNoUpdates                 = 0x8000,                       /*no updates*/
  53.     pmBkUpdates                 = 0xA000,                       /*background updates only*/
  54.     pmFgUpdates                 = 0xC000,                       /*foreground updates only*/
  55.     pmAllUpdates                = 0xE000                        /*all updates*/
  56. };
  57. struct ColorInfo {
  58.     RGBColor                        ciRGB;                      /*true RGB values*/
  59.     short                           ciUsage;                    /*color usage*/
  60.     short                           ciTolerance;                /*tolerance value*/
  61.     short                           ciDataFields[3];            /*private fields*/
  62. };
  63. typedef struct ColorInfo                ColorInfo;
  64. typedef ColorInfo *                     ColorInfoPtr;
  65. typedef ColorInfoPtr *                  ColorInfoHandle;
  66. struct Palette {
  67.     short                           pmEntries;                  /*entries in pmTable*/
  68.     short                           pmDataFields[7];            /*private fields*/
  69.     ColorInfo                       pmInfo[1];
  70. };
  71. typedef struct Palette                  Palette;
  72. typedef Palette *                       PalettePtr;
  73. typedef PalettePtr *                    PaletteHandle;
  74. EXTERN_API( void )
  75. InitPalettes                    (void)                                                      ONEWORDINLINE(0xAA90);
  76. EXTERN_API( PaletteHandle )
  77. NewPalette                      (short                  entries,
  78.                                  CTabHandle             srcColors,
  79.                                  short                  srcUsage,
  80.                                  short                  srcTolerance)                       ONEWORDINLINE(0xAA91);
  81. EXTERN_API( PaletteHandle )
  82. GetNewPalette                   (short                  PaletteID)                          ONEWORDINLINE(0xAA92);
  83. EXTERN_API( void )
  84. DisposePalette                  (PaletteHandle          srcPalette)                         ONEWORDINLINE(0xAA93);
  85. EXTERN_API( void )
  86. ActivatePalette                 (WindowPtr              srcWindow)                          ONEWORDINLINE(0xAA94);
  87. EXTERN_API( void )
  88. SetPalette                      (WindowPtr              dstWindow,
  89.                                  PaletteHandle          srcPalette,
  90.                                  Boolean                cUpdates)                           ONEWORDINLINE(0xAA95);
  91. EXTERN_API( void )
  92. NSetPalette                     (WindowPtr              dstWindow,
  93.                                  PaletteHandle          srcPalette,
  94.                                  short                  nCUpdates)                          ONEWORDINLINE(0xAA95);
  95. EXTERN_API( PaletteHandle )
  96. GetPalette                      (WindowPtr              srcWindow)                          ONEWORDINLINE(0xAA96);
  97. EXTERN_API( void )
  98. CopyPalette                     (PaletteHandle          srcPalette,
  99.                                  PaletteHandle          dstPalette,
  100.                                  short                  srcEntry,
  101.                                  short                  dstEntry,
  102.                                  short                  dstLength)                          ONEWORDINLINE(0xAAA1);
  103. EXTERN_API( void )
  104. PmForeColor                     (short                  dstEntry)                           ONEWORDINLINE(0xAA97);
  105. EXTERN_API( void )
  106. PmBackColor                     (short                  dstEntry)                           ONEWORDINLINE(0xAA98);
  107. EXTERN_API( void )
  108. AnimateEntry                    (WindowPtr              dstWindow,
  109.                                  short                  dstEntry,
  110.                                  const RGBColor *       srcRGB)                             ONEWORDINLINE(0xAA99);
  111. #if TARGET_OS_MAC
  112.     #define MacAnimatePalette AnimatePalette
  113. #endif
  114. EXTERN_API( void )
  115. MacAnimatePalette               (WindowPtr              dstWindow,
  116.                                  CTabHandle             srcCTab,
  117.                                  short                  srcIndex,
  118.                                  short                  dstEntry,
  119.                                  short                  dstLength)                          ONEWORDINLINE(0xAA9A);
  120. EXTERN_API( void )
  121. GetEntryColor                   (PaletteHandle          srcPalette,
  122.                                  short                  srcEntry,
  123.                                  RGBColor *             dstRGB)                             ONEWORDINLINE(0xAA9B);
  124. EXTERN_API( void )
  125. SetEntryColor                   (PaletteHandle          dstPalette,
  126.                                  short                  dstEntry,
  127.                                  const RGBColor *       srcRGB)                             ONEWORDINLINE(0xAA9C);
  128. EXTERN_API( void )
  129. GetEntryUsage                   (PaletteHandle          srcPalette,
  130.                                  short                  srcEntry,
  131.                                  short *                dstUsage,
  132.                                  short *                dstTolerance)                       ONEWORDINLINE(0xAA9D);
  133. EXTERN_API( void )
  134. SetEntryUsage                   (PaletteHandle          dstPalette,
  135.                                  short                  dstEntry,
  136.                                  short                  srcUsage,
  137.                                  short                  srcTolerance)                       ONEWORDINLINE(0xAA9E);
  138. EXTERN_API( void )
  139. CTab2Palette                    (CTabHandle             srcCTab,
  140.                                  PaletteHandle          dstPalette,
  141.                                  short                  srcUsage,
  142.                                  short                  srcTolerance)                       ONEWORDINLINE(0xAA9F);
  143. EXTERN_API( void )
  144. Palette2CTab                    (PaletteHandle          srcPalette,
  145.                                  CTabHandle             dstCTab)                            ONEWORDINLINE(0xAAA0);
  146. EXTERN_API( long )
  147. Entry2Index                     (short                  entry)                              TWOWORDINLINE(0x7000, 0xAAA2);
  148. EXTERN_API( void )
  149. RestoreDeviceClut               (GDHandle               gd)                                 TWOWORDINLINE(0x7002, 0xAAA2);
  150. #if TARGET_OS_MAC
  151.     #define MacResizePalette ResizePalette
  152. #endif
  153. EXTERN_API( void )
  154. MacResizePalette                (PaletteHandle          p,
  155.                                  short                  size)                               TWOWORDINLINE(0x7003, 0xAAA2);
  156. EXTERN_API( void )
  157. SaveFore                        (ColorSpec *            c)                                  THREEWORDINLINE(0x303C, 0x040D, 0xAAA2);
  158. EXTERN_API( void )
  159. SaveBack                        (ColorSpec *            c)                                  THREEWORDINLINE(0x303C, 0x040E, 0xAAA2);
  160. EXTERN_API( void )
  161. RestoreFore                     (const ColorSpec *      c)                                  THREEWORDINLINE(0x303C, 0x040F, 0xAAA2);
  162. EXTERN_API( void )
  163. RestoreBack                     (const ColorSpec *      c)                                  THREEWORDINLINE(0x303C, 0x0410, 0xAAA2);
  164. EXTERN_API( OSErr )
  165. SetDepth                        (GDHandle               gd,
  166.                                  short                  depth,
  167.                                  short                  whichFlags,
  168.                                  short                  flags)                              THREEWORDINLINE(0x303C, 0x0A13, 0xAAA2);
  169. EXTERN_API( short )
  170. HasDepth                        (GDHandle               gd,
  171.                                  short                  depth,
  172.                                  short                  whichFlags,
  173.                                  short                  flags)                              THREEWORDINLINE(0x303C, 0x0A14, 0xAAA2);
  174. EXTERN_API( short )
  175. PMgrVersion                     (void)                                                      TWOWORDINLINE(0x7015, 0xAAA2);
  176. EXTERN_API( void )
  177. SetPaletteUpdates               (PaletteHandle          p,
  178.                                  short                  updates)                            THREEWORDINLINE(0x303C, 0x0616, 0xAAA2);
  179. EXTERN_API( short )
  180. GetPaletteUpdates               (PaletteHandle          p)                                  THREEWORDINLINE(0x303C, 0x0417, 0xAAA2);
  181. EXTERN_API( Boolean )
  182. GetGray                         (GDHandle               device,
  183.                                  const RGBColor *       backGround,
  184.                                  RGBColor *             foreGround)                         THREEWORDINLINE(0x303C, 0x0C19, 0xAAA2);
  185. #if PRAGMA_STRUCT_ALIGN
  186.     #pragma options align=reset
  187. #elif PRAGMA_STRUCT_PACKPUSH
  188.     #pragma pack(pop)
  189. #elif PRAGMA_STRUCT_PACK
  190.     #pragma pack()
  191. #endif
  192. #ifdef PRAGMA_IMPORT_OFF
  193. #pragma import off
  194. #elif PRAGMA_IMPORT
  195. #pragma import reset
  196. #endif
  197. #ifdef __cplusplus
  198. }
  199. #endif
  200. #endif /* __PALETTES__ */