#ifndef _OF_SEE_SAW_GRABBER
#define _OF_SEE_SAW_GRABBER

#include "ofMain.h"
#include "VdigGrab.h"

class ofSeeSawVideoGrabber{
	
	public:
		
		void initGrabber(int x, int y);
		void grabFrame();
		void draw(int x, int y);
		void draw(int x, int y, int w, int h);
		
		bool				isFrameNew() { return bIsFrameNew; }
		unsigned char *		getPixels() { return rgbPixels; }
		void				setVerbose(bool bVerbose){ printf("sorry, non-verbose not implemented yet \n"); }
		
		void				videoSettings();
	
	
		int 				camWidth;
		int					camHeight;
		int					width;
		int					height;
	
		bool				bIsFrameNew;
		
		ofTexture			videoTexture;
	
		// see saw stuff: 
		VdigGrab*   pVdg;
		long		milliSecPerFrame;
		Fixed		frameRate;
		long		bytesPerSecond;
		ImageDescriptionHandle vdImageDesc;
		
		// Destination port (GWorld)
		CGrafPtr	dstPort;
		Rect		dstPortBounds;
		Rect		dstDisplayBounds;
		void*		pDstData;
		long		dstDataSize;
	
		unsigned char * gworldBuf;
		unsigned char * rgbPixels;
	
		
		OSErr		videoInitOffscreen (int width, int height);
};

#endif	
