mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-01-21 13:10:04 -05:00
FinalRenderEmberController: Fix unique names and estimated iter count with strips.
This commit is contained in:
parent
69b8aaea5b
commit
2a98e8c05b
@ -155,7 +155,7 @@ FinalRenderEmberController<T>::FinalRenderEmberController(FractoriumFinalRenderD
|
|||||||
m_GuiState = m_FinalRenderDialog->State();//Cache render settings from the GUI before running.
|
m_GuiState = m_FinalRenderDialog->State();//Cache render settings from the GUI before running.
|
||||||
bool doAll = m_GuiState.m_DoAll && m_EmberFile.Size() > 1;
|
bool doAll = m_GuiState.m_DoAll && m_EmberFile.Size() > 1;
|
||||||
unsigned int currentStripForProgress = 0;//Sort of a hack to get the strip value to the progress function.
|
unsigned int currentStripForProgress = 0;//Sort of a hack to get the strip value to the progress function.
|
||||||
QString path = doAll ? ComposePath(QString::fromStdString(m_EmberFile.m_Embers[0].m_Name)) : ComposePath(Name());
|
QString path = EmberFile<T>::UniqueFilename(doAll ? ComposePath(QString::fromStdString(m_EmberFile.m_Embers[0].m_Name)) : ComposePath(Name()));
|
||||||
QString backup = path + "_backup.flame";
|
QString backup = path + "_backup.flame";
|
||||||
|
|
||||||
//Save backup Xml.
|
//Save backup Xml.
|
||||||
@ -219,7 +219,7 @@ FinalRenderEmberController<T>::FinalRenderEmberController(FractoriumFinalRenderD
|
|||||||
//Render each image, cancelling if m_Run ever gets set to false.
|
//Render each image, cancelling if m_Run ever gets set to false.
|
||||||
for (i = 0; i < m_EmberFile.Size() && m_Run; i++)
|
for (i = 0; i < m_EmberFile.Size() && m_Run; i++)
|
||||||
{
|
{
|
||||||
Output("Image " + ToString(m_FinishedImageCount) + ":\n" + ComposePath(QString::fromStdString(m_EmberFile.m_Embers[i].m_Name)));
|
Output("Image " + ToString(m_FinishedImageCount) + ":\n" + EmberFile<T>::UniqueFilename(ComposePath(QString::fromStdString(m_EmberFile.m_Embers[i].m_Name))));
|
||||||
m_Renderer->Reset();//Have to manually set this since the ember is not set each time through.
|
m_Renderer->Reset();//Have to manually set this since the ember is not set each time through.
|
||||||
m_RenderTimer.Tic();//Toc() is called in RenderComplete().
|
m_RenderTimer.Tic();//Toc() is called in RenderComplete().
|
||||||
|
|
||||||
@ -244,7 +244,7 @@ FinalRenderEmberController<T>::FinalRenderEmberController(FractoriumFinalRenderD
|
|||||||
//Render each image, cancelling if m_Run ever gets set to false.
|
//Render each image, cancelling if m_Run ever gets set to false.
|
||||||
for (i = 0; i < m_EmberFile.Size() && m_Run; i++)
|
for (i = 0; i < m_EmberFile.Size() && m_Run; i++)
|
||||||
{
|
{
|
||||||
Output("Image " + ToString(m_FinishedImageCount) + ":\n" + ComposePath(QString::fromStdString(m_EmberFile.m_Embers[i].m_Name)));
|
Output("Image " + ToString(m_FinishedImageCount) + ":\n" + EmberFile<T>::UniqueFilename(ComposePath(QString::fromStdString(m_EmberFile.m_Embers[i].m_Name))));
|
||||||
m_Renderer->SetEmber(m_EmberFile.m_Embers[i]);
|
m_Renderer->SetEmber(m_EmberFile.m_Embers[i]);
|
||||||
m_Renderer->PrepFinalAccumVector(m_FinalImage);//Must manually call this first because it could be erroneously made smaller due to strips if called inside Renderer::Run().
|
m_Renderer->PrepFinalAccumVector(m_FinalImage);//Must manually call this first because it could be erroneously made smaller due to strips if called inside Renderer::Run().
|
||||||
m_Stats.Clear();
|
m_Stats.Clear();
|
||||||
@ -272,7 +272,7 @@ FinalRenderEmberController<T>::FinalRenderEmberController(FractoriumFinalRenderD
|
|||||||
m_Renderer->PrepFinalAccumVector(m_FinalImage);//Must manually call this first because it could be erroneously made smaller due to strips if called inside Renderer::Run().
|
m_Renderer->PrepFinalAccumVector(m_FinalImage);//Must manually call this first because it could be erroneously made smaller due to strips if called inside Renderer::Run().
|
||||||
m_Stats.Clear();
|
m_Stats.Clear();
|
||||||
Memset(m_FinalImage);
|
Memset(m_FinalImage);
|
||||||
Output(ComposePath(QString::fromStdString(m_Ember->m_Name)));
|
Output(EmberFile<T>::UniqueFilename(ComposePath(QString::fromStdString(m_Ember->m_Name))));
|
||||||
m_RenderTimer.Tic();//Toc() is called in RenderComplete().
|
m_RenderTimer.Tic();//Toc() is called in RenderComplete().
|
||||||
|
|
||||||
StripsRender<T>(m_Renderer.get(), *m_Ember, m_FinalImage, 0, m_GuiState.m_Strips, m_GuiState.m_YAxisUp,
|
StripsRender<T>(m_Renderer.get(), *m_Ember, m_FinalImage, 0, m_GuiState.m_Strips, m_GuiState.m_YAxisUp,
|
||||||
@ -496,7 +496,7 @@ void FinalRenderEmberController<T>::SyncCurrentToGui()
|
|||||||
m_FinalRenderDialog->Scale(m_Ember->ScaleType());
|
m_FinalRenderDialog->Scale(m_Ember->ScaleType());
|
||||||
m_FinalRenderDialog->m_QualitySpin->SetValueStealth(m_Ember->m_Quality);
|
m_FinalRenderDialog->m_QualitySpin->SetValueStealth(m_Ember->m_Quality);
|
||||||
m_FinalRenderDialog->m_SupersampleSpin->SetValueStealth(m_Ember->m_Supersample);
|
m_FinalRenderDialog->m_SupersampleSpin->SetValueStealth(m_Ember->m_Supersample);
|
||||||
m_FinalRenderDialog->Path(ComposePath(EmberFile<T>::UniqueFilename(Name())));
|
m_FinalRenderDialog->Path(EmberFile<T>::UniqueFilename(ComposePath(Name())));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -574,6 +574,8 @@ pair<size_t, size_t> FinalRenderEmberController<T>::SyncAndComputeMemory()
|
|||||||
{
|
{
|
||||||
bool b = false;
|
bool b = false;
|
||||||
unsigned int channels = m_FinalRenderDialog->Ext() == "png" ? 4 : 3;//4 channels for Png, else 3.
|
unsigned int channels = m_FinalRenderDialog->Ext() == "png" ? 4 : 3;//4 channels for Png, else 3.
|
||||||
|
size_t strips = VerifyStrips(m_Ember->m_FinalRasH, m_FinalRenderDialog->Strips(),
|
||||||
|
[&](const string& s) { }, [&](const string& s) { }, [&](const string& s) { });
|
||||||
|
|
||||||
SyncGuiToEmbers();
|
SyncGuiToEmbers();
|
||||||
m_Renderer->SetEmber(*m_Ember);
|
m_Renderer->SetEmber(*m_Ember);
|
||||||
@ -585,7 +587,7 @@ pair<size_t, size_t> FinalRenderEmberController<T>::SyncAndComputeMemory()
|
|||||||
CancelPreviewRender();
|
CancelPreviewRender();
|
||||||
m_FinalPreviewRenderFunc();
|
m_FinalPreviewRenderFunc();
|
||||||
p.first = m_Renderer->MemoryRequired(m_FinalRenderDialog->Strips(), true);
|
p.first = m_Renderer->MemoryRequired(m_FinalRenderDialog->Strips(), true);
|
||||||
p.second = m_Renderer->TotalIterCount(m_FinalRenderDialog->Strips());
|
p.second = m_Renderer->TotalIterCount(strips);
|
||||||
}
|
}
|
||||||
|
|
||||||
return p;
|
return p;
|
||||||
@ -633,7 +635,7 @@ template<typename T>
|
|||||||
void FinalRenderEmberController<T>::RenderComplete(Ember<T>& ember)
|
void FinalRenderEmberController<T>::RenderComplete(Ember<T>& ember)
|
||||||
{
|
{
|
||||||
string renderTimeString = m_RenderTimer.Format(m_RenderTimer.Toc()), totalTimeString;
|
string renderTimeString = m_RenderTimer.Format(m_RenderTimer.Toc()), totalTimeString;
|
||||||
QString status, filename = ComposePath(EmberFile<T>::UniqueFilename(QString::fromStdString(ember.m_Name)));
|
QString status, filename = EmberFile<T>::UniqueFilename(ComposePath(QString::fromStdString(ember.m_Name)));
|
||||||
QString itersString = ToString(m_Stats.m_Iters);
|
QString itersString = ToString(m_Stats.m_Iters);
|
||||||
QString itersPerSecString = ToString(size_t(m_Stats.m_Iters / (m_Stats.m_IterMs / 1000.0)));
|
QString itersPerSecString = ToString(size_t(m_Stats.m_Iters / (m_Stats.m_IterMs / 1000.0)));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user