--User changes

-Highlight power is now on by default.
 -Allow for adjustments on the Flame tab to apply to all open flames in the file.
 -Add two new buttons to the color tab to randomize and toggle the xform color indices.
 -Remove the --strip option from EmberGenome. It was useless and was likely just a carry over from flam3 during its early debugging stages when testing strips.
 -Make randoms in EmberGenome have default dimensions of 1920 x 1080.
 -Prevent --inter and --rotate in EmberGenome from rotating backward before the first flame since it doesn't really make sense.
 -Ensure every loaded flame has at least one xform in it.
 -Change dark.qss to hide dotted selection outline around checkboxes. Users must reload it to take effect.

--Bug fixes
 -The saving of last.flame during editing was appending the file when it should have been replacing.
 -It was impossible for EmberGenome to create a random flame. It can now be done by specifying no arguments: EmberGenome.exe
 -Crossing in EmberGenome was not logging the performed actions to the edit Xml tag.
 -Apply sub batch size and fuse count to template files used on the command line.
 -Use new default filter types with template files.

--Code changes
 -Use cerr in SheepTools instead of cout.
 -Set m_SubBatchSize and m_FuseCount to default values in Ember::Clear().
 -Clean up some command line options text formatting.
This commit is contained in:
mfeemster
2016-05-02 16:54:56 -07:00
parent 1f0cc4bb4a
commit bbc5d0c783
15 changed files with 466 additions and 241 deletions

View File

@ -1311,7 +1311,7 @@ public:
if (useDefaults)
{
//If defaults are on, set to reasonable values.
m_HighlightPower = -1;
m_HighlightPower = 1;
m_Background.Reset();
m_FinalRasW = 100;
m_FinalRasH = 100;
@ -1327,6 +1327,8 @@ public:
m_BlurCoef = 0;
m_CamMat = m3T(0);
m_Quality = 1;
m_SubBatchSize = 10240;
m_FuseCount = 15;
m_MaxRadDE = T(9.0);
m_MinRadDE = 0;
m_CurveDE = T(0.4);
@ -1337,7 +1339,8 @@ public:
m_TemporalFilterType = eTemporalFilterType::BOX_TEMPORAL_FILTER;
m_TemporalFilterWidth = 1;
m_TemporalFilterExp = 0;
m_PaletteMode = ePaletteMode::PALETTE_STEP;
m_PaletteMode = ePaletteMode::PALETTE_LINEAR;
m_Interp = eInterp::EMBER_INTERP_SMOOTH;
}
else
{
@ -1358,6 +1361,8 @@ public:
m_BlurCoef = 999999;
m_CamMat = m3T(999999);
m_Quality = -1;
m_SubBatchSize = 0;
m_FuseCount = 0;
m_MaxRadDE = -1;
m_MinRadDE = -1;
m_CurveDE = -1;
@ -1369,6 +1374,7 @@ public:
m_TemporalFilterWidth = -1;
m_TemporalFilterExp = -999;
m_PaletteMode = ePaletteMode::PALETTE_STEP;
m_Interp = eInterp::EMBER_INTERP_LINEAR;
}
m_Xforms.clear();
@ -1573,7 +1579,7 @@ public:
//Value to control saturation of some pixels in gamma correction during final accumulation.
//Xml field: "highlight_power".
T m_HighlightPower = -1;
T m_HighlightPower = 1;
//When animating a file full of many embers, this value is used to specify the time in the animation
//that this ember should be rendered. They must all be sequential and increase by a default value of 1.

View File

