home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / QuickTime / Programming Stuff / QuickTime 2.1 for Developers / Interfaces / PInterfaces / ImageCodec.p next >
Encoding:
Text File  |  1995-08-07  |  8.8 KB  |  285 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        ImageCodec.p
  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. {$IFC UNDEFINED UsingIncludes}
  30. {$SETC UsingIncludes := 0}
  31. {$ENDC}
  32.  
  33. {$IFC NOT UsingIncludes}
  34.  UNIT ImageCodec;
  35.  INTERFACE
  36. {$ENDC}
  37.  
  38. {$IFC UNDEFINED __IMAGECODEC__}
  39. {$SETC __IMAGECODEC__ := 1}
  40.  
  41. {$I+}
  42. {$SETC ImageCodecIncludes := UsingIncludes}
  43. {$SETC UsingIncludes := 1}
  44.  
  45.  
  46. {$IFC UNDEFINED __TYPES__}
  47. {$I Types.p}
  48. {$ENDC}
  49. {    ConditionalMacros.p                                            }
  50.  
  51. {$IFC UNDEFINED __QUICKDRAW__}
  52. {$I Quickdraw.p}
  53. {$ENDC}
  54. {    MixedMode.p                                                    }
  55. {    QuickdrawText.p                                                }
  56.  
  57. {$IFC UNDEFINED __QDOFFSCREEN__}
  58. {$I QDOffscreen.p}
  59. {$ENDC}
  60. {    Errors.p                                                    }
  61.  
  62. {$IFC UNDEFINED __WINDOWS__}
  63. {$I Windows.p}
  64. {$ENDC}
  65. {    Memory.p                                                    }
  66. {    Events.p                                                    }
  67. {        OSUtils.p                                                }
  68. {    Controls.p                                                    }
  69. {        Menus.p                                                    }
  70.  
  71. {$IFC UNDEFINED __IMAGECOMPRESSION__}
  72. {$I ImageCompression.p}
  73. {$ENDC}
  74. {    Components.p                                                }
  75. {    StandardFile.p                                                }
  76. {        Dialogs.p                                                }
  77. {            TextEdit.p                                            }
  78. {        Files.p                                                    }
  79.  
  80. {$IFC UNDEFINED __MOVIES__}
  81. {$I Movies.p}
  82. {$ENDC}
  83. {    Aliases.p                                                    }
  84. {        AppleTalk.p                                                }
  85.  
  86. {$PUSH}
  87. {$ALIGN MAC68K}
  88. {$LibExport+}
  89.  
  90. CONST
  91.     codecGetCodecInfo            = $00;
  92.     codecGetCompressionTime        = $01;
  93.     codecGetMaxCompressionSize    = $02;
  94.     codecPreCompress            = $03;
  95.     codecBandCompress            = $04;
  96.     codecPreDecompress            = $05;
  97.     codecBandDecompress            = $06;
  98.     codecCDSequenceBusy            = $07;
  99.     codecGetCompressedImageSize    = $08;
  100.     codecGetSimilarity            = $09;
  101.     codecTrimImage                = $0A;
  102.     codecRequestSettings        = $0B;
  103.     codecGetSettings            = $0C;
  104.     codecSetSettings            = $0D;
  105.     codecCDSequenceFlush        = $0E;
  106.     codecSetTimeCode            = $0F;
  107.     codecIsImageDescriptionEquivalent = $10;
  108.     codecNewMemory                = $11;
  109.     codecDisposeMemory            = $12;
  110.     codecHitTestData            = $13;
  111.  
  112.     codecCanScale                = 1 * (2**(0));
  113.     codecCanMask                = 1 * (2**(1));
  114.     codecCanMatte                = 1 * (2**(2));
  115.     codecCanTransform            = 1 * (2**(3));
  116.     codecCanTransferMode        = 1 * (2**(4));
  117.     codecCanCopyPrev            = 1 * (2**(5));
  118.     codecCanSpool                = 1 * (2**(6));
  119.     codecCanClipVertical        = 1 * (2**(7));
  120.     codecCanClipRectangular        = 1 * (2**(8));
  121.     codecCanRemapColor            = 1 * (2**(9));
  122.     codecCanFastDither            = 1 * (2**(10));
  123.     codecCanSrcExtract            = 1 * (2**(11));
  124.     codecCanCopyPrevComp        = 1 * (2**(12));
  125.     codecCanAsync                = 1 * (2**(13));
  126.     codecCanMakeMask            = 1 * (2**(14));
  127.     codecCanShift                = 1 * (2**(15));
  128.     codecCanAsyncWhen            = 1 * (2**(16));
  129.     codecCanShieldCursor        = 1 * (2**(17));
  130.     codecCanManagePrevBuffer    = 1 * (2**(18));
  131.     codecHasVolatileBuffer        = 1 * (2**(19));
  132.     codecWantsRegionMask        = 1 * (2**(20));
  133.  
  134.  
  135. TYPE
  136.     CodecCapabilities = RECORD
  137.         flags:                    LONGINT;
  138.         wantedPixelSize:        INTEGER;
  139.         extendWidth:            INTEGER;
  140.         extendHeight:            INTEGER;
  141.         bandMin:                INTEGER;
  142.         bandInc:                INTEGER;
  143.         pad:                    INTEGER;
  144.         time:                    LONGINT;
  145.     END;
  146.  
  147.  
  148. CONST
  149.     codecConditionFirstBand        = 1 * (2**(0));
  150.     codecConditionLastBand        = 1 * (2**(1));
  151.     codecConditionFirstFrame    = 1 * (2**(2));
  152.     codecConditionNewDepth        = 1 * (2**(3));
  153.     codecConditionNewTransform    = 1 * (2**(4));
  154.     codecConditionNewSrcRect    = 1 * (2**(5));
  155.     codecConditionNewMask        = 1 * (2**(6));
  156.     codecConditionNewMatte        = 1 * (2**(7));
  157.     codecConditionNewTransferMode = 1 * (2**(8));
  158.     codecConditionNewClut        = 1 * (2**(9));
  159.     codecConditionNewAccuracy    = 1 * (2**(10));
  160.     codecConditionNewDestination = 1 * (2**(11));
  161.     codecConditionFirstScreen    = 1 * (2**(12));
  162.     codecConditionDoCursor        = 1 * (2**(13));
  163.     codecConditionCatchUpDiff    = 1 * (2**(14));
  164.     codecConditionMaskMayBeChanged = 1 * (2**(15));
  165.     codecConditionCodecChangedMask = 1 * (2**(31));
  166.  
  167.     codecInfoResourceType        = 'cdci';
  168.     codecInterfaceVersion        = 2;
  169.  
  170.  
  171. TYPE
  172.     CDSequenceDataSource = RECORD
  173.         recordSize:                LONGINT;
  174.         next:                    Ptr;
  175.         seqID:                    ImageSequence;
  176.         sourceID:                ImageSequenceDataSource;
  177.         sourceType:                OSType;
  178.         sourceInputNumber:        LONGINT;
  179.         dataPtr:                Ptr;
  180.         dataDescription:        Handle;
  181.         changeSeed:                LONGINT;
  182.         transferProc:            ProcPtr;
  183.         refCon:                    Ptr;
  184.     END;
  185.  
  186.     CDSequenceDataSourcePtr = ^CDSequenceDataSource;
  187.  
  188.     CodecCompressParams = RECORD
  189.         sequenceID:                ImageSequence;
  190.         imageDescription:        ImageDescriptionHandle;
  191.         data:                    Ptr;
  192.         bufferSize:                LONGINT;
  193.         frameNumber:            LONGINT;
  194.         startLine:                LONGINT;
  195.         stopLine:                LONGINT;
  196.         conditionFlags:            LONGINT;
  197.         callerFlags:            CodecFlags;
  198.         capabilities:            ^CodecCapabilities;
  199.         progressProcRecord:        ICMProgressProcRecord;
  200.         completionProcRecord:    ICMCompletionProcRecord;
  201.         flushProcRecord:        ICMFlushProcRecord;
  202.         srcPixMap:                PixMap;
  203.         prevPixMap:                PixMap;
  204.         spatialQuality:            CodecQ;
  205.         temporalQuality:        CodecQ;
  206.         similarity:                Fixed;
  207.         dataRateParams:            DataRateParamsPtr;
  208.         reserved:                LONGINT;
  209.         majorSourceChangeSeed:    UInt16;
  210.         minorSourceChangeSeed:    UInt16;
  211.         sourceData:                CDSequenceDataSourcePtr;
  212.     END;
  213.  
  214.     CodecDecompressParams = RECORD
  215.         sequenceID:                ImageSequence;
  216.         imageDescription:        ImageDescriptionHandle;
  217.         data:                    Ptr;
  218.         bufferSize:                LONGINT;
  219.         frameNumber:            LONGINT;
  220.         startLine:                LONGINT;
  221.         stopLine:                LONGINT;
  222.         conditionFlags:            LONGINT;
  223.         callerFlags:            CodecFlags;
  224.         capabilities:            ^CodecCapabilities;
  225.         progressProcRecord:        ICMProgressProcRecord;
  226.         completionProcRecord:    ICMCompletionProcRecord;
  227.         dataProcRecord:            ICMDataProcRecord;
  228.         port:                    CGrafPtr;
  229.         dstPixMap:                PixMap;
  230.         maskBits:                BitMapPtr;
  231.         mattePixMap:            PixMapPtr;
  232.         srcRect:                Rect;
  233.         matrix:                    ^MatrixRecord;
  234.         accuracy:                CodecQ;
  235.         transferMode:            INTEGER;
  236.         frameTime:                ICMFrameTimePtr;
  237.         reserved:                ARRAY [0..0] OF LONGINT;
  238.         matrixFlags:            SInt8;
  239.         matrixType:                SInt8;
  240.         dstRect:                Rect;
  241.         majorSourceChangeSeed:    UInt16;
  242.         minorSourceChangeSeed:    UInt16;
  243.         sourceData:                CDSequenceDataSourcePtr;
  244.         maskRegion:                RgnHandle;
  245.     END;
  246.  
  247.  
  248. CONST
  249.     matrixFlagScale2x            = 1 * (2**(7));
  250.     matrixFlagScale1x            = 1 * (2**(6));
  251.     matrixFlagScaleHalf            = 1 * (2**(5));
  252.  
  253.  
  254. FUNCTION CDGetCodecInfo(storage: Handle; VAR info: CodecInfo): ComponentResult;
  255. FUNCTION CDGetCompressionTime(storage: Handle; src: PixMapHandle; {CONST}VAR srcRect: Rect; depth: INTEGER; VAR spatialQuality: CodecQ; VAR temporalQuality: CodecQ; VAR time: LONGINT): ComponentResult;
  256. FUNCTION CDGetMaxCompressionSize(storage: Handle; src: PixMapHandle; {CONST}VAR srcRect: Rect; depth: INTEGER; quality: CodecQ; VAR size: LONGINT): ComponentResult;
  257. FUNCTION CDPreCompress(storage: Handle; VAR params: CodecCompressParams): ComponentResult;
  258. FUNCTION CDBandCompress(storage: Handle; VAR params: CodecCompressParams): ComponentResult;
  259. FUNCTION CDPreDecompress(storage: Handle; VAR params: CodecDecompressParams): ComponentResult;
  260. FUNCTION CDBandDecompress(storage: Handle; VAR params: CodecDecompressParams): ComponentResult;
  261. FUNCTION CDCodecBusy(storage: Handle; seq: ImageSequence): ComponentResult;
  262. FUNCTION CDGetCompressedImageSize(storage: Handle; desc: ImageDescriptionHandle; data: Ptr; bufferSize: LONGINT; dataProc: ICMDataProcRecordPtr; VAR dataSize: LONGINT): ComponentResult;
  263. FUNCTION CDGetSimilarity(storage: Handle; src: PixMapHandle; {CONST}VAR srcRect: Rect; desc: ImageDescriptionHandle; data: Ptr; VAR similarity: Fixed): ComponentResult;
  264. FUNCTION CDTrimImage(storage: Handle; Desc: ImageDescriptionHandle; inData: Ptr; inBufferSize: LONGINT; dataProc: ICMDataProcRecordPtr; outData: Ptr; outBufferSize: LONGINT; flushProc: ICMFlushProcRecordPtr; VAR trimRect: Rect; progressProc: ICMProgressProcRecordPtr): ComponentResult;
  265. FUNCTION CDRequestSettings(storage: Handle; settings: Handle; VAR rp: Rect; filterProc: ModalFilterUPP): ComponentResult;
  266. FUNCTION CDGetSettings(storage: Handle; settings: Handle): ComponentResult;
  267. FUNCTION CDSetSettings(storage: Handle; settings: Handle): ComponentResult;
  268. FUNCTION CDCodecFlush(storage: Handle): ComponentResult;
  269. FUNCTION CDCodecSetTimeCode(storage: Handle; timeCodeFormat: UNIV Ptr; timeCodeTime: UNIV Ptr): ComponentResult;
  270. FUNCTION CDCodecIsImageDescriptionEquivalent(storage: Handle; newDesc: ImageDescriptionHandle; VAR equivalent: BOOLEAN): ComponentResult;
  271. FUNCTION CDCodecNewMemory(storage: Handle; VAR data: Ptr; dataSize: Size; dataUse: LONGINT; memoryGoneProc: ICMMemoryDisposedUPP; refCon: UNIV Ptr): ComponentResult;
  272. FUNCTION CDCodecDisposeMemory(storage: Handle; data: Ptr): ComponentResult;
  273. FUNCTION CDCodecHitTestData(storage: Handle; desc: ImageDescriptionHandle; data: UNIV Ptr; dataSize: Size; where: Point; VAR hit: BOOLEAN): ComponentResult;
  274.  
  275. {$ALIGN RESET}
  276. {$POP}
  277.  
  278. {$SETC UsingIncludes := ImageCodecIncludes}
  279.  
  280. {$ENDC} {__IMAGECODEC__}
  281.  
  282. {$IFC NOT UsingIncludes}
  283.  END.
  284. {$ENDC}
  285.