home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK2.toast / Development Kits (Disc 2) / QuickTime / Programming Stuff / QuickTime 2.1 for Developers / Interfaces / CIncludes / ImageCodec.h next >
Encoding:
C/C++ Source or Header  |  1995-08-07  |  8.8 KB  |  288 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        ImageCodec.h
  3.  
  4.      Contains:    QuickTime interfaces
  5.  
  6.      Version:    
  7.  
  8.      DRI:        Jim Batson
  9.  
  10.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  11.                  All rights reserved.
  12.  
  13.      Warning:    *** APPLE INTERNAL USE ONLY ***
  14.                  This file may contain unreleased API's
  15.  
  16.      BuildInfo:    Built by:            QuickTime
  17.                  With Interfacer:    1.1d11  
  18.                  From:                ImageCodec.i
  19.                      Revision:        0
  20.                      Dated:            08/07/95
  21.                      Last change by:    JB
  22.                      Last comment:    This is a fake header used so interfacer is happy.
  23.  
  24.      Bugs:        Report bugs to Radar component “System Interfaces”, “Latest”
  25.                  List the version information (from above) in the Problem Description.
  26.  
  27. */
  28.  
  29. #ifndef __IMAGECODEC__
  30. #define __IMAGECODEC__
  31.  
  32.  
  33. #ifndef __TYPES__
  34. #include <Types.h>
  35. #endif
  36. /*    #include <ConditionalMacros.h>                                */
  37.  
  38. #ifndef __QUICKDRAW__
  39. #include <Quickdraw.h>
  40. #endif
  41. /*    #include <MixedMode.h>                                        */
  42. /*    #include <QuickdrawText.h>                                    */
  43.  
  44. #ifndef __QDOFFSCREEN__
  45. #include <QDOffscreen.h>
  46. #endif
  47. /*    #include <Errors.h>                                            */
  48.  
  49. #ifndef __WINDOWS__
  50. #include <Windows.h>
  51. #endif
  52. /*    #include <Memory.h>                                            */
  53. /*    #include <Events.h>                                            */
  54. /*        #include <OSUtils.h>                                    */
  55. /*    #include <Controls.h>                                        */
  56. /*        #include <Menus.h>                                        */
  57.  
  58. #ifndef __IMAGECOMPRESSION__
  59. #include <ImageCompression.h>
  60. #endif
  61. /*    #include <Components.h>                                        */
  62. /*    #include <StandardFile.h>                                    */
  63. /*        #include <Dialogs.h>                                    */
  64. /*            #include <TextEdit.h>                                */
  65. /*        #include <Files.h>                                        */
  66.  
  67. #ifndef __MOVIES__
  68. #include <Movies.h>
  69. #endif
  70. /*    #include <Aliases.h>                                        */
  71. /*        #include <AppleTalk.h>                                    */
  72.  
  73. #ifdef __cplusplus
  74. extern "C" {
  75. #endif
  76.  
  77. #if GENERATINGPOWERPC
  78. #pragma options align=mac68k
  79. #endif
  80.  
  81. #ifdef __CFM68K__
  82. #pragma import on
  83. #endif
  84.  
  85.  
  86. enum {
  87.     codecGetCodecInfo            = 0x00,
  88.     codecGetCompressionTime        = 0x01,
  89.     codecGetMaxCompressionSize    = 0x02,
  90.     codecPreCompress            = 0x03,
  91.     codecBandCompress            = 0x04,
  92.     codecPreDecompress            = 0x05,
  93.     codecBandDecompress            = 0x06,
  94.     codecCDSequenceBusy            = 0x07,
  95.     codecGetCompressedImageSize    = 0x08,
  96.     codecGetSimilarity            = 0x09,
  97.     codecTrimImage                = 0x0A,
  98.     codecRequestSettings        = 0x0B,
  99.     codecGetSettings            = 0x0C,
  100.     codecSetSettings            = 0x0D,
  101.     codecCDSequenceFlush        = 0x0E,
  102.     codecSetTimeCode            = 0x0F,
  103.     codecIsImageDescriptionEquivalent = 0x10,
  104.     codecNewMemory                = 0x11,
  105.     codecDisposeMemory            = 0x12,
  106.     codecHitTestData            = 0x13
  107. };
  108.  
  109. enum {
  110.     codecCanScale                = 1L << 0,
  111.     codecCanMask                = 1L << 1,
  112.     codecCanMatte                = 1L << 2,
  113.     codecCanTransform            = 1L << 3,
  114.     codecCanTransferMode        = 1L << 4,
  115.     codecCanCopyPrev            = 1L << 5,
  116.     codecCanSpool                = 1L << 6,
  117.     codecCanClipVertical        = 1L << 7,
  118.     codecCanClipRectangular        = 1L << 8,
  119.     codecCanRemapColor            = 1L << 9,
  120.     codecCanFastDither            = 1L << 10,
  121.     codecCanSrcExtract            = 1L << 11,
  122.     codecCanCopyPrevComp        = 1L << 12,
  123.     codecCanAsync                = 1L << 13,
  124.     codecCanMakeMask            = 1L << 14,
  125.     codecCanShift                = 1L << 15,
  126.     codecCanAsyncWhen            = 1L << 16,
  127.     codecCanShieldCursor        = 1L << 17,
  128.     codecCanManagePrevBuffer    = 1L << 18,
  129.     codecHasVolatileBuffer        = 1L << 19,
  130.     codecWantsRegionMask        = 1L << 20
  131. };
  132.  
  133. struct CodecCapabilities {
  134.     long                            flags;
  135.     short                            wantedPixelSize;
  136.     short                            extendWidth;
  137.     short                            extendHeight;
  138.     short                            bandMin;
  139.     short                            bandInc;
  140.     short                            pad;
  141.     unsigned long                    time;
  142. };
  143. typedef struct CodecCapabilities CodecCapabilities;
  144.  
  145.  
  146. enum {
  147.     codecConditionFirstBand        = 1L << 0,
  148.     codecConditionLastBand        = 1L << 1,
  149.     codecConditionFirstFrame    = 1L << 2,
  150.     codecConditionNewDepth        = 1L << 3,
  151.     codecConditionNewTransform    = 1L << 4,
  152.     codecConditionNewSrcRect    = 1L << 5,
  153.     codecConditionNewMask        = 1L << 6,
  154.     codecConditionNewMatte        = 1L << 7,
  155.     codecConditionNewTransferMode = 1L << 8,
  156.     codecConditionNewClut        = 1L << 9,
  157.     codecConditionNewAccuracy    = 1L << 10,
  158.     codecConditionNewDestination = 1L << 11,
  159.     codecConditionFirstScreen    = 1L << 12,
  160.     codecConditionDoCursor        = 1L << 13,
  161.     codecConditionCatchUpDiff    = 1L << 14,
  162.     codecConditionMaskMayBeChanged = 1L << 15,
  163.     codecConditionCodecChangedMask = 1L << 31
  164. };
  165.  
  166. enum {
  167.     codecInfoResourceType        = 'cdci',
  168.     codecInterfaceVersion        = 2
  169. };
  170.  
  171. struct CDSequenceDataSource {
  172.     long                            recordSize;
  173.     void                            *next;
  174.     ImageSequence                    seqID;
  175.     ImageSequenceDataSource            sourceID;
  176.     OSType                            sourceType;
  177.     long                            sourceInputNumber;
  178.     void                            *dataPtr;
  179.     Handle                            dataDescription;
  180.     long                            changeSeed;
  181.     ProcPtr                            transferProc;
  182.     void                            *refCon;
  183. };
  184. typedef struct CDSequenceDataSource CDSequenceDataSource, *CDSequenceDataSourcePtr;
  185.  
  186. struct CodecCompressParams {
  187.     ImageSequence                    sequenceID;
  188.     ImageDescriptionHandle            imageDescription;
  189.     Ptr                                data;
  190.     long                            bufferSize;
  191.     long                            frameNumber;
  192.     long                            startLine;
  193.     long                            stopLine;
  194.     long                            conditionFlags;
  195.     CodecFlags                        callerFlags;
  196.     CodecCapabilities                *capabilities;
  197.     ICMProgressProcRecord            progressProcRecord;
  198.     ICMCompletionProcRecord            completionProcRecord;
  199.     ICMFlushProcRecord                flushProcRecord;
  200.     PixMap                            srcPixMap;
  201.     PixMap                            prevPixMap;
  202.     CodecQ                            spatialQuality;
  203.     CodecQ                            temporalQuality;
  204.     Fixed                            similarity;
  205.     DataRateParamsPtr                dataRateParams;
  206.     long                            reserved;
  207.     UInt16                            majorSourceChangeSeed;
  208.     UInt16                            minorSourceChangeSeed;
  209.     CDSequenceDataSourcePtr            sourceData;
  210. };
  211. typedef struct CodecCompressParams CodecCompressParams;
  212.  
  213. struct CodecDecompressParams {
  214.     ImageSequence                    sequenceID;
  215.     ImageDescriptionHandle            imageDescription;
  216.     Ptr                                data;
  217.     long                            bufferSize;
  218.     long                            frameNumber;
  219.     long                            startLine;
  220.     long                            stopLine;
  221.     long                            conditionFlags;
  222.     CodecFlags                        callerFlags;
  223.     CodecCapabilities                *capabilities;
  224.     ICMProgressProcRecord            progressProcRecord;
  225.     ICMCompletionProcRecord            completionProcRecord;
  226.     ICMDataProcRecord                dataProcRecord;
  227.     CGrafPtr                        port;
  228.     PixMap                            dstPixMap;
  229.     BitMapPtr                        maskBits;
  230.     PixMapPtr                        mattePixMap;
  231.     Rect                            srcRect;
  232.     MatrixRecord                    *matrix;
  233.     CodecQ                            accuracy;
  234.     short                            transferMode;
  235.     ICMFrameTimePtr                    frameTime;
  236.     long                            reserved[1];
  237.     SInt8                            matrixFlags;
  238.     SInt8                            matrixType;
  239.     Rect                            dstRect;
  240.     UInt16                            majorSourceChangeSeed;
  241.     UInt16                            minorSourceChangeSeed;
  242.     CDSequenceDataSourcePtr            sourceData;
  243.     RgnHandle                        maskRegion;
  244. };
  245. typedef struct CodecDecompressParams CodecDecompressParams;
  246.  
  247.  
  248. enum {
  249.     matrixFlagScale2x            = 1L << 7,
  250.     matrixFlagScale1x            = 1L << 6,
  251.     matrixFlagScaleHalf            = 1L << 5
  252. };
  253.  
  254. extern pascal ComponentResult CDGetCodecInfo(Handle storage, CodecInfo *info);
  255. extern pascal ComponentResult CDGetCompressionTime(Handle storage, PixMapHandle src, const Rect *srcRect, short depth, CodecQ *spatialQuality, CodecQ *temporalQuality, unsigned long *time);
  256. extern pascal ComponentResult CDGetMaxCompressionSize(Handle storage, PixMapHandle src, const Rect *srcRect, short depth, CodecQ quality, long *size);
  257. extern pascal ComponentResult CDPreCompress(Handle storage, CodecCompressParams *params);
  258. extern pascal ComponentResult CDBandCompress(Handle storage, CodecCompressParams *params);
  259. extern pascal ComponentResult CDPreDecompress(Handle storage, CodecDecompressParams *params);
  260. extern pascal ComponentResult CDBandDecompress(Handle storage, CodecDecompressParams *params);
  261. extern pascal ComponentResult CDCodecBusy(Handle storage, ImageSequence seq);
  262. extern pascal ComponentResult CDGetCompressedImageSize(Handle storage, ImageDescriptionHandle desc, Ptr data, long bufferSize, ICMDataProcRecordPtr dataProc, long *dataSize);
  263. extern pascal ComponentResult CDGetSimilarity(Handle storage, PixMapHandle src, const Rect *srcRect, ImageDescriptionHandle desc, Ptr data, Fixed *similarity);
  264. extern pascal ComponentResult CDTrimImage(Handle storage, ImageDescriptionHandle Desc, Ptr inData, long inBufferSize, ICMDataProcRecordPtr dataProc, Ptr outData, long outBufferSize, ICMFlushProcRecordPtr flushProc, Rect *trimRect, ICMProgressProcRecordPtr progressProc);
  265. extern pascal ComponentResult CDRequestSettings(Handle storage, Handle settings, Rect *rp, ModalFilterUPP filterProc);
  266. extern pascal ComponentResult CDGetSettings(Handle storage, Handle settings);
  267. extern pascal ComponentResult CDSetSettings(Handle storage, Handle settings);
  268. extern pascal ComponentResult CDCodecFlush(Handle storage);
  269. extern pascal ComponentResult CDCodecSetTimeCode(Handle storage, void *timeCodeFormat, void *timeCodeTime);
  270. extern pascal ComponentResult CDCodecIsImageDescriptionEquivalent(Handle storage, ImageDescriptionHandle newDesc, Boolean *equivalent);
  271. extern pascal ComponentResult CDCodecNewMemory(Handle storage, Ptr *data, Size dataSize, long dataUse, ICMMemoryDisposedUPP memoryGoneProc, void *refCon);
  272. extern pascal ComponentResult CDCodecDisposeMemory(Handle storage, Ptr data);
  273. extern pascal ComponentResult CDCodecHitTestData(Handle storage, ImageDescriptionHandle desc, void *data, Size dataSize, Point where, Boolean *hit);
  274.  
  275. #ifdef __CFM68K__
  276. #pragma import off
  277. #endif
  278.  
  279. #if GENERATINGPOWERPC
  280. #pragma options align=reset
  281. #endif
  282.  
  283. #ifdef __cplusplus
  284. }
  285. #endif
  286.  
  287. #endif /* __IMAGECODEC__ */
  288.