@ -376,7 +376,7 @@ public:
else
{
ember.m_Palette.Clear(false);
cout << "Failure getting random palette, palette set to white\n";
cerr << "Failure getting random palette, palette set to white\n";
}
}
}
@ -538,7 +538,7 @@ public:
}
while ((i > 1) && !(got0 && got1));
os << "cross alternate ";
os << " cross alternate ";
os << trystr;
}
@ -799,7 +799,7 @@ public:
if (best < 0)
{
cout << "Error in TryColors(), skipping ImproveColors()\n";
cerr << "Error in TryColors(), skipping ImproveColors()\n";
return;
}
@ -810,7 +810,7 @@ public:
if (b < 0)
{
cout << "Error in TryColors, aborting tries.\n";
cerr << "Error in TryColors, aborting tries.\n";
break;
}
@ -826,10 +826,12 @@ public:
/// <summary>
/// Run a test render to improve the colors.
/// This checks to see how much of the possible color space is actually used in the final output image.
/// Images which contain a small number or range of colors will return a lower value.
/// </summary>
/// <param name="ember">The ember to render</param>
/// <param name="colorResolution">The resolution of the test histogram. This value ^ 3 will be used for the total size. Common value is 10.</param>
/// <returns>The number of histogram cells that weren't black</returns>
/// <param name="colorResolution">The color resolution of the test histogram. This value ^ 3 will be used for the total size. Common value is 10.</param>
/// <returns>The percentage possible color values that were present in the final output image</returns>
T TryColors(Ember<T>& ember, size_t colorResolution)
{
byte* p;
@ -848,37 +850,31 @@ public:
adjustedEmber.m_PixelsPerUnit *= scalar;
adjustedEmber.m_TemporalSamples = 1;
m_Renderer->SetEmber(adjustedEmber);
m_Renderer->BytesPerChannel(1);
m_Renderer->EarlyClip(true);
m_Renderer->PixelAspectRatio(1);
m_Renderer->ThreadCount(Timing::ProcessorCount());
m_Renderer->Callback(nullptr);
if (m_Renderer->Run(m_FinalImage) != eRenderStatus::RENDER_OK)
{
cout << "Error rendering test image for TryColors(). Aborting.\n";
cerr << "Error rendering test image for TryColors(). Aborting.\n";
return -1;
}
m_Hist.resize(res3);
memset(m_Hist.data(), 0, res3);
Memset(m_Hist);
p = m_FinalImage.data();
for (i = 0; i < m_Renderer->FinalDimensions(); i++)
{
m_Hist[(p[0] * res / 256) +
(p[1] * res / 256) * res +
(p[2] * res / 256) * res * res]++;
p += m_Renderer->NumChannels();
(p[2] * res / 256) * res * res]++;//A specific histogram index representing the sum of R,G,B values.
p += m_Renderer->PixelSize();//Advance the pointer by 1 pixel.
}
for (i = 0; i < res3; i++)
{
if (m_Hist[i])
if (m_Hist[i])//The greater range of RGB values used...
hits++;
}
return T(hits / res3);
return T(hits / res3);//...the higher this returned ratio will be.
}
/// <summary>
@ -897,7 +893,7 @@ public:
else
{
ember.m_Palette.Clear(false);
cout << "Error retrieving random palette, setting to all white.\n";
cerr << "Error retrieving random palette, setting to all white.\n";
}
}
@ -1115,7 +1111,7 @@ public:
if (templ.m_Background[i] >= 0)
ember.m_Background[i] = templ.m_Background[i];
if (templ.m_Zoom < 999999998)
if (templ.m_Zoom < 999999)
ember.m_Zoom = templ.m_Zoom;
if (templ.m_Supersample > 0)
@ -1127,6 +1123,12 @@ public:
if (templ.m_Quality > 0)
ember.m_Quality = templ.m_Quality;
if (templ.m_SubBatchSize > 0)
ember.m_SubBatchSize = templ.m_SubBatchSize;
if (templ.m_FuseCount > 0)
ember.m_FuseCount = templ.m_FuseCount;
if (templ.m_TemporalSamples > 0)
ember.m_TemporalSamples = templ.m_TemporalSamples;
@ -1155,10 +1157,10 @@ public:
if (templ.m_SpatialFilterType > eSpatialFilterType::GAUSSIAN_SPATIAL_FILTER)
ember.m_SpatialFilterType = templ.m_SpatialFilterType;
if (templ.m_Interp >= eInterp::EMBER_INTERP_LINEAR)
if (templ.m_Interp != eInterp::EMBER_INTERP_SMOOTH)
ember.m_Interp = templ.m_Interp;
if (templ.m_AffineInterp >= eAffineInterp::AFFINE_INTERP_LINEAR)
if (templ.m_AffineInterp != eAffineInterp::AFFINE_INTERP_LOG)
ember.m_AffineInterp = templ.m_AffineInterp;
if (templ.m_TemporalFilterType >= eTemporalFilterType::BOX_TEMPORAL_FILTER)
@ -1167,13 +1169,13 @@ public:
if (templ.m_TemporalFilterWidth > 0)
ember.m_TemporalFilterWidth = templ.m_TemporalFilterWidth;
if (templ.m_TemporalFilterExp > -900)
if (templ.m_TemporalFilterExp > -999)
ember.m_TemporalFilterExp = templ.m_TemporalFilterExp;
if (templ.m_HighlightPower >= 0)
if (templ.m_HighlightPower != 1)
ember.m_HighlightPower = templ.m_HighlightPower;
if (templ.m_PaletteMode >= ePaletteMode::PALETTE_STEP)
if (templ.m_PaletteMode != ePaletteMode::PALETTE_LINEAR)
ember.m_PaletteMode = templ.m_PaletteMode;
}

View File

@ -21,7 +21,6 @@ template <typename T>
class EMBER_API VariationList: public Singleton<VariationList<T>>
{
public:
//~VariationList();
const Variation<T>* GetVariation(size_t index) const;
const Variation<T>* GetVariation(size_t index, eVariationType varType) const;
Variation<T>* GetVariationCopy(size_t index, T weight = 1) const;

View File

@ -184,7 +184,7 @@ public:
if (!m_ParentEmber && (typeid(T) == typeid(U)))
m_ParentEmber = reinterpret_cast<Ember<T>*>(xform.ParentEmber());
CopyCont(m_Xaos, xform.XaosVec());//<T, U> needed?//TODO
CopyCont(m_Xaos, xform.XaosVec());
CopyCont(m_Motion, xform.m_Motion);
m_Name = xform.m_Name;
return *this;

View File

@ -524,6 +524,12 @@ private:
AddToReport(string(loc) + " : Error assigning palette with index " + Itos(currentEmber.PaletteIndex()));
}
if (!currentEmber.XformCount())//Ensure there is always at least one xform or else the renderer will crash when trying to render.
{
Xform<T> xform;
currentEmber.AddXform(xform);
}
//if (!Interpolater<T>::InterpMissingColors(currentEmber.m_Palette.m_Entries))
// AddToReport(string(loc) + " : Error interpolating missing palette colors");
currentEmber.CacheXforms();