Esempio n. 1
0
void FrameAligner::align( class AContainer& container, class AProcessWatcher* watcher ) const{
	auto frames = container.getFrames();
	auto base_point = container.minPoint();
	
	ImageContainer images;
	for( auto& frame : frames ){
		FrameContainer current( container, frame );
		images.addImage( FloatRender( 1.0, 1.0 ).render( current ) );
		//TODO: this should be a sub-pixel precision render!
	}
	
	//TODO: also show progress for this!
	RecursiveAligner( settings, 1.0 ).align( images ); //TODO: make configurable
	
	ProgressWrapper( watcher ).loopAll( frames.size(), [&](int i){
			FrameContainer current( container, frames[i] );
			auto aligned_offset = base_point - current.minPoint();
			current.offsetAll( aligned_offset + (images.pos(i) - images.minPoint()) );
		} );
}
Esempio n. 2
0
void ImageLoader::loadImages( QStringList files, ImageContainer& container, Deteleciner& detelecine, int alpha_mask, AProcessWatcher* watcher ){
	auto cache = loadImages( files, watcher );
	container.prepareAdds( files.count() );
	
	for( unsigned i=0; i<cache.size(); i++ ){ //TODO: Show process
		auto file = files[i];
		
		if( QFileInfo( file ).completeSuffix() == "xml.overmix" )
			ImageContainerSaver::load( container, file );
		else{
			auto& img = cache[i];
			
			//De-telecine
			if( detelecine.isActive() ){
				img = detelecine.process( img );
				file = ""; //The result might be a combination of several files
			}
			if( !img.is_valid() )
				continue;
			
			container.addImage( std::move( img ), alpha_mask, -1, file );
		}
	}
}