
// el - A effects library representation.

// Copyright (C) 2007 Editopia Inc.
// Released under the LGPL.
// For more information, see http://www.openlibraries.org.

#include <iostream>

#include <openpluginlib/pl/openpluginlib.hpp>
#include <openpluginlib/pl/timer.hpp>
#include <openimagelib/il/il.hpp>
#include <openmedialib/ml/ml.hpp>

namespace ml = olib::openmedialib::ml;
namespace il = olib::openimagelib::il;
namespace pl = olib::openpluginlib;

void run( char* argv )
{
	ml::input_type_ptr input = ml::create_input( pl::string( argv ) + pl::string( "/sequence:" ) );
	ml::frame_type_ptr frame = input->fetch( );

	pl::rdtsc_default_timer	r;
	
	r.reset( );
	r.start( );
	
	for( int i = 0; i < 1000; ++i )
		il::rescale( frame->get_image( ), 100, 100, 1, il::BICUBIC_SAMPLING );

	r.stop( );
	pl::rdtsc_default_timer::value_type elapsed = r.elapsed( );
	std::cout << "rdtsc: elapsed time is " << elapsed.tv_sec << " seconds and " << elapsed.tv_usec << " microseconds.\n";
}

int main( int argc, char* argv[ ] )
{
	pl::init( "" );
	
	run( argv[ 1 ] );
	
	pl::uninit( );
}
