home *** CD-ROM | disk | FTP | other *** search
- /*
- File: video digitizer.h
- Copyright: © 1991 by Apple Computer, Inc., all rights reserved.
- */
-
- #ifndef _videodigitizer_
- #define _videodigitizer_
-
- #include <QuickDraw.h>
- #include <Video.h> /* gotta do this to get VDGamRecPtr */
-
- #include "Matrix.h"
- #include "Components.h"
-
- /* Standard type for video digitizers */
-
- #define videoDigitizerComponentType 'vdig'
- #define vdigInterfaceRev 2L
-
- /* Input Format Standards */
-
- #define ntscIn 0 /* ntsc input format */
- #define palIn 1 /* pal input format */
- #define secamIn 2 /* secam input format */
- #define autoDetectIn 3 /* auto detect */
-
- /* Input Formats */
-
- #define compositeIn 0 /* input is composite format */
- #define sVideoIn 1 /* input is sVideo format */
- #define rgbComponentIn 2 /* input is rgb component format */
-
- /* Video Digitizer PlayThru States */
-
- #define vdPlayThruOff 0
- #define vdPlayThruOn 1
-
- /* Input Color Space Modes */
-
- #define vdDigitizerBW 0 /* black and white */
- #define vdDigitizerRGB 1 /* rgb color */
-
- /* Phase Lock Loop Modes */
-
- #define vdBroadcastMode 0 /* Broadcast / Laser Disk video mode */
- #define vdVTRMode 1 /* VCR / Magnetic media mode */
-
- /* vdig types */
-
- #define vdTypeBasic 0 /* basic, no clipping */
- #define vdTypeAlpha 1 /* supports clipping with alpha channel */
- #define vdTypeMask 2 /* supports clipping with mask plane */
- #define vdTypeKey 3 /* supports clipping with key color(s) */
-
- /* Digitizer Error Codes */
-
- #define digiUnimpErr -2201 /* feature unimplemented */
- #define paramErr -2202 /* bad input parameter (out of range, etc) */
- #define matrixErr -2203 /* bad matrix, digitizer did nothing */
- #define notExactMatrix -2204 /* warning of bad matrix, digitizer did its best */
- #define noMoreKeyColors -2205 /* all key indexes in use */
- #define notExactSize -2206 /* Can’t do exact size requested */
- #define badDepth -2207 /* Can’t digitize into this depth */
- #define noDMA -2208 /* Can’t do DMA digitizing (i.e. can't go to requested dest */
-
- /* Digitizer Input Capability/Current Flags */
-
- #define digiInDoesNTSC (1L<<0) /* digitizer supports NTSC input format */
- #define digiInDoesPAL (1L<<1) /* digitizer supports PAL input format */
- #define digiInDoesSECAM (1L<<2) /* digitizer supports SECAM input format */
- #define digiInDoesGenLock (1L<<7) /* digitizer does genlock */
-
- #define digiInDoesComposite (1L<<8) /* digitizer supports composite input type */
- #define digiInDoesSVideo (1L<<9) /* digitizer supports S-Video input type */
- #define digiInDoesComponent (1L<<10) /* digitizer supports component (rgb) input type */
- #define digiInVTR_Broadcast (1L<<11) /* digitizer can differentiate between the two */
-
- #define digiInDoesColor (1L<<12) /* digitizer supports color */
- #define digiInDoesBW (1L<<13) /* digitizer supports black & white */
-
- /* Digitizer Input Current Flags (these are valid only during active operating conditions) */
-
- #define digiInGenLocked (1L<<30) /* digitizer signal is in genlock mode */
- #define digiInSignalLock (1L<<31) /* digitizer detects input signal is locked */
- /* this bit = horiz lock || vertical lock */
-
- /* Digitizer Output Capability/Current Flags */
-
- #define digiOutDoes1 (1L<<0) /* digitizer supports 1 bit pixels */
- #define digiOutDoes2 (1L<<1) /* digitizer supports 2 bit pixels */
- #define digiOutDoes4 (1L<<2) /* digitizer supports 4 bit pixels */
- #define digiOutDoes8 (1L<<3) /* digitizer supports 8 bit pixels */
- #define digiOutDoes16 (1L<<4) /* digitizer supports 16 bit pixels */
- #define digiOutDoes32 (1L<<5) /* digitizer supports 32 bit pixels */
- #define digiOutDoesDither (1L<<6) /* digitizer dithers in indexed modes */
- #define digiOutDoesStretch (1L<<7) /* digitizer can arbitrarily stretch */
- #define digiOutDoesShrink (1L<<8) /* digitizer can arbitrarily shrink */
- #define digiOutDoesMask (1L<<9) /* digitizer can mask to clipping regions */
-
- #define digiOutDoesDouble (1L<<11) /* digitizer can stretch to exactly double size */
- #define digiOutDoesQuad (1L<<12) /* digitizer can stretch exactly quadruple size */
- #define digiOutDoesQuarter (1L<<13) /* digitizer can shrink to exactly quarter size */
- #define digiOutDoesSixteenth (1L<<14) /* digitizer can shrink to exactly sixteenth size */
-
- #define digiOutDoesRotate (1L<<15) /* digitizer supports rotate transformations */
- #define digiOutDoesHorizFlip (1L<<16) /* digitizer supports horizontal flips Sx < 0 */
- #define digiOutDoesVertFlip (1L<<17) /* digitizer supports vertical flips Sy < 0 */
- #define digiOutDoesSkew (1L<<18) /* digitizer supports skew (shear,twist) */
- #define digiOutDoesBlend (1L<<19)
- #define digiOutDoesWarp (1L<<20)
-
- #define digiOutDoesHW_DMA (1L<<21) /* digitizer not constrained to local device */
- #define digiOutDoesHWPlayThru (1L<<22) /* digitizer doesn't need time to play thru */
- #define digiOutDoesILUT (1L<<23) /* digitizer does inverse LUT for index modes */
- #define digiOutDoesKeyColor (1L<<24) /* digitizer does key color functions too */
- #define digiOutDoesAsyncGrabs (1L<<25) /* digitizer supports async grabs */
-
-
- /* Types */
-
- typedef ComponentInstance VideoDigitizerThing;
- typedef ComponentResult VideoDigitizerError;
-
- typedef struct {
- short vdigType;
- long inputCapabilityFlags;
- long outputCapabilityFlags;
- long inputCurrentFlags;
- long outputCurrentFlags;
- short slot; /* temporary for connection purposes */
- GDHandle gdh; /* temporary for digitizers that have preferred screen */
- GDHandle maskgdh; /* temporary for digitizers that have mask planes */
- short minDestHeight; /* Smallest resizable height */
- short minDestWidth; /* Smallest resizable width */
- short maxDestHeight; /* Largest resizable height */
- short maxDestWidth; /* Largest resizable height */
- short blendLevels; /* Number of blend levels supported (2 if 1 bit mask) */
- long reserved; /* reserved */
- } DigitizerInfo;
-
- typedef struct {
- long type;
- long reserved;
- } VdigType;
-
- typedef struct {
- short count;
- VdigType list[1];
- } VdigTypeList;
-
- typedef struct {
- PixMapHandle dest;
- Point location;
- long reserved;
- } VdigBufferRec;
-
- typedef struct {
- short count;
- MatrixRecordPtr matrix;
- RgnHandle mask;
- VdigBufferRec list[1];
- } VdigBufferRecList;
-
- typedef VdigBufferRecList *VdigBufferRecListPtr, **VdigBufferRecListHandle;
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- /* Video Digitizer Interface */
-
- #define kSelectVDGetMaxSrcRect 1
- #define kSelectVDGetActiveSrcRect 2
- #define kSelectVDSetDigitizerRect 3
- #define kSelectVDGetDigitizerRect 4
- #define kSelectVDGetVBlankRect 5
- #define kSelectVDGetMaskPixMap 6
- #define kSelectVDDone 7
- #define kSelectVDGetPlayThruDestination 8
- #define kSelectVDUseThisCLUT 9
- #define kSelectVDSetInputGammaValue 10
- #define kSelectVDGetInputGammaValue 11
- #define kSelectVDSetBrightness 12
- #define kSelectVDGetBrightness 13
- #define kSelectVDSetContrast 14
- #define kSelectVDSetHue 15
- #define kSelectVDSetSharpness 16
- #define kSelectVDSetSaturation 17
- #define kSelectVDGetContrast 18
- #define kSelectVDGetHue 19
- #define kSelectVDGetSharpness 20
- #define kSelectVDGetSaturation 21
- #define kSelectVDGrabOneFrame 22
- #define kSelectVDGetMaxAuxBuffer 23
- #define kSelectVDGrabOneFrameAsync 24
- #define kSelectVDGetDigitizerInfo 25
- #define kSelectVDGetCurrentFlags 26
- #define kSelectVDSetKeyColor 27
- #define kSelectVDGetKeyColor 28
- #define kSelectVDAddKeyColor 29
- #define kSelectVDGetNextKeyColor 30
- #define kSelectVDSetKeyColorRange 31
- #define kSelectVDGetKeyColorRange 32
- #define kSelectVDSetDigitizerUserInterrupt 33
- #define kSelectVDSetInputColorSpaceMode 34
- #define kSelectVDGetInputColorSpaceMode 35
- #define kSelectVDSetClipState 36
- #define kSelectVDGetClipState 37
- #define kSelectVDSetClipRgn 38
- #define kSelectVDClearClipRgn 39
- #define kSelectVDGetCLUTInUse 40
- #define kSelectVDSetPLLFilterType 41
- #define kSelectVDGetPLLFilterType 42
- #define kSelectVDGetMaskandValue 43
- #define kSelectVDSetMasterBlendLevel 44
- #define kSelectVDSetPlayThruDestination 45
- #define kSelectVDSetPlayThruOnOff 46
- #define kSelectVDGetAltDataTypes 47
- #define kSelectVDSetAltDataDestination 48
- #define kSelectVDSetAltDataOnOff 49
- #define kSelectVDPreflightDestination 50
- #define kSelectVDPreflightGlobalRect 51
- #define kSelectVDSetPlayThruGlobalRect 52
- #define kSelectVDSetInputGammaRecord 53
- #define kSelectVDGetInputGammaRecord 54
- #define kSelectVDSetBlackLevelValue 55
- #define kSelectVDGetBlackLevelValue 56
- #define kSelectVDSetWhiteLevelValue 57
- #define kSelectVDGetWhiteLevelValue 58
- #define kSelectVDGetVideoDefaults 59
- #define kSelectVDGetNumberOfInputs 60
- #define kSelectVDGetInputFormat 61
- #define kSelectVDSetInput 62
- #define kSelectVDGetInput 63
- #define kSelectVDSetInputStandard 64
- #define kSelectVDSetupBuffers 65
- #define kSelectVDGrabOneFrameAsync2 66
- #define kSelectVDDone2 67
-
- #define kvdigSelectors 67
-
- pascal VideoDigitizerError VDGetMaxSrcRect(VideoDigitizerThing ti, short inputStd, Rect *maxSrcRect)
- = {0x2f3c,6,1,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetActiveSrcRect(VideoDigitizerThing ti, short inputStd, Rect *activeSrcRect)
- = {0x2f3c,6,2,0x7000,0xa82a};
- pascal VideoDigitizerError VDSetDigitizerRect(VideoDigitizerThing ti, Rect *digitizerRect)
- = {0x2f3c,4,3,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetDigitizerRect(VideoDigitizerThing ti, Rect *digitizerRect)
- = {0x2f3c,4,4,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetVBlankRect(VideoDigitizerThing ti, short inputStd, Rect *vBlankRect)
- = {0x2f3c,6,5,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetMaskPixMap(VideoDigitizerThing ti, PixMapHandle maskPixMap)
- = {0x2f3c,4,6,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetPlayThruDestination(VideoDigitizerThing ti, PixMapHandle *dest, Rect *destRect,
- MatrixRecord *m, RgnHandle *mask)
- = {0x2f3c,16,8,0x7000,0xa82a};
- pascal VideoDigitizerError VDUseThisCLUT(VideoDigitizerThing ti, CTabHandle colorTableHandle)
- = {0x2f3c,4,9,0x7000,0xa82a};
- pascal VideoDigitizerError VDSetInputGammaValue(VideoDigitizerThing ti, Fixed channel1, Fixed channel2, Fixed channel3)
- = {0x2f3c,12,10,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetInputGammaValue(VideoDigitizerThing ti, Fixed *channel1, Fixed *channel2, Fixed *channel3)
- = {0x2f3c,12,11,0x7000,0xa82a};
- pascal VideoDigitizerError VDSetBrightness(VideoDigitizerThing ti, unsigned short *brightness)
- = {0x2f3c,4,12,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetBrightness(VideoDigitizerThing ti, unsigned short *brightness)
- = {0x2f3c,4,13,0x7000,0xa82a};
- pascal VideoDigitizerError VDSetContrast(VideoDigitizerThing ti, unsigned short *contrast)
- = {0x2f3c,4,14,0x7000,0xa82a};
- pascal VideoDigitizerError VDSetHue(VideoDigitizerThing ti, unsigned short *hue)
- = {0x2f3c,4,15,0x7000,0xa82a};
- pascal VideoDigitizerError VDSetSharpness(VideoDigitizerThing ti, unsigned short *sharpness)
- = {0x2f3c,4,16,0x7000,0xa82a};
- pascal VideoDigitizerError VDSetSaturation(VideoDigitizerThing ti, unsigned short *saturation)
- = {0x2f3c,4,17,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetContrast(VideoDigitizerThing ti, unsigned short *contrast)
- = {0x2f3c,4,18,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetHue(VideoDigitizerThing ti, unsigned short *hue)
- = {0x2f3c,4,19,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetSharpness(VideoDigitizerThing ti, unsigned short *sharpness)
- = {0x2f3c,4,20,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetSaturation(VideoDigitizerThing ti, unsigned short *saturation)
- = {0x2f3c,4,21,0x7000,0xa82a};
- pascal VideoDigitizerError VDGrabOneFrame(VideoDigitizerThing ti)
- = {0x2f3c,0,22,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetMaxAuxBuffer(VideoDigitizerThing ti, PixMapHandle *pm, Rect *r)
- = {0x2f3c,8,23,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetDigitizerInfo(VideoDigitizerThing ti, DigitizerInfo *info)
- = {0x2f3c,4,25,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetCurrentFlags(VideoDigitizerThing ti, long *inputCurrentFlag, long *outputCurrentFlag)
- = {0x2f3c,8,26,0x7000,0xa82a};
- pascal VideoDigitizerError VDSetKeyColor(VideoDigitizerThing ti, long index)
- = {0x2f3c,4,27,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetKeyColor(VideoDigitizerThing ti, long *index)
- = {0x2f3c,4,28,0x7000,0xa82a};
- pascal VideoDigitizerError VDAddKeyColor(VideoDigitizerThing ti, long *index)
- = {0x2f3c,4,29,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetNextKeyColor(VideoDigitizerThing ti, long index)
- = {0x2f3c,4,30,0x7000,0xa82a};
- pascal VideoDigitizerError VDSetKeyColorRange(VideoDigitizerThing ti, RGBColor *minRGB, RGBColor *maxRGB)
- = {0x2f3c,8,31,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetKeyColorRange(VideoDigitizerThing ti, RGBColor *minRGB, RGBColor *maxRGB)
- = {0x2f3c,8,32,0x7000,0xa82a};
- pascal VideoDigitizerError VDSetDigitizerUserInterrupt(VideoDigitizerThing ti, short whichOne, ProcPtr userInterruptProc, Ptr params)
- = {0x2f3c,10,33,0x7000,0xa82a};
- pascal VideoDigitizerError VDSetInputColorSpaceMode(VideoDigitizerThing ti, short colorSpaceMode)
- = {0x2f3c,2,34,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetInputColorSpaceMode(VideoDigitizerThing ti, short *colorSpaceMode)
- = {0x2f3c,4,35,0x7000,0xa82a};
- pascal VideoDigitizerError VDSetClipState(VideoDigitizerThing ti, short clipEnable)
- = {0x2f3c,2,36,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetClipState(VideoDigitizerThing ti, short *clipEnable)
- = {0x2f3c,4,37,0x7000,0xa82a};
- pascal VideoDigitizerError VDSetClipRgn(VideoDigitizerThing ti, RgnHandle clipRegion)
- = {0x2f3c,4,38,0x7000,0xa82a};
- pascal VideoDigitizerError VDClearClipRgn(VideoDigitizerThing ti, RgnHandle clipRegion)
- = {0x2f3c,4,39,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetCLUTInUse(VideoDigitizerThing ti, CTabHandle *colorTableHandle)
- = {0x2f3c,4,40,0x7000,0xa82a};
- pascal VideoDigitizerError VDSetPLLFilterType(VideoDigitizerThing ti, short pllType)
- = {0x2f3c,2,41,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetPLLFilterType(VideoDigitizerThing ti, short *pllType)
- = {0x2f3c,4,42,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetMaskandValue(VideoDigitizerThing ti, short blendLevel, long *mask, long *value )
- = {0x2f3c,10,43,0x7000,0xa82a};
- pascal VideoDigitizerError VDSetMasterBlendLevel(VideoDigitizerThing ti, short *blendLevel)
- = {0x2f3c,4,44,0x7000,0xa82a};
- pascal VideoDigitizerError VDSetPlayThruDestination(VideoDigitizerThing ti, PixMapHandle dest, Rect *destRect,
- MatrixRecord *m, RgnHandle mask)
- = {0x2f3c,16,45,0x7000,0xa82a};
- pascal VideoDigitizerError VDSetPlayThruOnOff(VideoDigitizerThing ti, short state)
- = {0x2f3c,2,46,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetAltDataTypes(VideoDigitizerThing ti, VdigTypeList **list)
- = {0x2f3c,4,47,0x7000,0xa82a};
- pascal VideoDigitizerError VDSetAltDataDestination(VideoDigitizerThing ti, long type, Ptr startAddr, short rowBytes,
- short PixelSize, long bufferSize, Rect *destRect, MatrixRecord *m, ProcPtr frameDonePtr)
- = {0x2f3c,28,48,0x7000,0xa82a};
- pascal VideoDigitizerError VDSetAltDataOnOff(VideoDigitizerThing ti, short state)
- = {0x2f3c,2,49,0x7000,0xa82a};
- pascal VideoDigitizerError VDPreflightDestination(VideoDigitizerThing ti, Rect *digitizerRect, PixMap **dest,
- Rect *destRect, MatrixRecord *m)
- = {0x2f3c,16,50,0x7000,0xa82a};
- pascal VideoDigitizerError VDPreflightGlobalRect(VideoDigitizerThing ti, GrafPtr theWindow, Rect *globalRect)
- = {0x2f3c,8,51,0x7000,0xa82a};
- pascal VideoDigitizerError VDSetPlayThruGlobalRect(VideoDigitizerThing ti, GrafPtr theWindow, Rect *globalRect)
- = {0x2f3c,8,52,0x7000,0xa82a};
- pascal VideoDigitizerError VDSetInputGammaRecord(VideoDigitizerThing ti, VDGamRecPtr inputGammaPtr)
- = {0x2f3c,4,53,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetInputGammaRecord(VideoDigitizerThing ti, VDGamRecPtr *inputGammaPtr)
- = {0x2f3c,4,54,0x7000,0xa82a};
- pascal VideoDigitizerError VDSetBlackLevelValue(VideoDigitizerThing ti, unsigned short *blackLevel)
- = {0x2f3c,4,55,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetBlackLevelValue(VideoDigitizerThing ti, unsigned short *blackLevel)
- = {0x2f3c,4,56,0x7000,0xa82a};
- pascal VideoDigitizerError VDSetWhiteLevelValue(VideoDigitizerThing ti, unsigned short *whiteLevel)
- = {0x2f3c,4,57,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetWhiteLevelValue(VideoDigitizerThing ti, unsigned short *whiteLevel)
- = {0x2f3c,4,58,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetVideoDefaults(VideoDigitizerThing ti,
- unsigned short *blackLevel, unsigned short *whiteLevel,
- unsigned short *brightness, unsigned short *hue, unsigned short *saturation,
- unsigned short *contrast, unsigned short *sharpness)
- = {0x2f3c,28,59,0x7000,0xa82a};
- pascal VideoDigitizerError VDGrabOneFrameAsync(VideoDigitizerThing ti, Boolean bufferingOn, PixMapHandle nextDest, Point nextPt)
- = {0x2f3c,10,24,0x7000,0xa82a};
- pascal long VDDone(VideoDigitizerThing ti)
- = {0x2f3c,0,7,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetNumberOfInputs(VideoDigitizerThing ti, short *inputs)
- = {0x2f3c,4,60,0x7000,0xa82a}; /* zero based!! */
- pascal VideoDigitizerError VDGetInputFormat(VideoDigitizerThing ti, short input, short *format)
- = {0x2f3c,6,61,0x7000,0xa82a};
- pascal VideoDigitizerError VDSetInput(VideoDigitizerThing ti, short input)
- = {0x2f3c,2,62,0x7000,0xa82a};
- pascal VideoDigitizerError VDGetInput(VideoDigitizerThing ti, short *input)
- = {0x2f3c,4,63,0x7000,0xa82a};
- pascal VideoDigitizerError VDSetInputStandard(VideoDigitizerThing ti, short inputStandard)
- = {0x2f3c,2,64,0x7000,0xa82a};
- pascal VideoDigitizerError VDSetupBuffers(VideoDigitizerThing ti, VdigBufferRecListHandle bufferList)
- = {0x2f3c,4,65,0x7000,0xa82a};
- pascal VideoDigitizerError VDGrabOneFrameAsync2(VideoDigitizerThing ti, short buffer)
- = {0x2f3c,2,66,0x7000,0xa82a};
- pascal long VDDone2(VideoDigitizerThing ti, short buffer)
- = {0x2f3c,2,67,0x7000,0xa82a};
-
-
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif _videodigitizer_
-
-