home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / CodeWarrior Lite / Metrowerks C⁄C++ Lite / Headers / Universal Headers 2.0.1f / ImageCodec.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-22  |  7.3 KB  |  248 lines  |  [TEXT/MMCC]

  1. /*
  2.      File:        ImageCodec.h
  3.  
  4.      Contains:    QuickTime Interfaces.
  5.  
  6.      Version:    Technology:    QuickTime 2.0
  7.                  Package:    Universal Interfaces 2.0 in “MPW Latest” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __IMAGECODEC__
  21. #define __IMAGECODEC__
  22.  
  23.  
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifndef __QUICKDRAW__
  30. #include <Quickdraw.h>
  31. #endif
  32. /*    #include <MixedMode.h>                                        */
  33. /*    #include <QuickdrawText.h>                                    */
  34.  
  35. #ifndef __QDOFFSCREEN__
  36. #include <QDOffscreen.h>
  37. #endif
  38. /*    #include <Errors.h>                                            */
  39.  
  40. #ifndef __WINDOWS__
  41. #include <Windows.h>
  42. #endif
  43. /*    #include <Memory.h>                                            */
  44. /*    #include <Events.h>                                            */
  45. /*        #include <OSUtils.h>                                    */
  46. /*    #include <Controls.h>                                        */
  47. /*        #include <Menus.h>                                        */
  48.  
  49. #ifndef __IMAGECOMPRESSION__
  50. #include <ImageCompression.h>
  51. #endif
  52. /*    #include <Components.h>                                        */
  53. /*    #include <StandardFile.h>                                    */
  54. /*        #include <Dialogs.h>                                    */
  55. /*            #include <TextEdit.h>                                */
  56. /*        #include <Files.h>                                        */
  57.  
  58. #ifndef __COMPONENTS__
  59. #include <Components.h>
  60. #endif
  61.  
  62. #ifndef __MOVIES__
  63. #include <Movies.h>
  64. #endif
  65. /*    #include <Aliases.h>                                        */
  66. /*        #include <AppleTalk.h>                                    */
  67.  
  68. #ifdef __cplusplus
  69. extern "C" {
  70. #endif
  71.  
  72. #if PRAGMA_ALIGN_SUPPORTED
  73. #pragma options align=mac68k
  74. #endif
  75.  
  76. #if PRAGMA_IMPORT_SUPPORTED
  77. #pragma import on
  78. #endif
  79.  
  80.  
  81. enum {
  82.     codecGetCodecInfo            = 0x00,
  83.     codecGetCompressionTime        = 0x01,
  84.     codecGetMaxCompressionSize    = 0x02,
  85.     codecPreCompress            = 0x03,
  86.     codecBandCompress            = 0x04,
  87.     codecPreDecompress            = 0x05,
  88.     codecBandDecompress            = 0x06,
  89.     codecCDSequenceBusy            = 0x07,
  90.     codecGetCompressedImageSize    = 0x08,
  91.     codecGetSimilarity            = 0x09,
  92.     codecTrimImage                = 0x0A,
  93.     codecRequestSettings        = 0x0B,
  94.     codecGetSettings            = 0x0C,
  95.     codecSetSettings            = 0x0D,
  96.     codecCDSequenceFlush        = 0x0E,
  97.     codecSetTimeCode            = 0x0F
  98. };
  99.  
  100. enum {
  101.     codecCanScale                = 1L << 0,
  102.     codecCanMask                = 1L << 1,
  103.     codecCanMatte                = 1L << 2,
  104.     codecCanTransform            = 1L << 3,
  105.     codecCanTransferMode        = 1L << 4,
  106.     codecCanCopyPrev            = 1L << 5,
  107.     codecCanSpool                = 1L << 6,
  108.     codecCanClipVertical        = 1L << 7,
  109.     codecCanClipRectangular        = 1L << 8,
  110.     codecCanRemapColor            = 1L << 9,
  111.     codecCanFastDither            = 1L << 10,
  112.     codecCanSrcExtract            = 1L << 11,
  113.     codecCanCopyPrevComp        = 1L << 12,
  114.     codecCanAsync                = 1L << 13,
  115.     codecCanMakeMask            = 1L << 14,
  116.     codecCanShift                = 1L << 15,
  117.     codecCanAsyncWhen            = 1L << 16,
  118.     codecCanShieldCursor        = 1L << 17,
  119.     codecCanManagePrevBuffer    = 1L << 18
  120. };
  121.  
  122. struct CodecCapabilities {
  123.     long                            flags;
  124.     short                            wantedPixelSize;
  125.     short                            extendWidth;
  126.     short                            extendHeight;
  127.     short                            bandMin;
  128.     short                            bandInc;
  129.     short                            pad;
  130.     unsigned long                    time;
  131. };
  132. typedef struct CodecCapabilities CodecCapabilities;
  133.  
  134.  
  135. enum {
  136.     codecConditionFirstBand        = 1L << 0,
  137.     codecConditionLastBand        = 1L << 1,
  138.     codecConditionFirstFrame    = 1L << 2,
  139.     codecConditionNewDepth        = 1L << 3,
  140.     codecConditionNewTransform    = 1L << 4,
  141.     codecConditionNewSrcRect    = 1L << 5,
  142.     codecConditionNewMask        = 1L << 6,
  143.     codecConditionNewMatte        = 1L << 7,
  144.     codecConditionNewTransferMode = 1L << 8,
  145.     codecConditionNewClut        = 1L << 9,
  146.     codecConditionNewAccuracy    = 1L << 10,
  147.     codecConditionNewDestination = 1L << 11,
  148.     codecConditionFirstScreen    = 1L << 12,
  149.     codecConditionDoCursor        = 1L << 13,
  150.     codecConditionCatchUpDiff    = 1L << 14,
  151.     codecConditionCodecChangedMask = 1L << 31
  152. };
  153.  
  154. enum {
  155.     codecInfoResourceType        = 'cdci',
  156.     codecInterfaceVersion        = 2
  157. };
  158.  
  159. struct CodecCompressParams {
  160.     ImageSequence                    sequenceID;
  161.     ImageDescriptionHandle            imageDescription;
  162.     Ptr                                data;
  163.     long                            bufferSize;
  164.     long                            frameNumber;
  165.     long                            startLine;
  166.     long                            stopLine;
  167.     long                            conditionFlags;
  168.     CodecFlags                        callerFlags;
  169.     CodecCapabilities                *capabilities;
  170.     ICMProgressProcRecord            progressProcRecord;
  171.     ICMCompletionProcRecord            completionProcRecord;
  172.     ICMFlushProcRecord                flushProcRecord;
  173.     PixMap                            srcPixMap;
  174.     PixMap                            prevPixMap;
  175.     CodecQ                            spatialQuality;
  176.     CodecQ                            temporalQuality;
  177.     Fixed                            similarity;
  178.     DataRateParamsPtr                dataRateParams;
  179.     long                            reserved;
  180. };
  181. typedef struct CodecCompressParams CodecCompressParams;
  182.  
  183. struct CodecDecompressParams {
  184.     ImageSequence                    sequenceID;
  185.     ImageDescriptionHandle            imageDescription;
  186.     Ptr                                data;
  187.     long                            bufferSize;
  188.     long                            frameNumber;
  189.     long                            startLine;
  190.     long                            stopLine;
  191.     long                            conditionFlags;
  192.     CodecFlags                        callerFlags;
  193.     CodecCapabilities                *capabilities;
  194.     ICMProgressProcRecord            progressProcRecord;
  195.     ICMCompletionProcRecord            completionProcRecord;
  196.     ICMDataProcRecord                dataProcRecord;
  197.     CGrafPtr                        port;
  198.     PixMap                            dstPixMap;
  199.     BitMapPtr                        maskBits;
  200.     PixMapPtr                        mattePixMap;
  201.     Rect                            srcRect;
  202.     MatrixRecord                    *matrix;
  203.     CodecQ                            accuracy;
  204.     short                            transferMode;
  205.     ICMFrameTimePtr                    frameTime;
  206.     long                            reserved[1];
  207.     SInt8                            matrixFlags;
  208.     SInt8                            matrixType;
  209.     Rect                            dstRect;
  210. };
  211. typedef struct CodecDecompressParams CodecDecompressParams;
  212.  
  213.  
  214. enum {
  215.     matrixFlagScale2x            = 1L << 7
  216. };
  217.  
  218. extern pascal ComponentResult CDGetCodecInfo(Handle storage, CodecInfo *info);
  219. extern pascal ComponentResult CDGetCompressionTime(Handle storage, PixMapHandle src, const Rect *srcRect, short depth, CodecQ *spatialQuality, CodecQ *temporalQuality, unsigned long *time);
  220. extern pascal ComponentResult CDGetMaxCompressionSize(Handle storage, PixMapHandle src, const Rect *srcRect, short depth, CodecQ quality, long *size);
  221. extern pascal ComponentResult CDPreCompress(Handle storage, CodecCompressParams *params);
  222. extern pascal ComponentResult CDBandCompress(Handle storage, CodecCompressParams *params);
  223. extern pascal ComponentResult CDPreDecompress(Handle storage, CodecDecompressParams *params);
  224. extern pascal ComponentResult CDBandDecompress(Handle storage, CodecDecompressParams *params);
  225. extern pascal ComponentResult CDCodecBusy(Handle storage, ImageSequence seq);
  226. extern pascal ComponentResult CDGetCompressedImageSize(Handle storage, ImageDescriptionHandle desc, Ptr data, long bufferSize, ICMDataProcRecordPtr dataProc, long *dataSize);
  227. extern pascal ComponentResult CDGetSimilarity(Handle storage, PixMapHandle src, const Rect *srcRect, ImageDescriptionHandle desc, Ptr data, Fixed *similarity);
  228. extern pascal ComponentResult CDTrimImage(Handle storage, ImageDescriptionHandle Desc, Ptr inData, long inBufferSize, ICMDataProcRecordPtr dataProc, Ptr outData, long outBufferSize, ICMFlushProcRecordPtr flushProc, Rect *trimRect, ICMProgressProcRecordPtr progressProc);
  229. extern pascal ComponentResult CDRequestSettings(Handle storage, Handle settings, Rect *rp, ModalFilterUPP filterProc);
  230. extern pascal ComponentResult CDGetSettings(Handle storage, Handle settings);
  231. extern pascal ComponentResult CDSetSettings(Handle storage, Handle settings);
  232. extern pascal ComponentResult CDCodecFlush(Handle storage);
  233. extern pascal ComponentResult CDCodecSetTimeCode(Handle storage, void *timeCodeFormat, void *timeCodeTime);
  234.  
  235. #if PRAGMA_IMPORT_SUPPORTED
  236. #pragma import off
  237. #endif
  238.  
  239. #if PRAGMA_ALIGN_SUPPORTED
  240. #pragma options align=reset
  241. #endif
  242.  
  243. #ifdef __cplusplus
  244. }
  245. #endif
  246.  
  247. #endif /* __IMAGECODEC__ */
  248.