mitsuba-af602c6fd98a/src/integrators/bdpt/bdpt_wr.cpp
/* In debug mode, this function allows to dump the contributions of
   the individual sampling strategies to a series of images */
In debug mode, this function allows to dump the contributions of
the individual sampling strategies to a series of images
In debug mode this function allows to dump the contributions of the individual sampling strategies to a series of images
void BDPTWorkResult::dump(const BDPTConfiguration &conf,
		const fs::path &prefix, const fs::path &stem) const {
	Float weight = (Float) 1.0f / (Float) conf.sampleCount;
	for (int k = 1; k<=conf.maxDepth; ++k) {
		for (int t=0; t<=k+1; ++t) {
			size_t s = k+1-t;
			Bitmap *bitmap = const_cast<Bitmap *>(m_debugBlocks[strategyIndex(s, t)]->getBitmap());
			ref<Bitmap> ldrBitmap = bitmap->convert(Bitmap::ERGB, Bitmap::EUInt8, -1, weight);
			fs::path filename =
				prefix / fs::path(formatString("%s_k%02i_s%02i_t%02i.png", stem.filename().string().c_str(), k, s, t));
			ref<FileStream> targetFile = new FileStream(filename,
				FileStream::ETruncReadWrite);
			ldrBitmap->write(Bitmap::EPNG, targetFile, 1);
		}
	}
}
void BDPTWorkResult :: dump ( const BDPTConfiguration & conf , const fs :: path & prefix , const fs :: path & stem ) const { Float weight = ( Float ) 1.0f / ( Float ) conf . sampleCount ; for ( int k = 1 ; k <= conf . maxDepth ; ++ k ) { for ( int t = 0 ; t <= k + 1 ; ++ t ) { size_t s = k + 1 - t ; Bitmap * bitmap = const_cast < Bitmap * > ( m_debugBlocks [ strategyIndex ( s , t ) ] -> getBitmap ( ) ) ; ref < Bitmap > ldrBitmap = bitmap -> convert ( Bitmap :: ERGB , Bitmap :: EUInt8 , -1 , weight ) ; fs :: path filename = prefix / fs :: path ( formatString ( " " , stem . filename ( ) . string ( ) . c_str ( ) , k , s , t ) ) ; ref < FileStream > targetFile = new FileStream ( filename , FileStream :: ETruncReadWrite ) ; ldrBitmap -> write ( Bitmap :: EPNG , targetFile , 1 ) ; } } }
In debug mode, this function allows to dump the contributions of
the individual sampling strategies to a series of images
In debug mode this function allows to dump the contributions of the individual sampling strategies to a series of images