#include <cv.h>
#include <highgui.h>

#include "Capture.h"

Capture::Capture(shared_ptr<CvCapture> capture) : capture(capture)
{
	stop();
}

shared_ptr<Capture> Capture::createFileCapture(const char * filename)
{
	shared_ptr<CvCapture> cvCap(cvCreateFileCapture(filename),releaseCapture);
	shared_ptr<Capture> capture(new Capture(cvCap));
	return capture;
}

Capture::~Capture( void )
{

}

shared_ptr<Capture> Capture::createCamCapture()
{
	shared_ptr<CvCapture> cvCap(cvCreateCameraCapture(-1),releaseCapture);
	shared_ptr<Capture> capture(new Capture(cvCap));
	return capture;
}
void releaseCapture( CvCapture * capture )
{
	cvReleaseCapture(&capture);
}

void releaseImage( IplImage * image )
{
	cvReleaseImage(&image);
}