Exemplo n.º 1
0
void MainWindow::setStrategy(int strategyIdx)
{
    if (strategyIdx >= 0 && strategyIdx < m_toolsUi->cmbTool->count()) {
        if (strategyIndex() != strategyIdx)
            m_toolsUi->cmbTool->setCurrentIndex(strategyIdx);
    }
}
Exemplo n.º 2
0
/* 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);
		}
	}
}