コード例 #1
0
ファイル: EnhanceApp.cpp プロジェクト: mdunkley/Enhance
void EnhanceApp::mouseUp( MouseEvent event )
{
    if( mCtlDown )
    {
        int frame = int ( event.getPos().x / float(getWindowWidth()) * mMovie.getNumFrames() );

        mMovie.seekToFrame(  frame );
        mCtlDown = false;
        
    } else
    if( mAltLockDown)
    {
        mScale += mScaleOffset;
        mRot   +=   mRotOffset;
        mScaleOffset = mRotOffset = 0;
        mAltLockDown = false;
    } else
    {
        mAxisDisplay += mAxisOffset;
        mAxisOffset = Vec2f::zero();
    }
    



}
コード例 #2
0
void ocvOpticalFlowApp::loadMovieFile( const fs::path &moviePath )
{
	try {
		// load up the movie, set it to loop, and begin playing
    	mMovie = qtime::MovieSurface( moviePath );    
		mMovie.setLoop();
		mMovie.play();
		
		// create a texture for showing some info about the movie
		TextLayout infoText;
		infoText.clear( ColorA( 0.2f, 0.2f, 0.2f, 0.5f ) );
		infoText.setColor( Color::white() );
		infoText.addCenteredLine( moviePath.filename().string() );
		infoText.addLine( toString( mMovie.getWidth() ) + " x " + toString( mMovie.getHeight() ) + " pixels" );
		infoText.addLine( toString( mMovie.getDuration() ) + " seconds" );
		infoText.addLine( toString( mMovie.getNumFrames() ) + " frames" );
		infoText.addLine( toString( mMovie.getFramerate() ) + " fps" );
		infoText.setBorder( 4, 2 );
		mInfoTexture = gl::Texture( infoText.render( true ) );
	}
	catch( ... ) {
		console() << "Unable to load the movie." << std::endl;
		mMovie.reset();
		mInfoTexture.reset();
	}
    
	mFrameTexture.reset();
}
コード例 #3
0
ファイル: EnhanceApp.cpp プロジェクト: mdunkley/Enhance
void EnhanceApp::loadMovieFile( const string &moviePath )
{
	try {
		mMovie = qtime::MovieSurface( moviePath );
        
		console() << "Dimensions:" << mMovie.getWidth() << " x " << mMovie.getHeight() << std::endl;
		console() << "Duration:  " << mMovie.getDuration() << " seconds" << std::endl;
		console() << "Frames:    " << mMovie.getNumFrames() << std::endl;
		console() << "Framerate: " << mMovie.getFramerate() << std::endl;
		console() << "Alpha channel: " << mMovie.hasAlpha() << std::endl;		
		console() << "Has audio: " << mMovie.hasAudio() << " Has visuals: " << mMovie.hasVisuals() << std::endl;
		mMovie.setLoop( true, true );
        mMovie.setVolume(0);
		mMovie.seekToStart();
		mMovie.play();
	}
	catch( ... ) {
		console() << "Unable to load the movie." << std::endl;
	}	
}
コード例 #4
0
ファイル: EnhanceApp.cpp プロジェクト: mdunkley/Enhance
void EnhanceApp::mouseDrag( MouseEvent event )
{
    //Vec2f offset =  event.getPos() - mClickDown;
    
    Vec2f offset = ( mClickDown - event.getPos()) * .5;
    if( mCtlDown )
    {
        int frame = int ( event.getPos().x / float(getWindowWidth()) * mMovie.getNumFrames() );

        mMovie.seekToFrame(  frame );

    } else
    if( mAltLockDown)
    {
        mScaleOffset = offset.y / getWindowHeight();
        mRotOffset = offset.x;
    } else
    {
        mAxisOffset = offset;
    }
}