home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
cyber.net 2
/
cybernet2.ISO
/
qtw111
/
inc
/
qtcodec.h
< prev
next >
Wrap
C/C++ Source or Header
|
1993-11-22
|
15KB
|
334 lines
// ---------------------------------------------------------------------
//
// QTCODEC.H - QuickTime for Windows C and C++ Bindings
//
// Version 1.1
//
// (c) 1988-1993 Apple Computer, Inc. All Rights Reserved.
//
// ---------------------------------------------------------------------
#if !defined __QTCODEC_H
#define __QTCODEC_H
// Header files
#include <qtw.h>
#include <compmgr.h>
// Macros
#define ADDOFFSET(a,b) (LPBYTE)((char _huge *)(a)+(b))
#define SUBOFFSET(a,b) (LPBYTE)((char _huge *)(a)-(b))
#define HUGESUM(a,b,c) ADDOFFSET(a,FIELDOFFSET(b,c))
#define ROUNDUP(a,b) (((a)+(b-1))&(~(b-1)))
#define ROUNDDOWN(a,b) ((a)&(~(b-1)))
#define ROUNDDOWNSLOW(a,b) ((a)-((a)%(b)))
#define LOCAL static _near
#define GlobalDeref(a) GlobalLock(a)
// Data types
typedef short * PSHORT ;
typedef short FAR * LPSHORT ;
typedef BOOL * PBOOL ;
typedef BOOL FAR * LPBOOL ;
#define HUGE _huge
typedef char HUGE * HPSTR ;
typedef unsigned char HUGE * HPBYTE ;
typedef void HUGE * HPVOID ;
typedef LONG HUGE * HPLONG ;
typedef VOID ( FAR CDECL * HDWDISP)( ...) ;
// Data
enum OPT_TYPE { OPT_UNINIT = 0 // field uninitialized
, OPT_RAW = 1 // decompress to raw buffer
, OPT_BMP = 2 // decompress to BMP
, OPT_HDW = 3 // decompress to video adapter
} ;
enum BMP_TYPE { BMP_NONE = 0 // unknown type
, BMP_DIB = 1 // DIB
, BMP_MONO = 2 // monochrome
, BMP_PACKED_4 = 3 // packed 4 bit, e.g., Fahrenheit
, BMP_PLANAR_4 = 4 // VGA or SVGA
, BMP_INDEX_8 = 5 // palettized driver
, BMP_5_5_5 = 6 // 32,768 colors
, BMP_5_6_5 = 7 // XGA, Intel order
, BMP_PLANAR_16 = 8 // two planes of one byte each
, BMP_8_8_8_RGB = 9 // true color RGB
, BMP_MEMERR = 10 // insufficient memory for buffers
, BMP_8_8_8_BGR = 11 // true color BGR
, BMP_5_6_5_M = 12 // XGA, Motorola order
} ;
typedef LONG ImageSequence ;
// We regard as a limiting case a 1,600 x 1,200 screen with 3 bytes
// per pixel and a pixel pitch that is a power of 2, thus 8,192.
// This gives a bank break every 8 lines, for a total of 150 bank
// breaks.
#define MAXBANKBREAKS 150
#if !defined _MATRIX
#define _MATRIX
typedef LONG LFRACT ;
#define MAKELFRACT(value, fract) ((((DWORD)(fract))>>2) | (((DWORD)((WORD)(value))) << 30))
typedef struct { // Hungarian: mtrx
struct {
LFIXED lfxCol1 ;
LFIXED lfxCol2 ;
LFRACT lfrCol3 ;
} Row[ 3] ;
} MATRIX, FAR * LPMATRIX ;
#endif // !defined _MATRIX
#define ostypeAPPL QTFOURCC( 'a', 'p', 'p', 'l')
#define ostypeCVID QTFOURCC( 'c', 'v', 'i', 'd')
#define ostypeDCMP QTFOURCC( 'd', 'c', 'm', 'p')
#define ostypeJPEG QTFOURCC( 'j', 'p', 'e', 'g')
#define ostypeRAW QTFOURCC( 'r', 'a', 'w', ' ')
#define ostypeRLE QTFOURCC( 'r', 'l', 'e', ' ')
#define ostypeRPZA QTFOURCC( 'r', 'p', 'z', 'a')
#define ostypeRT21 QTFOURCC( 'r', 't', '2', '1')
#define ostypeSMC QTFOURCC( 's', 'm', 'c', ' ')
/* Codec function selectors
Codec selectors 0-127 are reserved by Apple
Codec selectors 128-191 are subtype specific
Codec selectors 192-255 are vendor specific
Codec selectors 256-32767 are reserved by Apple
Negative selectors are reserved by the Component Manager
*/
enum CODEC_SELECTOR { codecGetCodecInfo = 0
, codecGetCompressionTime = 1
, codecGetMaxCompressionSize = 2
, codecPreCompress = 3
, codecBandCompress = 4
, codecPreDecompress = 5
, codecBandDecompress = 6
, codecCDSequenceBusy = 7
, codecGetCompressedImageSize = 8
, codecGetSimilarity = 9
, codecTrimImage = 10
} ;
typedef struct tagCODECCAPABILITIES {
LONG lFlags ;
WORD wWantedPixelSize ;
WORD wExtendWidth ; // extra bytes after last row
WORD wExtendHeight ; // number of rows per compress unit
WORD wBandMin ;
WORD wBandInc ;
WORD wPad ;
WORD wTime ;
// new fields for Windows version
OPT_TYPE optt ; // the supported optimization
} CODECCAPABILITIES, FAR * LPCODECCAPABILITIES ;
typedef struct tagMASKBITS {
LPVOID lpBits ; // pointer to the bits
WORD wRowBytes ; // pixel pitch or BMP pitch
RECT rectBounds ; // clip rectangle
} MASKBITS, FAR * LPMASKBITS ;
// flags for lFlags in CODECCAPABILITIES
#define codecCanScale (1L << 0)
#define codecCanMask (1L << 1)
#define codecCanMatte (1L << 2)
#define codecCanTransform (1L << 3)
#define codecCanTransferMode (1L << 4)
#define codecCanCopyPrev (1L << 5)
#define codecCanSpool (1L << 6)
#define codecCanClipVertical (1L << 7)
#define codecCanClipRectangular (1L << 8)
#define codecCanRemapColor (1L << 9)
#define codecCanFastDither (1L << 10)
#define codecCanSrcExtract (1L << 11)
#define codecCanCopyPrevComp (1L << 12)
#define codecCanAsync (1L << 13)
#define codecCanMakeMask (1L << 14)
#define codecCanShift (1L << 15)
// flags for lConditionFlags in CODECDECOMPRESSPARAMETERS
#define codecConditionFirstBand (1L << 0)
#define codecConditionLastBand (1L << 1)
#define codecConditionCatchUp (1L << 2)
#define codecConditionCodecChangedMask (1L << 31)
typedef struct tagCODECDECOMPRESSPARAMS {
LONG lSequenceID ; // number of first frame
ImageDescription FAR * lpim ; // pointer to image description
LPVOID lpCompressed ; // pointer to compressed data
LONG lBufferSize ; // no image buffer size
LONG lFrameNumber ; // within the sequence
LONG lStartLine ; // starting line of band
LONG lStopLine ; // ending line of band
LONG lConditionFlags ; // how component has been called
LONG lCallerFlags ; // further control information
LPCODECCAPABILITIES lpCapabilities ; // filled out by PreDecompress
LPVOID lpvProgressProc ; // no progress proc
LPVOID lpvCompletionProc ; // no completion proc
LPVOID lpvDataProc ; // no data loading proc
HDC hdc ; // instead of CGrafPtr
LPVOID lpUncompressed ; // pointer to offscreen buffer
LPMASKBITS lpMaskBits ; // mask bits structure
LPVOID lpMattePixMap ; // blend matte (unused)
RECT rectSample ; // subset of sample to decompress
LPMATRIX lpMatrix ; // target transformation matrix
BYTE bAccuracy ; // requested accuracy
BYTE bAlign ; // for alignment only
WORD wRop2 ; // usually R2_COPYPEN
WORD wMatrixType ; // identify 0.5X, 2X, 4X
RECT rectDest ; // destination rectangle
// new fields for Windows version
LONG lCompressedSize ; // size of compressed data
BMP_TYPE bmpt ; // BMP type
LPVOID lpDitherTable ;