#ifndef _QT_UTILS
#define _QT_UTILS


#include "ofConstants.h"
#include "ofGraphics.h" 	


#if TARGET_OS_MAC
	#include <Quicktime/QuickTime.h>
	#include <CoreServices/CoreServices.h>
	#include <ApplicationServices/ApplicationServices.h>
#else
	#include <QTML.h>
	#include <FixMath.h>
	#include <QuickTimeComponents.h>
	#include <TextUtils.h>	
#endif


//-------------------------- helpful for rgba->rgb conversion
typedef struct{
	unsigned char r; 
	unsigned char g; 
	unsigned char b;
} pix24;



//-------------------------- for the video grabber
typedef struct {
	unsigned char * 	offscreenGWorldPixels;	// 32 bit: argb (qt k32ARGBPixelFormat)	
	unsigned char * 	pixels;					// 24 bit: rgb
	int 				w,h;
	bool 				bHavePixelsChanged;
	GWorldPtr 			videogworld;
	SeqGrabComponent	gSeqGrabber;
	SGChannel 			gVideoChannel;
	Rect				videoRect;	
	bool 				bSgInited;
} videoGrabberData;
//---------------------------------------------



//ofQtVideoGrabber static vars
static	ComponentDescription 	    theDesc;
static	Component 					sgCompID;
//----------------------------------------

void 		initializeQuicktime();
void 		convertPixels(unsigned char * gWorldPixels, unsigned char * rgbPixels, int w, int h);
Boolean 	SeqGrabberModalFilterUPP (DialogPtr theDialog, const EventRecord *theEvent, short *itemHit, long refCon);
void 		initGrabbingComponent(videoGrabberData * vgd, bool bVerbose);

#endif
