--User changes

-Better handling of crossed min/max DE filter values on the GUI.
 -Changes to spatial and density filter values will no longer restart the entire render.
 -Support reading cam_zoom from xml as zoom since JWildfire uses cam_zoom.
 -Change drag n drop behavior: the default is now to append, hold Ctrl to overwrite.
 -Set max value of zoom to 25 because it will crash with values around 28 or 29 due to numeric overflow when scaling quality.
 -Update links in About Dialog.
 -Rename some controls in Options Dialog.
 -Move the color curves control to the Palette tab.

--Bug fixes
 -Remove extra space in info tree text when dealing with a linked xform.
 -Update summary xform name field whenever xform name changes.
 -Get rid of selection border on summary tab xform tree cells.
 -Only add variations from Xml that have a non-zero weight. There seemed to be spurious flattens coming from Apo with a weight of 0.

--Code changes
 -Gutters are now a fixed size of 8 * supersample.
 -Use stl data() member to get pointer to first element instead of &vec[0].
 -Eliminate extra calls in renderer to ComputeBounds(), CreateSpatialFilter() and CreateTemporalFilter() to only be done at the start of a render.
 -Another attempt at vectorizing LogScaleDensityFilter(). Vectorizes, but not sure if it helps.
 -Some other loop optimizations in Renderer.
 -No longer check temporal samples in response to some control changes, they are always 1 in the interactive renderer.
This commit is contained in:
mfeemster 2016-03-28 18:49:10 -07:00
parent 19cb27b83a
commit e6882ee865
27 changed files with 456 additions and 390 deletions

View File

@ -64,8 +64,7 @@
<StructMemberAlignment>Default</StructMemberAlignment> <StructMemberAlignment>Default</StructMemberAlignment>
<PrecompiledHeaderFile>EmberPch.h</PrecompiledHeaderFile> <PrecompiledHeaderFile>EmberPch.h</PrecompiledHeaderFile>
<FloatingPointModel>Precise</FloatingPointModel> <FloatingPointModel>Precise</FloatingPointModel>
<AdditionalOptions>/bigobj <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
%(AdditionalOptions)</AdditionalOptions>
<StringPooling>true</StringPooling> <StringPooling>true</StringPooling>
<FloatingPointExceptions>false</FloatingPointExceptions> <FloatingPointExceptions>false</FloatingPointExceptions>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
@ -93,8 +92,7 @@
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<PrecompiledHeaderFile>EmberPch.h</PrecompiledHeaderFile> <PrecompiledHeaderFile>EmberPch.h</PrecompiledHeaderFile>
<StringPooling>true</StringPooling> <StringPooling>true</StringPooling>
<AdditionalOptions>/bigobj <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
%(AdditionalOptions)</AdditionalOptions>
<FloatingPointModel>Precise</FloatingPointModel> <FloatingPointModel>Precise</FloatingPointModel>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<FloatingPointExceptions>false</FloatingPointExceptions> <FloatingPointExceptions>false</FloatingPointExceptions>

View File

@ -553,12 +553,17 @@ QTableWidget#XformWeightNameTable
border-left: 1px solid gray; border-left: 1px solid gray;
} }
QTableWidget#SummaryTable, QTableWidget#SummaryTable
QTableWidget#PaletteListTable
{ {
border-left: 1px solid gray; border-left: 1px solid gray;
} }
/*Normally doesn't matter, but when a palette file doesn't have enough palettes in it to fill the whole table, it looks funny without a border*/
QTableWidget#PaletteListTable
{
border: 1px solid gray;
}
QTableWidget#SummaryTable QHeaderView::section::vertical QTableWidget#SummaryTable QHeaderView::section::vertical
{ {
background-color: darkgray; background-color: darkgray;

View File

@ -319,8 +319,8 @@ public:
virtual intmax_t FilterWidth() const override { return m_FilterWidth; } virtual intmax_t FilterWidth() const override { return m_FilterWidth; }
inline size_t BufferSize() const { return m_Widths.size(); } inline size_t BufferSize() const { return m_Widths.size(); }
inline size_t CoefsSizeBytes() const { return BufferSize() * m_KernelSize * sizeof(T); } inline size_t CoefsSizeBytes() const { return BufferSize() * m_KernelSize * sizeof(T); }
inline size_t WidthsSizeBytes() const { return BufferSize() * sizeof(T); } inline size_t WidthsSizeBytes() const { return SizeOf(m_Widths); }
inline size_t CoefsIndicesSizeBytes() const { return (m_CoefIndices.size() * sizeof(m_CoefIndices[0])); } inline size_t CoefsIndicesSizeBytes() const { return SizeOf(m_CoefIndices); }
inline const T* Coefs() const { return m_Coefs.data(); } inline const T* Coefs() const { return m_Coefs.data(); }
inline const T* Widths() const { return m_Widths.data(); } inline const T* Widths() const { return m_Widths.data(); }
inline const uint* CoefIndices() const { return m_CoefIndices.data(); } inline const uint* CoefIndices() const { return m_CoefIndices.data(); }

View File

@ -1524,8 +1524,8 @@ public:
/// <summary> /// <summary>
/// Accessors. /// Accessors.
/// </summary> /// </summary>
inline const Xform<T>* Xforms() const { return &m_Xforms[0]; } inline const Xform<T>* Xforms() const { return m_Xforms.data(); }
inline Xform<T>* NonConstXforms() { return &m_Xforms[0]; } inline Xform<T>* NonConstXforms() { return m_Xforms.data(); }
inline size_t XformCount() const { return m_Xforms.size(); } inline size_t XformCount() const { return m_Xforms.size(); }
inline const Xform<T>* FinalXform() const { return &m_FinalXform; } inline const Xform<T>* FinalXform() const { return &m_FinalXform; }
inline Xform<T>* NonConstFinalXform() { return &m_FinalXform; } inline Xform<T>* NonConstFinalXform() { return &m_FinalXform; }

View File

@ -68,7 +68,7 @@ public:
/// <summary> /// <summary>
/// Accessors. /// Accessors.
/// </summary> /// </summary>
const byte* XformDistributions() const { return m_XformDistributions.empty() ? nullptr : &m_XformDistributions[0]; } const byte* XformDistributions() const { return m_XformDistributions.empty() ? nullptr : m_XformDistributions.data(); }
size_t XformDistributionsSize() const { return m_XformDistributions.size(); } size_t XformDistributionsSize() const { return m_XformDistributions.size(); }
/// <summary> /// <summary>
@ -308,9 +308,9 @@ public:
Point<T> tempPoint, p1; Point<T> tempPoint, p1;
auto xforms = ember.NonConstXforms(); auto xforms = ember.NonConstXforms();
if (ember.ProjBits()) if (ember.ProjBits())//No xaos, 3D.
{ {
if (ember.UseFinalXform()) if (ember.UseFinalXform())//No xaos, 3D, final.
{ {
p1 = samples[0]; p1 = samples[0];
@ -332,7 +332,7 @@ public:
ember.Proj(samples[i], rand); ember.Proj(samples[i], rand);
} }
} }
else else//No xaos, 3D, no final.
{ {
p1 = samples[0]; p1 = samples[0];
@ -355,9 +355,9 @@ public:
} }
} }
} }
else else//No xaos, no 3D.
{ {
if (ember.UseFinalXform()) if (ember.UseFinalXform())//No xaos, no 3D, final.
{ {
p1 = samples[0]; p1 = samples[0];
@ -377,7 +377,7 @@ public:
DoFinalXform(ember, p1, samples + i, rand); DoFinalXform(ember, p1, samples + i, rand);
} }
} }
else else//No xaos, no 3D, no final.
{ {
p1 = samples[0]; p1 = samples[0];
@ -475,9 +475,9 @@ public:
Point<T> tempPoint, p1; Point<T> tempPoint, p1;
auto xforms = ember.NonConstXforms(); auto xforms = ember.NonConstXforms();
if (ember.ProjBits()) if (ember.ProjBits())//Xaos, 3D.
{ {
if (ember.UseFinalXform()) if (ember.UseFinalXform())//Xaos, 3D, final.
{ {
p1 = samples[0]; p1 = samples[0];
@ -506,7 +506,7 @@ public:
lastXformUsed = xformIndex + 1;//Store the last used transform. lastXformUsed = xformIndex + 1;//Store the last used transform.
} }
} }
else else//Xaos, 3D, no final.
{ {
p1 = samples[0]; p1 = samples[0];
@ -536,9 +536,9 @@ public:
} }
} }
} }
else else//Xaos, no 3D.
{ {
if (ember.UseFinalXform()) if (ember.UseFinalXform())//Xaos, no 3D, final.
{ {
p1 = samples[0]; p1 = samples[0];
@ -565,7 +565,7 @@ public:
lastXformUsed = xformIndex + 1;//Store the last used transform. lastXformUsed = xformIndex + 1;//Store the last used transform.
} }
} }
else else//Xaos, no 3D, no final.
{ {
p1 = samples[0]; p1 = samples[0];

View File

@ -47,44 +47,47 @@ public:
if (xmlPaletteEntries) if (xmlPaletteEntries)
{ {
memcpy(&m_Entries[0], xmlPaletteEntries, Size() * sizeof(m_Entries[0])); memcpy(m_Entries.data(), xmlPaletteEntries, SizeOf(m_Entries));
//memcpy(&m_Entries[0], xmlPaletteEntries, Size() * sizeof(m_Entries[0]));
} }
else//They passed in null, so just fill with hard coded values so they at least have something. else//They passed in null, so just fill with hard coded values so they at least have something.
{ {
//Palette 15 used in the test ember file. //Palette 15 used in the test ember file.
byte palette15[COLORMAP_LENGTH * 4] = { byte palette15[COLORMAP_LENGTH * 4] =
0x00, 0xda, 0xde, 0xbc, 0x00, 0xee, 0xe6, 0xc5, 0x00, 0xee, 0xf2, 0xce, 0x00, 0xee, 0xf2, 0xcf, 0x00, 0xe6, 0xee, 0xe1, 0x00, 0xea, 0xee, 0xd8, 0x00, 0xf2, 0xf1, 0xeb, 0x00, 0xf2, 0xf5, 0xd8, {
0x00, 0xe6, 0xf2, 0xce, 0x00, 0xde, 0xea, 0xc5, 0x00, 0xd6, 0xda, 0xc6, 0x00, 0xce, 0xd2, 0xbc, 0x00, 0xc2, 0xca, 0xa9, 0x00, 0xbe, 0xca, 0xa0, 0x00, 0xce, 0xd6, 0xaa, 0x00, 0xde, 0xe2, 0xc5, 0x00, 0xda, 0xde, 0xbc, 0x00, 0xee, 0xe6, 0xc5, 0x00, 0xee, 0xf2, 0xce, 0x00, 0xee, 0xf2, 0xcf, 0x00, 0xe6, 0xee, 0xe1, 0x00, 0xea, 0xee, 0xd8, 0x00, 0xf2, 0xf1, 0xeb, 0x00, 0xf2, 0xf5, 0xd8,
0x00, 0xea, 0xed, 0xce, 0x00, 0xea, 0xf2, 0xc5, 0x00, 0xde, 0xe2, 0xc5, 0x00, 0xc2, 0xca, 0xaa, 0x00, 0xae, 0xbe, 0xaa, 0x00, 0xa5, 0xb2, 0x96, 0x00, 0xa2, 0xa9, 0x8d, 0x00, 0x96, 0xa2, 0x84, 0x00, 0xe6, 0xf2, 0xce, 0x00, 0xde, 0xea, 0xc5, 0x00, 0xd6, 0xda, 0xc6, 0x00, 0xce, 0xd2, 0xbc, 0x00, 0xc2, 0xca, 0xa9, 0x00, 0xbe, 0xca, 0xa0, 0x00, 0xce, 0xd6, 0xaa, 0x00, 0xde, 0xe2, 0xc5,
0x00, 0x8d, 0x8d, 0x7a, 0x00, 0x85, 0x89, 0x71, 0x00, 0x85, 0x8d, 0x71, 0x00, 0x85, 0x85, 0x67, 0x00, 0x79, 0x7d, 0x67, 0x00, 0x79, 0x7d, 0x67, 0x00, 0x71, 0x79, 0x5e, 0x00, 0x65, 0x6d, 0x55, 0x00, 0xea, 0xed, 0xce, 0x00, 0xea, 0xf2, 0xc5, 0x00, 0xde, 0xe2, 0xc5, 0x00, 0xc2, 0xca, 0xaa, 0x00, 0xae, 0xbe, 0xaa, 0x00, 0xa5, 0xb2, 0x96, 0x00, 0xa2, 0xa9, 0x8d, 0x00, 0x96, 0xa2, 0x84,
0x00, 0x4d, 0x5d, 0x42, 0x00, 0x34, 0x40, 0x25, 0x00, 0x30, 0x40, 0x25, 0x00, 0x30, 0x38, 0x1c, 0x00, 0x2c, 0x3c, 0x1c, 0x00, 0x2c, 0x34, 0x1c, 0x00, 0x24, 0x2c, 0x12, 0x00, 0x24, 0x24, 0x00, 0x00, 0x8d, 0x8d, 0x7a, 0x00, 0x85, 0x89, 0x71, 0x00, 0x85, 0x8d, 0x71, 0x00, 0x85, 0x85, 0x67, 0x00, 0x79, 0x7d, 0x67, 0x00, 0x79, 0x7d, 0x67, 0x00, 0x71, 0x79, 0x5e, 0x00, 0x65, 0x6d, 0x55,
0x00, 0x24, 0x2c, 0x09, 0x00, 0x28, 0x34, 0x09, 0x00, 0x38, 0x40, 0x12, 0x00, 0x30, 0x40, 0x1c, 0x00, 0x40, 0x50, 0x2f, 0x00, 0x55, 0x69, 0x42, 0x00, 0x65, 0x75, 0x55, 0x00, 0x6c, 0x7d, 0x5e, 0x00, 0x4d, 0x5d, 0x42, 0x00, 0x34, 0x40, 0x25, 0x00, 0x30, 0x40, 0x25, 0x00, 0x30, 0x38, 0x1c, 0x00, 0x2c, 0x3c, 0x1c, 0x00, 0x2c, 0x34, 0x1c, 0x00, 0x24, 0x2c, 0x12, 0x00, 0x24, 0x24, 0x00,
0x00, 0x74, 0x8d, 0x71, 0x00, 0x74, 0x89, 0x84, 0x00, 0x74, 0x8d, 0x84, 0x00, 0x78, 0x8d, 0x84, 0x00, 0x79, 0x89, 0x7a, 0x00, 0x79, 0x85, 0x71, 0x00, 0x75, 0x7d, 0x67, 0x00, 0x71, 0x79, 0x5e, 0x00, 0x24, 0x2c, 0x09, 0x00, 0x28, 0x34, 0x09, 0x00, 0x38, 0x40, 0x12, 0x00, 0x30, 0x40, 0x1c, 0x00, 0x40, 0x50, 0x2f, 0x00, 0x55, 0x69, 0x42, 0x00, 0x65, 0x75, 0x55, 0x00, 0x6c, 0x7d, 0x5e,
0x00, 0x6c, 0x71, 0x5e, 0x00, 0x6d, 0x70, 0x5e, 0x00, 0x6c, 0x79, 0x5e, 0x00, 0x68, 0x75, 0x5e, 0x00, 0x69, 0x71, 0x55, 0x00, 0x6d, 0x75, 0x55, 0x00, 0x6d, 0x75, 0x55, 0x00, 0x69, 0x71, 0x55, 0x00, 0x74, 0x8d, 0x71, 0x00, 0x74, 0x89, 0x84, 0x00, 0x74, 0x8d, 0x84, 0x00, 0x78, 0x8d, 0x84, 0x00, 0x79, 0x89, 0x7a, 0x00, 0x79, 0x85, 0x71, 0x00, 0x75, 0x7d, 0x67, 0x00, 0x71, 0x79, 0x5e,
0x00, 0x65, 0x71, 0x55, 0x00, 0x69, 0x6d, 0x55, 0x00, 0x64, 0x71, 0x5e, 0x00, 0x68, 0x70, 0x67, 0x00, 0x68, 0x70, 0x67, 0x00, 0x68, 0x6c, 0x67, 0x00, 0x6c, 0x6c, 0x5e, 0x00, 0x71, 0x71, 0x5e, 0x00, 0x6c, 0x71, 0x5e, 0x00, 0x6d, 0x70, 0x5e, 0x00, 0x6c, 0x79, 0x5e, 0x00, 0x68, 0x75, 0x5e, 0x00, 0x69, 0x71, 0x55, 0x00, 0x6d, 0x75, 0x55, 0x00, 0x6d, 0x75, 0x55, 0x00, 0x69, 0x71, 0x55,
0x00, 0x79, 0x79, 0x67, 0x00, 0x81, 0x85, 0x71, 0x00, 0x7d, 0x91, 0x71, 0x00, 0x85, 0x92, 0x7a, 0x00, 0x85, 0x92, 0x7a, 0x00, 0x7d, 0x92, 0x84, 0x00, 0x79, 0x92, 0x84, 0x00, 0x78, 0x92, 0x8d, 0x00, 0x65, 0x71, 0x55, 0x00, 0x69, 0x6d, 0x55, 0x00, 0x64, 0x71, 0x5e, 0x00, 0x68, 0x70, 0x67, 0x00, 0x68, 0x70, 0x67, 0x00, 0x68, 0x6c, 0x67, 0x00, 0x6c, 0x6c, 0x5e, 0x00, 0x71, 0x71, 0x5e,
0x00, 0x78, 0x8d, 0x8d, 0x00, 0x74, 0x8d, 0x84, 0x00, 0x74, 0x92, 0x84, 0x00, 0x75, 0x92, 0x7a, 0x00, 0x6c, 0x85, 0x67, 0x00, 0x64, 0x79, 0x5e, 0x00, 0x59, 0x69, 0x4b, 0x00, 0xaa, 0x57, 0x00, 0x00, 0x79, 0x79, 0x67, 0x00, 0x81, 0x85, 0x71, 0x00, 0x7d, 0x91, 0x71, 0x00, 0x85, 0x92, 0x7a, 0x00, 0x85, 0x92, 0x7a, 0x00, 0x7d, 0x92, 0x84, 0x00, 0x79, 0x92, 0x84, 0x00, 0x78, 0x92, 0x8d,
0x00, 0x38, 0x44, 0x1c, 0x00, 0x30, 0x3c, 0x1c, 0x00, 0x2c, 0x3c, 0x1c, 0x00, 0x34, 0x40, 0x25, 0x00, 0x50, 0x61, 0x4b, 0x00, 0x5d, 0x6d, 0x5e, 0x00, 0x64, 0x71, 0x5e, 0x00, 0x60, 0x71, 0x5e, 0x00, 0x78, 0x8d, 0x8d, 0x00, 0x74, 0x8d, 0x84, 0x00, 0x74, 0x92, 0x84, 0x00, 0x75, 0x92, 0x7a, 0x00, 0x6c, 0x85, 0x67, 0x00, 0x64, 0x79, 0x5e, 0x00, 0x59, 0x69, 0x4b, 0x00, 0xaa, 0x57, 0x00,
0x00, 0x60, 0x75, 0x5e, 0x00, 0x68, 0x75, 0x5e, 0x00, 0x6c, 0x79, 0x5e, 0x00, 0x6c, 0x79, 0x5e, 0x00, 0x71, 0x79, 0x67, 0x00, 0x70, 0x79, 0x67, 0x00, 0x6c, 0x7d, 0x67, 0x00, 0x68, 0x79, 0x67, 0x00, 0x38, 0x44, 0x1c, 0x00, 0x30, 0x3c, 0x1c, 0x00, 0x2c, 0x3c, 0x1c, 0x00, 0x34, 0x40, 0x25, 0x00, 0x50, 0x61, 0x4b, 0x00, 0x5d, 0x6d, 0x5e, 0x00, 0x64, 0x71, 0x5e, 0x00, 0x60, 0x71, 0x5e,
0x00, 0x6c, 0x79, 0x67, 0x00, 0x6c, 0x75, 0x67, 0x00, 0x71, 0x75, 0x5e, 0x00, 0x71, 0x75, 0x5e, 0x00, 0x75, 0x79, 0x5e, 0x00, 0x75, 0x7d, 0x5e, 0x00, 0x81, 0x8d, 0x5e, 0x00, 0x8d, 0x92, 0x5e, 0x00, 0x60, 0x75, 0x5e, 0x00, 0x68, 0x75, 0x5e, 0x00, 0x6c, 0x79, 0x5e, 0x00, 0x6c, 0x79, 0x5e, 0x00, 0x71, 0x79, 0x67, 0x00, 0x70, 0x79, 0x67, 0x00, 0x6c, 0x7d, 0x67, 0x00, 0x68, 0x79, 0x67,
0x00, 0x8d, 0x92, 0x67, 0x00, 0x9a, 0x9a, 0x71, 0x00, 0x9a, 0xa2, 0x7a, 0x00, 0x9a, 0xa2, 0x7a, 0x00, 0x9a, 0xa1, 0x7a, 0x00, 0x92, 0x9a, 0x71, 0x00, 0x89, 0x92, 0x67, 0x00, 0x81, 0x85, 0x5e, 0x00, 0x6c, 0x79, 0x67, 0x00, 0x6c, 0x75, 0x67, 0x00, 0x71, 0x75, 0x5e, 0x00, 0x71, 0x75, 0x5e, 0x00, 0x75, 0x79, 0x5e, 0x00, 0x75, 0x7d, 0x5e, 0x00, 0x81, 0x8d, 0x5e, 0x00, 0x8d, 0x92, 0x5e,
0x00, 0x7d, 0x7d, 0x55, 0x00, 0x69, 0x79, 0x4b, 0x00, 0x61, 0x6d, 0x42, 0x00, 0x44, 0x4c, 0x25, 0x00, 0x38, 0x44, 0x1c, 0x00, 0x40, 0x51, 0x25, 0x00, 0x45, 0x4d, 0x25, 0x00, 0x71, 0x6d, 0x42, 0x00, 0x8d, 0x92, 0x67, 0x00, 0x9a, 0x9a, 0x71, 0x00, 0x9a, 0xa2, 0x7a, 0x00, 0x9a, 0xa2, 0x7a, 0x00, 0x9a, 0xa1, 0x7a, 0x00, 0x92, 0x9a, 0x71, 0x00, 0x89, 0x92, 0x67, 0x00, 0x81, 0x85, 0x5e,
0x00, 0x79, 0x7d, 0x4b, 0x00, 0x81, 0x7d, 0x55, 0x00, 0x79, 0x79, 0x55, 0x00, 0x6d, 0x75, 0x55, 0x00, 0x69, 0x7d, 0x55, 0x00, 0x6c, 0x79, 0x5e, 0x00, 0x65, 0x79, 0x54, 0x00, 0x68, 0x79, 0x5e, 0x00, 0x7d, 0x7d, 0x55, 0x00, 0x69, 0x79, 0x4b, 0x00, 0x61, 0x6d, 0x42, 0x00, 0x44, 0x4c, 0x25, 0x00, 0x38, 0x44, 0x1c, 0x00, 0x40, 0x51, 0x25, 0x00, 0x45, 0x4d, 0x25, 0x00, 0x71, 0x6d, 0x42,
0x00, 0x64, 0x79, 0x67, 0x00, 0x64, 0x79, 0x67, 0x00, 0x68, 0x75, 0x5e, 0x00, 0x64, 0x71, 0x5e, 0x00, 0x64, 0x6c, 0x5e, 0x00, 0x65, 0x6d, 0x55, 0x00, 0x4d, 0x58, 0x42, 0x00, 0x34, 0x40, 0x25, 0x00, 0x79, 0x7d, 0x4b, 0x00, 0x81, 0x7d, 0x55, 0x00, 0x79, 0x79, 0x55, 0x00, 0x6d, 0x75, 0x55, 0x00, 0x69, 0x7d, 0x55, 0x00, 0x6c, 0x79, 0x5e, 0x00, 0x65, 0x79, 0x54, 0x00, 0x68, 0x79, 0x5e,
0x00, 0x2c, 0x38, 0x1c, 0x00, 0x20, 0x28, 0x1c, 0x00, 0x1c, 0x14, 0x09, 0x00, 0x18, 0x18, 0x00, 0x00, 0x04, 0x14, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x0c, 0x18, 0x00, 0x00, 0x1c, 0x28, 0x09, 0x00, 0x64, 0x79, 0x67, 0x00, 0x64, 0x79, 0x67, 0x00, 0x68, 0x75, 0x5e, 0x00, 0x64, 0x71, 0x5e, 0x00, 0x64, 0x6c, 0x5e, 0x00, 0x65, 0x6d, 0x55, 0x00, 0x4d, 0x58, 0x42, 0x00, 0x34, 0x40, 0x25,
0x00, 0x24, 0x30, 0x12, 0x00, 0x3c, 0x44, 0x25, 0x00, 0x5d, 0x65, 0x55, 0x00, 0x75, 0x79, 0x55, 0x00, 0x85, 0x89, 0x5e, 0x00, 0x89, 0x91, 0x71, 0x00, 0x96, 0xa2, 0x71, 0x00, 0x9a, 0xa2, 0x7a, 0x00, 0x2c, 0x38, 0x1c, 0x00, 0x20, 0x28, 0x1c, 0x00, 0x1c, 0x14, 0x09, 0x00, 0x18, 0x18, 0x00, 0x00, 0x04, 0x14, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x0c, 0x18, 0x00, 0x00, 0x1c, 0x28, 0x09,
0x00, 0x9e, 0xaa, 0x7a, 0x00, 0x9e, 0xaa, 0x7a, 0x00, 0xaa, 0xae, 0x71, 0x00, 0xa6, 0xaa, 0x7a, 0x00, 0xa2, 0xaa, 0x7a, 0x00, 0xa1, 0xa5, 0x7a, 0x00, 0x96, 0x9e, 0x7a, 0x00, 0x85, 0x96, 0x7a, 0x00, 0x24, 0x30, 0x12, 0x00, 0x3c, 0x44, 0x25, 0x00, 0x5d, 0x65, 0x55, 0x00, 0x75, 0x79, 0x55, 0x00, 0x85, 0x89, 0x5e, 0x00, 0x89, 0x91, 0x71, 0x00, 0x96, 0xa2, 0x71, 0x00, 0x9a, 0xa2, 0x7a,
0x00, 0x81, 0x92, 0x7a, 0x00, 0x78, 0x92, 0x7a, 0x00, 0x75, 0x92, 0x7a, 0x00, 0x75, 0x8d, 0x7a, 0x00, 0x70, 0x81, 0x67, 0x00, 0x7d, 0x7d, 0x67, 0x00, 0x89, 0x89, 0x67, 0x00, 0x92, 0x9a, 0x71, 0x00, 0x9e, 0xaa, 0x7a, 0x00, 0x9e, 0xaa, 0x7a, 0x00, 0xaa, 0xae, 0x71, 0x00, 0xa6, 0xaa, 0x7a, 0x00, 0xa2, 0xaa, 0x7a, 0x00, 0xa1, 0xa5, 0x7a, 0x00, 0x96, 0x9e, 0x7a, 0x00, 0x85, 0x96, 0x7a,
0x00, 0x9e, 0xaa, 0x7a, 0x00, 0xaa, 0xb6, 0x84, 0x00, 0xb2, 0xb6, 0x8d, 0x00, 0xb6, 0xba, 0x97, 0x00, 0xc2, 0xca, 0x97, 0x00, 0xb2, 0xbe, 0x8d, 0x00, 0xb2, 0xb6, 0x8d, 0x00, 0xaa, 0xb2, 0x8d, 0x00, 0x81, 0x92, 0x7a, 0x00, 0x78, 0x92, 0x7a, 0x00, 0x75, 0x92, 0x7a, 0x00, 0x75, 0x8d, 0x7a, 0x00, 0x70, 0x81, 0x67, 0x00, 0x7d, 0x7d, 0x67, 0x00, 0x89, 0x89, 0x67, 0x00, 0x92, 0x9a, 0x71,
0x00, 0xa2, 0xae, 0x84, 0x00, 0x9a, 0xa6, 0x7a, 0x00, 0x92, 0x9e, 0x7a, 0x00, 0x85, 0x9a, 0x7a, 0x00, 0x7d, 0x96, 0x7a, 0x00, 0x7d, 0x92, 0x7a, 0x00, 0x7d, 0x92, 0x84, 0x00, 0x7d, 0x92, 0x84, 0x00, 0x9e, 0xaa, 0x7a, 0x00, 0xaa, 0xb6, 0x84, 0x00, 0xb2, 0xb6, 0x8d, 0x00, 0xb6, 0xba, 0x97, 0x00, 0xc2, 0xca, 0x97, 0x00, 0xb2, 0xbe, 0x8d, 0x00, 0xb2, 0xb6, 0x8d, 0x00, 0xaa, 0xb2, 0x8d,
0x00, 0x81, 0x96, 0x84, 0x00, 0x85, 0x96, 0x84, 0x00, 0x85, 0x96, 0x84, 0x00, 0x81, 0x92, 0x84, 0x00, 0x85, 0x9a, 0x84, 0x00, 0x85, 0x9a, 0x84, 0x00, 0x8d, 0x9a, 0x84, 0x00, 0x92, 0x96, 0x84, 0x00, 0xa2, 0xae, 0x84, 0x00, 0x9a, 0xa6, 0x7a, 0x00, 0x92, 0x9e, 0x7a, 0x00, 0x85, 0x9a, 0x7a, 0x00, 0x7d, 0x96, 0x7a, 0x00, 0x7d, 0x92, 0x7a, 0x00, 0x7d, 0x92, 0x84, 0x00, 0x7d, 0x92, 0x84,
0x00, 0x9e, 0xa9, 0x84, 0x00, 0xae, 0xb2, 0x84, 0x00, 0xaa, 0xba, 0x84, 0x00, 0xb2, 0xbe, 0x8d, 0x00, 0xb6, 0xc2, 0xa0, 0x00, 0xc6, 0xca, 0xa0, 0x00, 0xc6, 0xce, 0xaa, 0x00, 0xd6, 0xda, 0xb3, 0x00, 0x81, 0x96, 0x84, 0x00, 0x85, 0x96, 0x84, 0x00, 0x85, 0x96, 0x84, 0x00, 0x81, 0x92, 0x84, 0x00, 0x85, 0x9a, 0x84, 0x00, 0x85, 0x9a, 0x84, 0x00, 0x8d, 0x9a, 0x84, 0x00, 0x92, 0x96, 0x84,
0x00, 0xda, 0xe2, 0xc5, 0x00, 0xd2, 0xd6, 0xbc, 0x00, 0xbe, 0xc2, 0xa0, 0x00, 0xaa, 0xb6, 0x8d, 0x00, 0x9e, 0xa6, 0x7a, 0x00, 0x92, 0x9a, 0x71, 0x00, 0x89, 0x89, 0x71, 0x00, 0x81, 0x7d, 0x67, 0x00, 0x9e, 0xa9, 0x84, 0x00, 0xae, 0xb2, 0x84, 0x00, 0xaa, 0xba, 0x84, 0x00, 0xb2, 0xbe, 0x8d, 0x00, 0xb6, 0xc2, 0xa0, 0x00, 0xc6, 0xca, 0xa0, 0x00, 0xc6, 0xce, 0xaa, 0x00, 0xd6, 0xda, 0xb3,
0x00, 0x7d, 0x7d, 0x67, 0x00, 0x81, 0x78, 0x67, 0x00, 0x7d, 0x7d, 0x5e, 0x00, 0x79, 0x79, 0x5e, 0x00, 0x79, 0x81, 0x5e, 0x00, 0x81, 0x7d, 0x67, 0x00, 0x81, 0x7d, 0x67, 0x00, 0x81, 0x81, 0x67, 0x00, 0xda, 0xe2, 0xc5, 0x00, 0xd2, 0xd6, 0xbc, 0x00, 0xbe, 0xc2, 0xa0, 0x00, 0xaa, 0xb6, 0x8d, 0x00, 0x9e, 0xa6, 0x7a, 0x00, 0x92, 0x9a, 0x71, 0x00, 0x89, 0x89, 0x71, 0x00, 0x81, 0x7d, 0x67,
0x00, 0x81, 0x89, 0x71, 0x00, 0x85, 0x91, 0x7a, 0x00, 0x89, 0x92, 0x7a, 0x00, 0x96, 0x9d, 0x7a, 0x00, 0x96, 0x9e, 0x7a, 0x00, 0x92, 0x96, 0x84, 0x00, 0x96, 0x9a, 0x8d, 0x00, 0x92, 0x92, 0x84, 0x00, 0x7d, 0x7d, 0x67, 0x00, 0x81, 0x78, 0x67, 0x00, 0x7d, 0x7d, 0x5e, 0x00, 0x79, 0x79, 0x5e, 0x00, 0x79, 0x81, 0x5e, 0x00, 0x81, 0x7d, 0x67, 0x00, 0x81, 0x7d, 0x67, 0x00, 0x81, 0x81, 0x67,
0x00, 0x89, 0x91, 0x84, 0x00, 0x81, 0x92, 0x84, 0x00, 0x7d, 0x92, 0x8d, 0x00, 0x78, 0x92, 0x8d, 0x00, 0x74, 0x92, 0x8d, 0x00, 0x78, 0x92, 0x8d, 0x00, 0x78, 0x96, 0x97, 0x00, 0x81, 0x96, 0x8d, 0x00, 0x81, 0x89, 0x71, 0x00, 0x85, 0x91, 0x7a, 0x00, 0x89, 0x92, 0x7a, 0x00, 0x96, 0x9d, 0x7a, 0x00, 0x96, 0x9e, 0x7a, 0x00, 0x92, 0x96, 0x84, 0x00, 0x96, 0x9a, 0x8d, 0x00, 0x92, 0x92, 0x84,
0x00, 0x81, 0x96, 0x8d, 0x00, 0x81, 0x9a, 0x8d, 0x00, 0x85, 0x9a, 0x8d, 0x00, 0x89, 0x9e, 0x8d, 0x00, 0x89, 0x9e, 0x8d, 0x00, 0x8d, 0xa2, 0x97, 0x00, 0x95, 0xa2, 0x97, 0x00, 0x8d, 0xa2, 0x97, 0x00, 0x89, 0x91, 0x84, 0x00, 0x81, 0x92, 0x84, 0x00, 0x7d, 0x92, 0x8d, 0x00, 0x78, 0x92, 0x8d, 0x00, 0x74, 0x92, 0x8d, 0x00, 0x78, 0x92, 0x8d, 0x00, 0x78, 0x96, 0x97, 0x00, 0x81, 0x96, 0x8d,
0x00, 0x96, 0xa6, 0x8d, 0x00, 0x9a, 0xa1, 0x8d, 0x00, 0x9e, 0xa9, 0x84, 0x00, 0x9e, 0xa6, 0x7a, 0x00, 0xa2, 0xa5, 0x71, 0x00, 0x9e, 0xa6, 0x71, 0x00, 0x9a, 0xa6, 0x71, 0x00, 0x95, 0x9d, 0x71 }; 0x00, 0x81, 0x96, 0x8d, 0x00, 0x81, 0x9a, 0x8d, 0x00, 0x85, 0x9a, 0x8d, 0x00, 0x89, 0x9e, 0x8d, 0x00, 0x89, 0x9e, 0x8d, 0x00, 0x8d, 0xa2, 0x97, 0x00, 0x95, 0xa2, 0x97, 0x00, 0x8d, 0xa2, 0x97,
0x00, 0x96, 0xa6, 0x8d, 0x00, 0x9a, 0xa1, 0x8d, 0x00, 0x9e, 0xa9, 0x84, 0x00, 0x9e, 0xa6, 0x7a, 0x00, 0xa2, 0xa5, 0x71, 0x00, 0x9e, 0xa6, 0x71, 0x00, 0x9a, 0xa6, 0x71, 0x00, 0x95, 0x9d, 0x71
};
for (size_t i = 0; i < size; i++) for (size_t i = 0; i < size; i++)
{ {
@ -147,7 +150,6 @@ public:
m_Name = palette.m_Name; m_Name = palette.m_Name;
m_Filename = palette.m_Filename; m_Filename = palette.m_Filename;
CopyVec(m_Entries, palette.m_Entries); CopyVec(m_Entries, palette.m_Entries);
return *this; return *this;
} }
@ -167,7 +169,7 @@ public:
/// <returns>The address of the first element in the color entries vector</returns> /// <returns>The address of the first element in the color entries vector</returns>
inline v4T* operator() (void) inline v4T* operator() (void)
{ {
return &m_Entries[0]; return m_Entries.data();
} }
/// <summary> /// <summary>
@ -212,15 +214,12 @@ public:
{ {
size_t ii = (i * 256) / COLORMAP_LENGTH; size_t ii = (i * 256) / COLORMAP_LENGTH;
T rgb[3], hsv[3]; T rgb[3], hsv[3];
rgb[0] = m_Entries[ii].r; rgb[0] = m_Entries[ii].r;
rgb[1] = m_Entries[ii].g; rgb[1] = m_Entries[ii].g;
rgb[2] = m_Entries[ii].b; rgb[2] = m_Entries[ii].b;
RgbToHsv(rgb, hsv); RgbToHsv(rgb, hsv);
hsv[0] += hue * T(6.0); hsv[0] += hue * T(6.0);
HsvToRgb(hsv, rgb); HsvToRgb(hsv, rgb);
//Alpha serves as merely a hit counter that gets incremented by 1 each time, see Renderer::Accumulate() for its usage. //Alpha serves as merely a hit counter that gets incremented by 1 each time, see Renderer::Accumulate() for its usage.
//Removing it saves no memory since it's 16 byte aligned. This also means alpha is not used. //Removing it saves no memory since it's 16 byte aligned. This also means alpha is not used.
palette[i].r = rgb[0]; palette[i].r = rgb[0];
@ -275,7 +274,6 @@ public:
for (size_t i = 0; i < Size(); i++) for (size_t i = 0; i < Size(); i++)
{ {
size_t ii = (i * 256) / COLORMAP_LENGTH; size_t ii = (i * 256) / COLORMAP_LENGTH;
rgb[0] = palette[(COLORMAP_LENGTH + ii - rot) % COLORMAP_LENGTH].r;//Rotation. rgb[0] = palette[(COLORMAP_LENGTH + ii - rot) % COLORMAP_LENGTH].r;//Rotation.
rgb[1] = palette[(COLORMAP_LENGTH + ii - rot) % COLORMAP_LENGTH].g; rgb[1] = palette[(COLORMAP_LENGTH + ii - rot) % COLORMAP_LENGTH].g;
rgb[2] = palette[(COLORMAP_LENGTH + ii - rot) % COLORMAP_LENGTH].b; rgb[2] = palette[(COLORMAP_LENGTH + ii - rot) % COLORMAP_LENGTH].b;
@ -289,7 +287,6 @@ public:
rgb[0] = Clamp<T>(((rgb[0] - T(0.5)) * (cont + T(1.0))) + T(0.5), 0, 1);//Contrast. rgb[0] = Clamp<T>(((rgb[0] - T(0.5)) * (cont + T(1.0))) + T(0.5), 0, 1);//Contrast.
rgb[1] = Clamp<T>(((rgb[1] - T(0.5)) * (cont + T(1.0))) + T(0.5), 0, 1); rgb[1] = Clamp<T>(((rgb[1] - T(0.5)) * (cont + T(1.0))) + T(0.5), 0, 1);
rgb[2] = Clamp<T>(((rgb[2] - T(0.5)) * (cont + T(1.0))) + T(0.5), 0, 1); rgb[2] = Clamp<T>(((rgb[2] - T(0.5)) * (cont + T(1.0))) + T(0.5), 0, 1);
//Alpha serves as merely a hit counter that gets incremented by 1 each time, see Renderer::Accumulate() for its usage. //Alpha serves as merely a hit counter that gets incremented by 1 each time, see Renderer::Accumulate() for its usage.
//Removing it saves no memory since it's 16 byte aligned. //Removing it saves no memory since it's 16 byte aligned.
palette[i].r = rgb[0]; palette[i].r = rgb[0];
@ -305,7 +302,6 @@ public:
for (int i = 0; i < 256; i++) for (int i = 0; i < 256; i++)
{ {
int n = -1; int n = -1;
rgb[0] = 0; rgb[0] = 0;
rgb[1] = 0; rgb[1] = 0;
rgb[2] = 0; rgb[2] = 0;
@ -395,10 +391,8 @@ public:
static void RgbToHsv(T r, T g, T b, T& h, T& s, T& v) static void RgbToHsv(T r, T g, T b, T& h, T& s, T& v)
{ {
T max, min, del, rc, gc, bc; T max, min, del, rc, gc, bc;
max = std::max(std::max(r, g), b);//Compute maximum of r, g, b. max = std::max(std::max(r, g), b);//Compute maximum of r, g, b.
min = std::min(std::min(r, g), b);//Compute minimum of r, g, b. min = std::min(std::min(r, g), b);//Compute minimum of r, g, b.
del = max - min; del = max - min;
v = max; v = max;
s = (max != 0) ? (del / max) : 0; s = (max != 0) ? (del / max) : 0;
@ -461,11 +455,17 @@ public:
switch (j) switch (j)
{ {
case 0: r = v; g = t; b = p; break; case 0: r = v; g = t; b = p; break;
case 1: r = q; g = v; b = p; break; case 1: r = q; g = v; b = p; break;
case 2: r = p; g = v; b = t; break; case 2: r = p; g = v; b = t; break;
case 3: r = p; g = q; b = v; break; case 3: r = p; g = q; b = v; break;
case 4: r = t; g = p; b = v; break; case 4: r = t; g = p; b = v; break;
case 5: r = v; g = p; b = q; break; case 5: r = v; g = p; b = q; break;
default: r = v; g = t; b = p; break; default: r = v; g = t; b = p; break;
} }
} }

View File

@ -81,25 +81,31 @@ bool Renderer<T, bucketT>::AssignIterator()
template <typename T, typename bucketT> template <typename T, typename bucketT>
void Renderer<T, bucketT>::ComputeBounds() void Renderer<T, bucketT>::ComputeBounds()
{ {
size_t maxDEFilterWidth = 0; //size_t maxDEFilterWidth = 0;
//Use type T to account for negative numbers which will occur with a larger supersample and smaller filter width. //Use type T to account for negative numbers which will occur with a larger supersample and smaller filter width.
//The final value will be of type size_t. //The final value will be of type size_t.
m_GutterWidth = size_t(ClampGte<T>((T(m_SpatialFilter->FinalFilterWidth()) - T(Supersample())) / 2, 0)); //m_GutterWidth = size_t(ClampGte<T>((T(m_SpatialFilter->FinalFilterWidth()) - T(Supersample())) / 2, 0));
//
//Check the size of the density estimation filter. ////Check the size of the density estimation filter.
//If the radius of the density estimation filter is greater than the ////If the radius of the density estimation filter is greater than the
//gutter width, have to pad with more. Otherwise, use the same value. ////gutter width, have to pad with more. Otherwise, use the same value.
for (auto& ember : m_Embers) //for (auto& ember : m_Embers)
maxDEFilterWidth = std::max<size_t>(size_t(ceil(ember.m_MaxRadDE) * m_Ember.m_Supersample), maxDEFilterWidth); // maxDEFilterWidth = std::max<size_t>(size_t(ceil(ember.m_MaxRadDE) * m_Ember.m_Supersample), maxDEFilterWidth);
//
//Need an extra ss = (int)floor(m_Supersample / 2.0) of pixels so that a local iteration count for DE can be determined.//SMOULDER ////Need an extra ss = (int)floor(m_Supersample / 2.0) of pixels so that a local iteration count for DE can be determined.//SMOULDER
if (maxDEFilterWidth > 0) //if (maxDEFilterWidth > 0)
maxDEFilterWidth += size_t(Floor<T>(m_Ember.m_Supersample / T(2))); // maxDEFilterWidth += size_t(Floor<T>(m_Ember.m_Supersample / T(2)));
//To have a fully present set of pixels for the spatial filter, must //To have a fully present set of pixels for the spatial filter, must
//add the DE filter width to the spatial filter width.//SMOULDER //add the DE filter width to the spatial filter width.//SMOULDER
m_DensityFilterOffset = maxDEFilterWidth; //m_DensityFilterOffset = maxDEFilterWidth;
m_GutterWidth += m_DensityFilterOffset; //m_GutterWidth += m_DensityFilterOffset;
//
//Original did a lot of work to compute a gutter that changes size based on various parameters, which seems to be of no benefit.
//It also prevents the renderer from only performing filtering or final accum based on a filter parameter change, since that
//change may have changed the gutter.
//By using a fixed gutter, a filter change can be applied without fully restarting iteration.
//m_GutterWidth = 10;
m_GutterWidth = 10 * Supersample();//Should be enough to fully accommodate most spatial and density filter widths.
m_SuperRasW = (Supersample() * FinalRasW()) + (2 * m_GutterWidth); m_SuperRasW = (Supersample() * FinalRasW()) + (2 * m_GutterWidth);
m_SuperRasH = (Supersample() * FinalRasH()) + (2 * m_GutterWidth); m_SuperRasH = (Supersample() * FinalRasH()) + (2 * m_GutterWidth);
m_SuperSize = m_SuperRasW * m_SuperRasH; m_SuperSize = m_SuperRasW * m_SuperRasH;
@ -401,10 +407,12 @@ eRenderStatus Renderer<T, bucketT>::Run(vector<byte>& finalImage, double time, s
if (m_InsertPalette && BytesPerChannel() == 1) if (m_InsertPalette && BytesPerChannel() == 1)
m_TempEmber = m_Ember; m_TempEmber = m_Ember;
//Field would go here, however Ember omits it. Would need temps for width and height if ever implemented. if (!resume)//Only need to create this when starting a new render.
CreateSpatialFilter(newFilterAlloc); {
CreateTemporalFilter(newFilterAlloc); CreateSpatialFilter(newFilterAlloc);//Will be checked and recreated again if necessary right before final output.
CreateTemporalFilter(newFilterAlloc);//But create here just to ensure allocation succeeded.
ComputeBounds(); ComputeBounds();
}
if (m_SpatialFilter.get() == nullptr || m_TemporalFilter.get() == nullptr) if (m_SpatialFilter.get() == nullptr || m_TemporalFilter.get() == nullptr)
{ {
@ -423,7 +431,7 @@ eRenderStatus Renderer<T, bucketT>::Run(vector<byte>& finalImage, double time, s
if (!resume) if (!resume)
ResetBuckets(true, false);//Only reset hist here and do accum when needed later on. ResetBuckets(true, false);//Only reset hist here and do accum when needed later on.
deTime = T(time) + m_TemporalFilter->Deltas()[0]; deTime = T(time) + *m_TemporalFilter->Deltas();
//Interpolate and get an ember for DE purposes. //Interpolate and get an ember for DE purposes.
//Additional interpolation will be done in the temporal samples loop. //Additional interpolation will be done in the temporal samples loop.
@ -436,7 +444,7 @@ eRenderStatus Renderer<T, bucketT>::Run(vector<byte>& finalImage, double time, s
ClampGteRef<T>(m_Ember.m_MaxRadDE, 0); ClampGteRef<T>(m_Ember.m_MaxRadDE, 0);
ClampGteRef<T>(m_Ember.m_MaxRadDE, m_Ember.m_MinRadDE); ClampGteRef<T>(m_Ember.m_MaxRadDE, m_Ember.m_MinRadDE);
if (!CreateDEFilter(newFilterAlloc)) if (!CreateDEFilter(newFilterAlloc))//Will be checked and recreated again if necessary right before density filtering.
{ {
AddToReport("Density filter creation failed, aborting.\n"); AddToReport("Density filter creation failed, aborting.\n");
success = eRenderStatus::RENDER_ERROR; success = eRenderStatus::RENDER_ERROR;
@ -564,6 +572,11 @@ FilterAndAccum:
ResetBuckets(false, true);//Only the histogram was reset above, now reset the density filtering buffer. ResetBuckets(false, true);//Only the histogram was reset above, now reset the density filtering buffer.
//t.Tic(); //t.Tic();
//Make sure a density filter was created with the latest values.
ClampGteRef<T>(m_Ember.m_MinRadDE, 0);
ClampGteRef<T>(m_Ember.m_MaxRadDE, 0);
ClampGteRef<T>(m_Ember.m_MaxRadDE, m_Ember.m_MinRadDE);
CreateDEFilter(newFilterAlloc);
//Apply appropriate filter if iterating is complete. //Apply appropriate filter if iterating is complete.
if (filterAndAccumOnly || temporalSample >= TemporalSamples()) if (filterAndAccumOnly || temporalSample >= TemporalSamples())
@ -615,6 +628,7 @@ AccumOnly:
//Make sure a filter has been created. //Make sure a filter has been created.
CreateSpatialFilter(newFilterAlloc); CreateSpatialFilter(newFilterAlloc);
m_DensityFilterOffset = m_GutterWidth - size_t(Clamp<T>((T(m_SpatialFilter->FinalFilterWidth()) - T(Supersample())) / 2, 0, T(m_GutterWidth)));
m_CurvesSet = m_Ember.m_Curves.CurvesSet(); m_CurvesSet = m_Ember.m_Curves.CurvesSet();
//Color curves must be re-calculated as well. //Color curves must be re-calculated as well.
@ -868,7 +882,12 @@ eRenderStatus Renderer<T, bucketT>::LogScaleDensityFilter(bool forceOutput)
bucketT logScale = (m_K1 * std::log(1 + m_HistBuckets[i].a * m_K2)) / m_HistBuckets[i].a; bucketT logScale = (m_K1 * std::log(1 + m_HistBuckets[i].a * m_K2)) / m_HistBuckets[i].a;
//Original did a temporary assignment, then *= logScale, then passed the result to bump_no_overflow(). //Original did a temporary assignment, then *= logScale, then passed the result to bump_no_overflow().
//Combine here into one operation for a slight speedup. //Combine here into one operation for a slight speedup.
m_AccumulatorBuckets[i] = m_HistBuckets[i] * logScale; //Vectorized version:
bucketT* __restrict hist = glm::value_ptr(m_HistBuckets[i]);//Vectorizer can't tell these point to different locations.
bucketT* __restrict acc = glm::value_ptr(m_AccumulatorBuckets[i]);
for (size_t v = 0; v < 4; v++)
acc[v] = hist[v] * logScale;
} }
} }
} }
@ -1073,6 +1092,7 @@ eRenderStatus Renderer<T, bucketT>::AccumulatorToFinalImage(byte* pixels, size_t
EnterFinalAccum(); EnterFinalAccum();
//Timing t(4); //Timing t(4);
bool doAlpha = NumChannels() > 3;
size_t filterWidth = m_SpatialFilter->FinalFilterWidth(); size_t filterWidth = m_SpatialFilter->FinalFilterWidth();
bucketT g, linRange, vibrancy; bucketT g, linRange, vibrancy;
Color<bucketT> background; Color<bucketT> background;
@ -1085,11 +1105,13 @@ eRenderStatus Renderer<T, bucketT>::AccumulatorToFinalImage(byte* pixels, size_t
{ {
parallel_for(size_t(0), m_SuperRasH, [&] (size_t j) parallel_for(size_t(0), m_SuperRasH, [&] (size_t j)
{ {
size_t rowStart = j * m_SuperRasW;//Pull out of inner loop for optimization. auto rowStart = m_AccumulatorBuckets.data() + (j * m_SuperRasW);//Pull out of inner loop for optimization.
auto rowEnd = rowStart + m_SuperRasW;
for (size_t i = 0; i < m_SuperRasW && !m_Abort; i++) while (rowStart < rowEnd && !m_Abort)//Use the pointer itself as the offset to save an extra addition per iter.
{ {
GammaCorrection(m_AccumulatorBuckets[i + rowStart], background, g, linRange, vibrancy, true, false, &(m_AccumulatorBuckets[i + rowStart][0]));//Write back in place. GammaCorrection(*rowStart, background, g, linRange, vibrancy, true, false, glm::value_ptr(*rowStart));//Write back in place.
rowStart++;
} }
}); });
} }
@ -1109,32 +1131,33 @@ eRenderStatus Renderer<T, bucketT>::AccumulatorToFinalImage(byte* pixels, size_t
Color<bucketT> newBucket; Color<bucketT> newBucket;
size_t pixelsRowStart = (m_YAxisUp ? ((FinalRasH() - j) - 1) : j) * FinalRowSize();//Pull out of inner loop for optimization. size_t pixelsRowStart = (m_YAxisUp ? ((FinalRasH() - j) - 1) : j) * FinalRowSize();//Pull out of inner loop for optimization.
size_t y = m_DensityFilterOffset + (j * Supersample());//Start at the beginning row of each super sample block. size_t y = m_DensityFilterOffset + (j * Supersample());//Start at the beginning row of each super sample block.
glm::uint16* p16; size_t clampedFilterH = std::min(filterWidth, m_SuperRasH - y);//Make sure the filter doesn't go past the bottom of the gutter.
for (size_t i = 0; i < FinalRasW(); i++, pixelsRowStart += PixelSize()) for (size_t i = 0; i < FinalRasW(); i++, pixelsRowStart += PixelSize())
{ {
size_t ii, jj; size_t ii, jj;
size_t x = m_DensityFilterOffset + (i * Supersample());//Start at the beginning column of each super sample block. size_t x = m_DensityFilterOffset + (i * Supersample());//Start at the beginning column of each super sample block.
size_t clampedFilterW = std::min(filterWidth, m_SuperRasW - x);//Make sure the filter doesn't go past the right of the gutter.
newBucket.Clear(); newBucket.Clear();
//Original was iterating column-wise, which is slow. //Original was iterating column-wise, which is slow.
//Here, iterate one row at a time, giving a 10% speed increase. //Here, iterate one row at a time, giving a 10% speed increase.
for (jj = 0; jj < filterWidth; jj++) for (jj = 0; jj < clampedFilterH; jj++)
{ {
size_t filterKRowIndex = jj * filterWidth; size_t filterKRowIndex = jj * filterWidth;//Use the full, non-clamped width to get the filter value.
size_t accumRowIndex = (y + jj) * m_SuperRasW;//Pull out of inner loop for optimization. size_t accumRowIndex = (y + jj) * m_SuperRasW;//Pull out of inner loop for optimization.
for (ii = 0; ii < filterWidth; ii++) for (ii = 0; ii < clampedFilterW; ii++)
{ {
//Need to dereference the spatial filter pointer object to use the [] operator. Makes no speed difference. //Need to dereference the spatial filter pointer object to use the [] operator. Makes no speed difference.
bucketT k = ((*m_SpatialFilter)[ii + filterKRowIndex]); bucketT k = ((*m_SpatialFilter)[filterKRowIndex + ii]);
newBucket += (m_AccumulatorBuckets[(x + ii) + accumRowIndex] * k); newBucket += (m_AccumulatorBuckets[accumRowIndex + (x + ii)] * k);
} }
} }
if (BytesPerChannel() == 2) if (BytesPerChannel() == 2)
{ {
p16 = reinterpret_cast<glm::uint16*>(pixels + pixelsRowStart); auto p16 = reinterpret_cast<glm::uint16*>(pixels + pixelsRowStart);
if (EarlyClip()) if (EarlyClip())
{ {
@ -1149,7 +1172,7 @@ eRenderStatus Renderer<T, bucketT>::AccumulatorToFinalImage(byte* pixels, size_t
p16[1] = glm::uint16(Clamp<bucketT>(newBucket.g, 0, 255) * bucketT(256)); p16[1] = glm::uint16(Clamp<bucketT>(newBucket.g, 0, 255) * bucketT(256));
p16[2] = glm::uint16(Clamp<bucketT>(newBucket.b, 0, 255) * bucketT(256)); p16[2] = glm::uint16(Clamp<bucketT>(newBucket.b, 0, 255) * bucketT(256));
if (NumChannels() > 3) if (doAlpha)
{ {
if (Transparency()) if (Transparency())
p16[3] = byte(Clamp<bucketT>(newBucket.a, 0, 1) * bucketT(65535.0)); p16[3] = byte(Clamp<bucketT>(newBucket.a, 0, 1) * bucketT(65535.0));
@ -1159,7 +1182,7 @@ eRenderStatus Renderer<T, bucketT>::AccumulatorToFinalImage(byte* pixels, size_t
} }
else else
{ {
GammaCorrection(*(reinterpret_cast<tvec4<bucketT, glm::defaultp>*>(&newBucket)), background, g, linRange, vibrancy, NumChannels() > 3, true, p16); GammaCorrection(*(reinterpret_cast<tvec4<bucketT, glm::defaultp>*>(&newBucket)), background, g, linRange, vibrancy, doAlpha, true, p16);
} }
} }
else else
@ -1177,7 +1200,7 @@ eRenderStatus Renderer<T, bucketT>::AccumulatorToFinalImage(byte* pixels, size_t
pixels[pixelsRowStart + 1] = byte(Clamp<bucketT>(newBucket.g, 0, 255)); pixels[pixelsRowStart + 1] = byte(Clamp<bucketT>(newBucket.g, 0, 255));
pixels[pixelsRowStart + 2] = byte(Clamp<bucketT>(newBucket.b, 0, 255)); pixels[pixelsRowStart + 2] = byte(Clamp<bucketT>(newBucket.b, 0, 255));
if (NumChannels() > 3) if (doAlpha)
{ {
if (Transparency()) if (Transparency())
pixels[pixelsRowStart + 3] = byte(Clamp<bucketT>(newBucket.a, 0, 1) * bucketT(255.0)); pixels[pixelsRowStart + 3] = byte(Clamp<bucketT>(newBucket.a, 0, 1) * bucketT(255.0));
@ -1187,13 +1210,13 @@ eRenderStatus Renderer<T, bucketT>::AccumulatorToFinalImage(byte* pixels, size_t
} }
else else
{ {
GammaCorrection(*(reinterpret_cast<tvec4<bucketT, glm::defaultp>*>(&newBucket)), background, g, linRange, vibrancy, NumChannels() > 3, true, pixels + pixelsRowStart); GammaCorrection(*(reinterpret_cast<tvec4<bucketT, glm::defaultp>*>(&newBucket)), background, g, linRange, vibrancy, doAlpha, true, pixels + pixelsRowStart);
} }
} }
} }
}); });
//Insert the palette into the image for debugging purposes. Only works with 8bpc. //Insert the palette into the image for debugging purposes. Only works with 8bpc and is not implemented on the GPU.
if (m_InsertPalette && BytesPerChannel() == 1) if (m_InsertPalette && BytesPerChannel() == 1)
{ {
size_t i, j, ph = 100; size_t i, j, ph = 100;
@ -1625,7 +1648,7 @@ void Renderer<T, bucketT>::GammaCorrection(tvec4<bucketT, glm::defaultp>& bucket
ClampRef<bucketT>(alpha, 0, 1); ClampRef<bucketT>(alpha, 0, 1);
} }
Palette<bucketT>::template CalcNewRgb<bucketT>(&bucket[0], ls, HighlightPower(), newRgb); Palette<bucketT>::template CalcNewRgb<bucketT>(glm::value_ptr(bucket), ls, HighlightPower(), newRgb);
for (glm::length_t rgbi = 0; rgbi < 3; rgbi++) for (glm::length_t rgbi = 0; rgbi < 3; rgbi++)
{ {

View File

@ -144,8 +144,8 @@ public:
T FilterWidth() const { return m_FilterWidth; } T FilterWidth() const { return m_FilterWidth; }
T FilterExp() const { return m_FilterExp; } T FilterExp() const { return m_FilterExp; }
T SumFilt() const { return m_SumFilt; } T SumFilt() const { return m_SumFilt; }
T* Deltas() { return &m_Deltas[0]; } T* Deltas() { return m_Deltas.data(); }
T* Filter() { return &m_Filter[0]; } T* Filter() { return m_Filter.data(); }
eTemporalFilterType FilterType() const { return m_FilterType; } eTemporalFilterType FilterType() const { return m_FilterType; }
protected: protected:

View File

@ -59,7 +59,7 @@ static inline bool Contains(c& container, const T& val)
/// <param name="vec">The vector to compute the size of</param> /// <param name="vec">The vector to compute the size of</param>
/// <returns>The size of one element times the length.</returns> /// <returns>The size of one element times the length.</returns>
template<typename T> template<typename T>
static inline size_t SizeOf(vector<T>& vec) static inline size_t SizeOf(const vector<T>& vec)
{ {
return sizeof(vec[0]) * vec.size(); return sizeof(vec[0]) * vec.size();
} }

View File

@ -2033,7 +2033,7 @@ public:
/// <summary> /// <summary>
/// Accessors. /// Accessors.
/// </summary> /// </summary>
const ParamWithName<T>* Params() const { return &m_Params[0]; } const ParamWithName<T>* Params() const { return m_Params.data(); }
size_t ParamCount() const { return m_Params.size(); } size_t ParamCount() const { return m_Params.size(); }
const vector<ParamWithName<T>>& ParamsVec() const { return m_Params; } const vector<ParamWithName<T>>& ParamsVec() const { return m_Params; }

View File

@ -3938,14 +3938,13 @@ public:
T xi, yi, zi; T xi, yi, zi;
int iMode = int(m_Mode); int iMode = int(m_Mode);
//Extremely strange usage, where a post variation wants the original affine transformed points.
if (m_Static > 1) if (m_Static > 1)
{ {
xi = helper.In.x; xi = helper.In.x;
yi = helper.In.y; yi = helper.In.y;
zi = helper.In.z; zi = helper.In.z;
} }
else else//Extremely strange usage, where a post variation wants the original affine transformed points.
{ {
xi = helper.m_TransX; xi = helper.m_TransX;
yi = helper.m_TransY; yi = helper.m_TransY;
@ -4021,7 +4020,7 @@ public:
if (m_Roundstr != 0) if (m_Roundstr != 0)
{ {
T wwidth = ((m_Roundwidth != 1) ? std::exp(std::log(xang * 2) * m_Roundwidth) : (xang * 2)) * m_RoundCoeff; T wwidth = ((m_Roundwidth != 1) ? std::exp(std::log(xang * 2) * m_Roundwidth) : (xang * 2)) * m_RoundCoeff;
coeff = abs((1 - wwidth) * coeff + wwidth); coeff = std::abs((1 - wwidth) * coeff + wwidth);
} }
if (m_Distortion != 1) if (m_Distortion != 1)
@ -4369,6 +4368,7 @@ public:
m_X = m_Y = m_Z = m_C = 0; m_X = m_Y = m_Z = m_C = 0;
} }
protected: protected:
void Init() void Init()
{ {

View File

@ -559,6 +559,7 @@ private:
else if (ParseAndAssign(curAtt->name, attStr, "scale", currentEmber.m_PixelsPerUnit, ret)) { currentEmber.m_OrigPixPerUnit = currentEmber.m_PixelsPerUnit; } else if (ParseAndAssign(curAtt->name, attStr, "scale", currentEmber.m_PixelsPerUnit, ret)) { currentEmber.m_OrigPixPerUnit = currentEmber.m_PixelsPerUnit; }
else if (ParseAndAssign(curAtt->name, attStr, "rotate", currentEmber.m_Rotate, ret)) { } else if (ParseAndAssign(curAtt->name, attStr, "rotate", currentEmber.m_Rotate, ret)) { }
else if (ParseAndAssign(curAtt->name, attStr, "zoom", currentEmber.m_Zoom, ret)) { ClampGteRef<T>(currentEmber.m_Zoom, 0); } else if (ParseAndAssign(curAtt->name, attStr, "zoom", currentEmber.m_Zoom, ret)) { ClampGteRef<T>(currentEmber.m_Zoom, 0); }
else if (ParseAndAssign(curAtt->name, attStr, "cam_zoom", currentEmber.m_Zoom, ret)) { ClampGteRef<T>(currentEmber.m_Zoom, 0); }//JWildfire uses cam_zoom.
else if (ParseAndAssign(curAtt->name, attStr, "filter", currentEmber.m_SpatialFilterRadius, ret)) { } else if (ParseAndAssign(curAtt->name, attStr, "filter", currentEmber.m_SpatialFilterRadius, ret)) { }
else if (ParseAndAssign(curAtt->name, attStr, "temporal_filter_width", currentEmber.m_TemporalFilterWidth, ret)) { } else if (ParseAndAssign(curAtt->name, attStr, "temporal_filter_width", currentEmber.m_TemporalFilterWidth, ret)) { }
else if (ParseAndAssign(curAtt->name, attStr, "temporal_filter_exp", currentEmber.m_TemporalFilterExp, ret)) { } else if (ParseAndAssign(curAtt->name, attStr, "temporal_filter_exp", currentEmber.m_TemporalFilterExp, ret)) { }
@ -1252,11 +1253,17 @@ private:
string s = fromEmber ? string(CCX(curAtt->name)) : GetCorrectedVariationName(m_BadVariationNames, curAtt); string s = fromEmber ? string(CCX(curAtt->name)) : GetCorrectedVariationName(m_BadVariationNames, curAtt);
if (auto var = m_VariationList.GetVariation(s)) if (auto var = m_VariationList.GetVariation(s))
{
T weight = 0;
Aton(attStr, weight);
if (!IsNearZero(weight))//Having a variation with zero weight makes no sense, so guard against it.
{ {
auto varCopy = var->Copy(); auto varCopy = var->Copy();
Aton(attStr, varCopy->m_Weight); varCopy->m_Weight = weight;
xform.AddVariation(varCopy); xform.AddVariation(varCopy);
} }
}
//else //else
//{ //{

View File

@ -231,6 +231,8 @@ string FinalAccumOpenCLKernelCreator::CreateFinalAccumKernelString(bool earlyCli
"\n" "\n"
" uint accumX = spatialFilter->m_DensityFilterOffset + (GLOBAL_ID_X * spatialFilter->m_Supersample);\n" " uint accumX = spatialFilter->m_DensityFilterOffset + (GLOBAL_ID_X * spatialFilter->m_Supersample);\n"
" uint accumY = spatialFilter->m_DensityFilterOffset + (GLOBAL_ID_Y * spatialFilter->m_Supersample);\n" " uint accumY = spatialFilter->m_DensityFilterOffset + (GLOBAL_ID_Y * spatialFilter->m_Supersample);\n"
" uint clampedFilterH = min((uint)spatialFilter->m_FilterWidth, spatialFilter->m_SuperRasH - accumY);"
" uint clampedFilterW = min((uint)spatialFilter->m_FilterWidth, spatialFilter->m_SuperRasW - accumX);"
" int2 finalCoord;\n" " int2 finalCoord;\n"
" finalCoord.x = GLOBAL_ID_X;\n" " finalCoord.x = GLOBAL_ID_X;\n"
" finalCoord.y = (int)((spatialFilter->m_YAxisUp == 1) ? ((spatialFilter->m_FinalRasH - GLOBAL_ID_Y) - 1) : GLOBAL_ID_Y);\n" " finalCoord.y = (int)((spatialFilter->m_YAxisUp == 1) ? ((spatialFilter->m_FinalRasH - GLOBAL_ID_Y) - 1) : GLOBAL_ID_Y);\n"
@ -241,15 +243,15 @@ string FinalAccumOpenCLKernelCreator::CreateFinalAccumKernelString(bool earlyCli
" real4reals_bucket newBucket;\n" " real4reals_bucket newBucket;\n"
" newBucket.m_Real4 = 0;\n" " newBucket.m_Real4 = 0;\n"
"\n" "\n"
" for (jj = 0; jj < spatialFilter->m_FilterWidth; jj++)\n" " for (jj = 0; jj < clampedFilterH; jj++)\n"
" {\n" " {\n"
" filterKRowIndex = jj * spatialFilter->m_FilterWidth;\n" " filterKRowIndex = jj * spatialFilter->m_FilterWidth;\n"//Use the full, non-clamped width to get the filter value.
"\n" "\n"
" for (ii = 0; ii < spatialFilter->m_FilterWidth; ii++)\n" " for (ii = 0; ii < clampedFilterW; ii++)\n"
" {\n" " {\n"
" real_bucket_t k = filterCoefs[ii + filterKRowIndex];\n" " real_bucket_t k = filterCoefs[filterKRowIndex + ii];\n"
"\n" "\n"
" accumBucket = accumulator + (accumX + ii) + ((accumY + jj) * spatialFilter->m_SuperRasW);\n" " accumBucket = accumulator + ((accumY + jj) * spatialFilter->m_SuperRasW) + (accumX + ii);\n"
" newBucket.m_Real4 += (k * accumBucket->m_Real4);\n" " newBucket.m_Real4 += (k * accumBucket->m_Real4);\n"
" }\n" " }\n"
" }\n" " }\n"
@ -268,12 +270,12 @@ string FinalAccumOpenCLKernelCreator::CreateFinalAccumKernelString(bool earlyCli
if (alphaCalc) if (alphaCalc)
os << " finalColor.m_Float4.w = (float)newBucket.m_Real4.w * 255.0f;\n"; os << " finalColor.m_Float4.w = (float)newBucket.m_Real4.w * 255.0f;\n";
else else
os << " finalColor.m_Float4.w = 255;\n"; os << " finalColor.m_Float4.w = 255.0f;\n";
} }
} }
else else
{ {
//Late clip, so must gamma correct from the temp new bucket to temp float4. //Late clip, so must gamma correct from the temp newBucket to temp finalColor float4.
if (m_DoublePrecision) if (m_DoublePrecision)
{ {
os << os <<

View File

@ -58,7 +58,7 @@
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="text"> <property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;br/&gt;Fractorium 0.9.9.4 Beta&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;A Qt-based fractal flame editor which uses a C++ re-write of the flam3 algorithm named Ember and a GPU capable version named EmberCL which implements a portion of the cuburn algorithm in OpenCL.&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;Lead: Matt Feemster&lt;br/&gt;Contributors: Simon Detheridge&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;br/&gt;Fractorium 0.9.9.5 Beta&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;A Qt-based fractal flame editor which uses a C++ re-write of the flam3 algorithm named Ember and a GPU capable version named EmberCL which implements a portion of the cuburn algorithm in OpenCL.&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;Lead: Matt Feemster&lt;br/&gt;Contributors: Simon Detheridge&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="textFormat"> <property name="textFormat">
<enum>Qt::RichText</enum> <enum>Qt::RichText</enum>
@ -122,7 +122,7 @@
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="text"> <property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;http://code.google.com/p/flam3&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;flam3&lt;/span&gt;&lt;/a&gt;: Scott Draves, Erik Reckase (GPL v2)&lt;br/&gt;&lt;a href=&quot;http://github.com/stevenrobertson/cuburn&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;cuburn&lt;/span&gt;&lt;/a&gt;: Steven Robertson, Michael Semeniuk, Matthew Znoj, Nicolas Mejia (GPL v3)&lt;br/&gt;&lt;a href=&quot;http://fractron9000.sourceforge.net&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Fractron 9000&lt;/span&gt;&lt;/a&gt;: Mike Thiesen (GPL)&lt;br/&gt;&lt;a href=&quot;http://sourceforge.net/projects/apophysis7x&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Apophysis&lt;/span&gt;&lt;/a&gt;: Mark Townsend, Ronald Hordijk, Peter Sdobnov, Piotr Borys, Georg Kiehne (GPL)&lt;br/&gt;&lt;a href=&quot;http://jwildfire.org/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;JWildfire&lt;/span&gt;&lt;/a&gt;: Andreas Maschke (LGPL)&lt;br/&gt;Numerous Apophysis plugin developers (GPL)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;https://github.com/scottdraves/flam3&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;flam3&lt;/span&gt;&lt;/a&gt;: Scott Draves, Erik Reckase (GPL v2)&lt;br/&gt;&lt;a href=&quot;http://github.com/stevenrobertson/cuburn&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;cuburn&lt;/span&gt;&lt;/a&gt;: Steven Robertson, Michael Semeniuk, Matthew Znoj, Nicolas Mejia (GPL v3)&lt;br/&gt;&lt;a href=&quot;http://fractron9000.sourceforge.net&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Fractron 9000&lt;/span&gt;&lt;/a&gt;: Mike Thiesen (GPL)&lt;br/&gt;&lt;a href=&quot;http://sourceforge.net/projects/apophysis7x&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Apophysis&lt;/span&gt;&lt;/a&gt;: Mark Townsend, Ronald Hordijk, Peter Sdobnov, Piotr Borys, Georg Kiehne (GPL)&lt;br/&gt;&lt;a href=&quot;http://jwildfire.org/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;JWildfire&lt;/span&gt;&lt;/a&gt;: Andreas Maschke (LGPL)&lt;br/&gt;Numerous Apophysis plugin developers (GPL)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="textFormat"> <property name="textFormat">
<enum>Qt::RichText</enum> <enum>Qt::RichText</enum>
@ -177,7 +177,7 @@
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="text"> <property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;http://qt-project.org&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Qt&lt;/span&gt;&lt;/a&gt;: Digia Plc (GPL v3, LGPL v2)&lt;br/&gt;&lt;a href=&quot;http://g-truc.net&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;glm&lt;/span&gt;&lt;/a&gt;: Christophe Riccio (MIT License)&lt;br/&gt;&lt;a href=&quot;http://threadingbuildingblocks.org&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Threading Building Blocks&lt;/span&gt;&lt;/a&gt;: Intel Corporation (GPLv2)&lt;br/&gt;&lt;a href=&quot;http://libjpeg.sourceforge.net&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;libjpeg&lt;/span&gt;&lt;/a&gt;: Independent JPEG Group (Free Software License)&lt;br/&gt;&lt;a href=&quot;http://libpng.org&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;libpng&lt;/span&gt;&lt;/a&gt;: Glenn Randers-Pehrson et al (Libpng License)&lt;br/&gt;&lt;a href=&quot;http://xmlsoft.org&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;libxml2&lt;/span&gt;&lt;/a&gt;: Daniel Veillard (MIT License)&lt;br/&gt;&lt;a href=&quot;http://zlib.net&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;zlib&lt;/span&gt;&lt;/a&gt;: Jean-loup Gailly, Mark Adler (Zlib License)&lt;br/&gt;&lt;a href=&quot;http://burtleburtle.net/bob/rand/isaac.html&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;QTIsaac&lt;/span&gt;&lt;/a&gt;: Robert J. Jenkins, Quinn Tyler Jackson (Public Domain)&lt;br/&gt;&lt;a href=&quot;http://cas.ee.ic.ac.uk/people/dt10/index.html&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;MWC64X Random Number Generator&lt;/span&gt;&lt;/a&gt;: David Thomas (Public Domain)&lt;br/&gt;&lt;a href=&quot;http://code.jellycan.com/simpleopt/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;SimpleOpt&lt;/span&gt;&lt;/a&gt;: Brodie Thiesfield (MIT License)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;http://www.qt.io/developers/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Qt&lt;/span&gt;&lt;/a&gt;: Digia Plc (GPL v3, LGPL v2)&lt;br/&gt;&lt;a href=&quot;http://g-truc.net&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;glm&lt;/span&gt;&lt;/a&gt;: Christophe Riccio (MIT License)&lt;br/&gt;&lt;a href=&quot;http://threadingbuildingblocks.org&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Threading Building Blocks&lt;/span&gt;&lt;/a&gt;: Intel Corporation (GPLv2)&lt;br/&gt;&lt;a href=&quot;http://libjpeg.sourceforge.net&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;libjpeg&lt;/span&gt;&lt;/a&gt;: Independent JPEG Group (Free Software License)&lt;br/&gt;&lt;a href=&quot;http://libpng.org&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;libpng&lt;/span&gt;&lt;/a&gt;: Glenn Randers-Pehrson et al (Libpng License)&lt;br/&gt;&lt;a href=&quot;http://xmlsoft.org&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;libxml2&lt;/span&gt;&lt;/a&gt;: Daniel Veillard (MIT License)&lt;br/&gt;&lt;a href=&quot;http://zlib.net&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;zlib&lt;/span&gt;&lt;/a&gt;: Jean-loup Gailly, Mark Adler (Zlib License)&lt;br/&gt;&lt;a href=&quot;http://burtleburtle.net/bob/cplus/isaac.hpp&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;QTIsaac&lt;/span&gt;&lt;/a&gt;: Robert J. Jenkins, Quinn Tyler Jackson (Public Domain)&lt;br/&gt;&lt;a href=&quot;http://cas.ee.ic.ac.uk/people/dt10/research/rngs-gpu-mwc64x.html&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;MWC64X Random Number Generator&lt;/span&gt;&lt;/a&gt;: David Thomas (Public Domain)&lt;br/&gt;&lt;a href=&quot;https://github.com/brofield/simpleopt&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;SimpleOpt&lt;/span&gt;&lt;/a&gt;: Brodie Thiesfield (MIT License)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="textFormat"> <property name="textFormat">
<enum>Qt::RichText</enum> <enum>Qt::RichText</enum>

View File

@ -105,7 +105,7 @@ Fractorium::Fractorium(QWidget* p)
#endif #endif
m_Controller = unique_ptr<FractoriumEmberControllerBase>(new FractoriumEmberController<float>(this)); m_Controller = unique_ptr<FractoriumEmberControllerBase>(new FractoriumEmberController<float>(this));
m_Controller->SetupVariationTree(); m_Controller->SetupVariationsTree();
m_Controller->FilteredVariations(); m_Controller->FilteredVariations();
if (m_Info->Ok() && m_Settings->OpenCL() && m_QualitySpin->value() < (30 * m_Settings->Devices().size())) if (m_Info->Ok() && m_Settings->OpenCL() && m_QualitySpin->value() < (30 * m_Settings->Devices().size()))
@ -424,7 +424,7 @@ void Fractorium::dropEvent(QDropEvent* e)
{ {
QStringList filenames; QStringList filenames;
Qt::KeyboardModifiers mod = e->keyboardModifiers(); Qt::KeyboardModifiers mod = e->keyboardModifiers();
bool append = mod.testFlag(Qt::ControlModifier) ? true : false; bool append = mod.testFlag(Qt::ControlModifier) ? false : true;
if (e->mimeData()->hasUrls()) if (e->mimeData()->hasUrls())
{ {

View File

@ -1892,14 +1892,14 @@
<rect> <rect>
<x>770</x> <x>770</x>
<y>0</y> <y>0</y>
<width>240</width> <width>255</width>
<height>881</height> <height>881</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>240</width> <width>255</width>
<height>498</height> <height>617</height>
</size> </size>
</property> </property>
<property name="features"> <property name="features">
@ -1925,7 +1925,7 @@
<property name="bottomMargin"> <property name="bottomMargin">
<number>4</number> <number>4</number>
</property> </property>
<item row="3" column="0"> <item row="6" column="0">
<widget class="TableWidget" name="PalettePreviewTable"> <widget class="TableWidget" name="PalettePreviewTable">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum"> <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
@ -2010,7 +2010,7 @@
<column/> <column/>
</widget> </widget>
</item> </item>
<item row="4" column="0"> <item row="7" column="0">
<layout class="QHBoxLayout" name="PaletteTabHLayout2" stretch="0,0"> <layout class="QHBoxLayout" name="PaletteTabHLayout2" stretch="0,0">
<property name="spacing"> <property name="spacing">
<number>5</number> <number>5</number>
@ -2058,7 +2058,7 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="5" column="0"> <item row="8" column="0">
<widget class="QTableWidget" name="PaletteListTable"> <widget class="QTableWidget" name="PaletteListTable">
<property name="focusPolicy"> <property name="focusPolicy">
<enum>Qt::StrongFocus</enum> <enum>Qt::StrongFocus</enum>
@ -2119,7 +2119,7 @@
<string>Name</string> <string>Name</string>
</property> </property>
<property name="textAlignment"> <property name="textAlignment">
<set>AlignLeft|AlignVCenter</set> <set>AlignLeading|AlignVCenter</set>
</property> </property>
</column> </column>
<column> <column>
@ -2127,7 +2127,7 @@
<string>Palette</string> <string>Palette</string>
</property> </property>
<property name="textAlignment"> <property name="textAlignment">
<set>AlignLeft|AlignVCenter</set> <set>AlignLeading|AlignVCenter</set>
</property> </property>
</column> </column>
</widget> </widget>
@ -2335,6 +2335,137 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="9" column="0">
<widget class="QPushButton" name="ResetCurvesButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Reset Curves</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="CurvesGraphicsView" name="CurvesView">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>245</width>
<height>245</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>245</width>
<height>245</height>
</size>
</property>
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="backgroundBrush">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>219</red>
<green>219</green>
<blue>219</blue>
</color>
</brush>
</property>
<property name="sceneRect">
<rectf>
<x>0.000000000000000</x>
<y>0.000000000000000</y>
<width>245.000000000000000</width>
<height>245.000000000000000</height>
</rectf>
</property>
<property name="resizeAnchor">
<enum>QGraphicsView::NoAnchor</enum>
</property>
<property name="viewportUpdateMode">
<enum>QGraphicsView::FullViewportUpdate</enum>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QGroupBox" name="CurvesGroupBox">
<property name="title">
<string>Curve</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="spacing">
<number>4</number>
</property>
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item>
<widget class="QRadioButton" name="CurvesAllRadio">
<property name="text">
<string>All</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="CurvesRedRadio">
<property name="text">
<string>Red</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="CurvesGreenRadio">
<property name="text">
<string>Green</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="CurvesBlueRadio">
<property name="text">
<string>Blue</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</widget> </widget>
@ -2746,12 +2877,12 @@
</column> </column>
<item row="0" column="0"> <item row="0" column="0">
<property name="textAlignment"> <property name="textAlignment">
<set>AlignLeft|AlignVCenter</set> <set>AlignLeading|AlignVCenter</set>
</property> </property>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<property name="textAlignment"> <property name="textAlignment">
<set>AlignLeft|AlignVCenter</set> <set>AlignLeading|AlignVCenter</set>
</property> </property>
</item> </item>
</widget> </widget>
@ -2934,7 +3065,7 @@
<string/> <string/>
</property> </property>
<property name="textAlignment"> <property name="textAlignment">
<set>AlignLeft|AlignVCenter</set> <set>AlignLeading|AlignVCenter</set>
</property> </property>
</item> </item>
</widget> </widget>
@ -3247,7 +3378,7 @@
</font> </font>
</property> </property>
<property name="textAlignment"> <property name="textAlignment">
<set>AlignLeft|AlignVCenter</set> <set>AlignLeading|AlignVCenter</set>
</property> </property>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
@ -3279,134 +3410,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="0" colspan="2">
<widget class="CurvesGraphicsView" name="CurvesView">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>245</width>
<height>245</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>245</width>
<height>245</height>
</size>
</property>
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="backgroundBrush">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>219</red>
<green>219</green>
<blue>219</blue>
</color>
</brush>
</property>
<property name="sceneRect">
<rectf>
<x>0.000000000000000</x>
<y>0.000000000000000</y>
<width>245.000000000000000</width>
<height>245.000000000000000</height>
</rectf>
</property>
<property name="resizeAnchor">
<enum>QGraphicsView::NoAnchor</enum>
</property>
<property name="viewportUpdateMode">
<enum>QGraphicsView::FullViewportUpdate</enum>
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<widget class="QGroupBox" name="CurvesGroupBox">
<property name="title">
<string>Curve</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item>
<widget class="QRadioButton" name="CurvesAllRadio">
<property name="text">
<string>All</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="CurvesRedRadio">
<property name="text">
<string>Red</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="CurvesGreenRadio">
<property name="text">
<string>Green</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="CurvesBlueRadio">
<property name="text">
<string>Blue</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="4" column="1">
<widget class="QPushButton" name="ResetCurvesButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Reset Curves</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="XformAffineTab"> <widget class="QWidget" name="XformAffineTab">
@ -5237,6 +5240,9 @@
<property name="editTriggers"> <property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set> <set>QAbstractItemView::NoEditTriggers</set>
</property> </property>
<property name="showDropIndicator" stdset="0">
<bool>false</bool>
</property>
<property name="selectionMode"> <property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum> <enum>QAbstractItemView::SingleSelection</enum>
</property> </property>
@ -5247,7 +5253,7 @@
<number>12</number> <number>12</number>
</property> </property>
<property name="uniformRowHeights"> <property name="uniformRowHeights">
<bool>false</bool> <bool>true</bool>
</property> </property>
<property name="itemsExpandable"> <property name="itemsExpandable">
<bool>true</bool> <bool>true</bool>
@ -5552,7 +5558,7 @@
<widget class="QDockWidget" name="InfoDockWidget"> <widget class="QDockWidget" name="InfoDockWidget">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>1010</x> <x>1020</x>
<y>0</y> <y>0</y>
<width>301</width> <width>301</width>
<height>881</height> <height>881</height>
@ -5662,7 +5668,7 @@
<enum>QTabWidget::Triangular</enum> <enum>QTabWidget::Triangular</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="InfoSummaryTab"> <widget class="QWidget" name="InfoSummaryTab">
<property name="autoFillBackground"> <property name="autoFillBackground">
@ -5861,7 +5867,7 @@
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="selectionMode"> <property name="selectionMode">
<enum>QAbstractItemView::NoSelection</enum> <enum>QAbstractItemView::SingleSelection</enum>
</property> </property>
<property name="rootIsDecorated"> <property name="rootIsDecorated">
<bool>true</bool> <bool>true</bool>
@ -5869,11 +5875,14 @@
<property name="uniformRowHeights"> <property name="uniformRowHeights">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="headerHidden">
<bool>false</bool>
</property>
<property name="columnCount"> <property name="columnCount">
<number>2</number> <number>2</number>
</property> </property>
<attribute name="headerVisible"> <attribute name="headerVisible">
<bool>false</bool> <bool>true</bool>
</attribute> </attribute>
<attribute name="headerCascadingSectionResizes"> <attribute name="headerCascadingSectionResizes">
<bool>false</bool> <bool>false</bool>
@ -6351,7 +6360,7 @@
</font> </font>
</property> </property>
<property name="textAlignment"> <property name="textAlignment">
<set>AlignLeft|AlignVCenter</set> <set>AlignLeading|AlignVCenter</set>
</property> </property>
</item> </item>
</widget> </widget>
@ -6713,7 +6722,7 @@
</widget> </widget>
<widget class="QToolBar" name="ToolBar"> <widget class="QToolBar" name="ToolBar">
<property name="windowTitle"> <property name="windowTitle">
<string>toolBar</string> <string>Toolbar</string>
</property> </property>
<property name="movable"> <property name="movable">
<bool>true</bool> <bool>true</bool>
@ -7202,10 +7211,10 @@
<normaloff>:/Fractorium/Icons/control-stop-square.png</normaloff>:/Fractorium/Icons/control-stop-square.png</iconset> <normaloff>:/Fractorium/Icons/control-stop-square.png</normaloff>:/Fractorium/Icons/control-stop-square.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Stop Renderer</string> <string>Stop renderer</string>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Stop Renderer</string> <string>Stop renderer</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+P</string> <string>Ctrl+P</string>

View File

@ -364,6 +364,7 @@ void FractoriumEmberController<T>::SetEmberPrivate(const Ember<U>& ember, bool v
m_GLController->ResetMouseState(); m_GLController->ResetMouseState();
FillXforms();//Must do this first because the palette setup in FillParamTablesAndPalette() uses the xforms combo. FillXforms();//Must do this first because the palette setup in FillParamTablesAndPalette() uses the xforms combo.
FillParamTablesAndPalette(); FillParamTablesAndPalette();
FillCurvesControl();
FillSummary(); FillSummary();
//If a resize happened, this won't do anything because the new size is not reflected in the scroll area yet. //If a resize happened, this won't do anything because the new size is not reflected in the scroll area yet.

View File

@ -186,7 +186,7 @@ public:
//Xforms Variations. //Xforms Variations.
virtual void Filter(const QString& text) { } virtual void Filter(const QString& text) { }
virtual void SetupVariationTree() { } virtual void SetupVariationsTree() { }
virtual void ClearVariationsTree() { } virtual void ClearVariationsTree() { }
virtual void VariationSpinBoxValueChanged(double d) { } virtual void VariationSpinBoxValueChanged(double d) { }
virtual void FilteredVariations() { } virtual void FilteredVariations() { }
@ -431,7 +431,7 @@ public:
//Xforms Variations. //Xforms Variations.
virtual void Filter(const QString& text) override; virtual void Filter(const QString& text) override;
virtual void SetupVariationTree() override; virtual void SetupVariationsTree() override;
virtual void ClearVariationsTree() override; virtual void ClearVariationsTree() override;
virtual void VariationSpinBoxValueChanged(double d) override; virtual void VariationSpinBoxValueChanged(double d) override;
virtual void FilteredVariations() override; virtual void FilteredVariations() override;

View File

@ -101,7 +101,7 @@ void FractoriumEmberController<T>::FillSummary()
item1->setText(0, "Xform " + item1->setText(0, "Xform " +
QString::number(x + 1) + QString::number(x + 1) +
" (" + QLocale::system().toString(xform->m_Weight, pc, p) + ") (" + " (" + QLocale::system().toString(xform->m_Weight, pc, p) + ") (" +
QLocale::system().toString(double(m_NormalizedWeights[index]), pc, p) + ") " + QLocale::system().toString(double(m_NormalizedWeights[index]), pc, p) + ")" +
linked); linked);
} }
else else

View File

@ -39,6 +39,12 @@ void Fractorium::InitPaletteUI()
paletteTable->setColumnWidth(1, 260);//256 plus small margin on each side. paletteTable->setColumnWidth(1, 260);//256 plus small margin on each side.
paletteTable->horizontalHeader()->setSectionsClickable(true); paletteTable->horizontalHeader()->setSectionsClickable(true);
connect(paletteTable->horizontalHeader(), SIGNAL(sectionClicked(int)), this, SLOT(OnPaletteHeaderSectionClicked(int)), Qt::QueuedConnection); connect(paletteTable->horizontalHeader(), SIGNAL(sectionClicked(int)), this, SLOT(OnPaletteHeaderSectionClicked(int)), Qt::QueuedConnection);
connect(ui.ResetCurvesButton, SIGNAL(clicked(bool)), this, SLOT(OnResetCurvesButtonClicked(bool)), Qt::QueuedConnection);
connect(ui.CurvesView, SIGNAL(PointChangedSignal(int, int, const QPointF&)), this, SLOT(OnCurvesPointChanged(int, int, const QPointF&)), Qt::QueuedConnection);
connect(ui.CurvesAllRadio, SIGNAL(toggled(bool)), this, SLOT(OnCurvesAllRadioButtonToggled(bool)), Qt::QueuedConnection);
connect(ui.CurvesRedRadio, SIGNAL(toggled(bool)), this, SLOT(OnCurvesRedRadioButtonToggled(bool)), Qt::QueuedConnection);
connect(ui.CurvesGreenRadio, SIGNAL(toggled(bool)), this, SLOT(OnCurvesGreenRadioButtonToggled(bool)), Qt::QueuedConnection);
connect(ui.CurvesBlueRadio, SIGNAL(toggled(bool)), this, SLOT(OnCurvesBlueRadioButtonToggled(bool)), Qt::QueuedConnection);
} }
/// <summary> /// <summary>
@ -379,6 +385,75 @@ void Fractorium::SetPaletteFileComboIndex(const string& filename)
ui.PaletteFilenameCombo->setCurrentText(QFileInfo(QString::fromStdString(filename)).fileName()); ui.PaletteFilenameCombo->setCurrentText(QFileInfo(QString::fromStdString(filename)).fileName());
} }
/// <summary>
/// Reset the color curve values in the current ember to their default state and also update the curves control.
/// Called when ResetCurvesButton is clicked.
/// Resets the rendering process at either ACCUM_ONLY by default, or FILTER_AND_ACCUM when using early clip.
/// </summary>
template <typename T>
void FractoriumEmberController<T>::ClearColorCurves()
{
Update([&]
{
m_Ember.m_Curves.Init();
}, true, m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY);
FillCurvesControl();
}
void Fractorium::OnResetCurvesButtonClicked(bool checked) { m_Controller->ClearColorCurves(); }
/// <summary>
/// Set the coordinate of the curve point.
/// Called when the position of any of the points in the curves editor is is changed.
/// Resets the rendering process at either ACCUM_ONLY by default, or FILTER_AND_ACCUM when using early clip.
/// </summary>
/// <param name="curveIndex">The curve index, 0-1/</param>
/// <param name="pointIndex">The point index within the selected curve, 1-2.</param>
/// <param name="point">The new coordinate of the point in terms of the curves control rect.</param>
template <typename T>
void FractoriumEmberController<T>::ColorCurveChanged(int curveIndex, int pointIndex, const QPointF& point)
{
Update([&]
{
m_Ember.m_Curves.m_Points[curveIndex][pointIndex].x = point.x();
m_Ember.m_Curves.m_Points[curveIndex][pointIndex].y = point.y();
}, true, m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY);
}
void Fractorium::OnCurvesPointChanged(int curveIndex, int pointIndex, const QPointF& point) { m_Controller->ColorCurveChanged(curveIndex, pointIndex, point); }
/// <summary>
/// Set the top most points in the curves control, which makes it easier to
/// select a point by putting it on top of all the others.
/// Called when the any of the curve color radio buttons are toggled.
/// </summary>
/// <param name="curveIndex">The curve index, 0-1/</param>
void Fractorium::OnCurvesAllRadioButtonToggled(bool checked) { if (checked) ui.CurvesView->SetTop(CurveIndex::ALL); }
void Fractorium::OnCurvesRedRadioButtonToggled(bool checked) { if (checked) ui.CurvesView->SetTop(CurveIndex::RED); }
void Fractorium::OnCurvesGreenRadioButtonToggled(bool checked) { if (checked) ui.CurvesView->SetTop(CurveIndex::GREEN); }
void Fractorium::OnCurvesBlueRadioButtonToggled(bool checked) { if (checked) ui.CurvesView->SetTop(CurveIndex::BLUE); }
/// <summary>
/// Set the points in the curves control to the values of the curve points in the current ember.
/// </summary>
template <typename T>
void FractoriumEmberController<T>::FillCurvesControl()
{
m_Fractorium->ui.CurvesView->blockSignals(true);
for (auto i = 0; i < 4; i++)
{
for (auto j = 1; j < 3; j++)//Only do middle points.
{
QPointF point(m_Ember.m_Curves.m_Points[i][j].x, m_Ember.m_Curves.m_Points[i][j].y);
m_Fractorium->ui.CurvesView->Set(i, j, point);
}
}
m_Fractorium->ui.CurvesView->blockSignals(false);
m_Fractorium->ui.CurvesView->update();
}
template class FractoriumEmberController<float>; template class FractoriumEmberController<float>;
#ifdef DO_DOUBLE #ifdef DO_DOUBLE

View File

@ -47,7 +47,7 @@ void Fractorium::InitParamsUI()
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_CenterXSpin, spinHeight, -dmax, dmax, 0.05, SIGNAL(valueChanged(double)), SLOT(OnCenterXChanged(double)), true, 0, 0, 0); SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_CenterXSpin, spinHeight, -dmax, dmax, 0.05, SIGNAL(valueChanged(double)), SLOT(OnCenterXChanged(double)), true, 0, 0, 0);
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_CenterYSpin, spinHeight, -dmax, dmax, 0.05, SIGNAL(valueChanged(double)), SLOT(OnCenterYChanged(double)), true, 0, 0, 0); SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_CenterYSpin, spinHeight, -dmax, dmax, 0.05, SIGNAL(valueChanged(double)), SLOT(OnCenterYChanged(double)), true, 0, 0, 0);
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_ScaleSpin, spinHeight, 10, dmax, 20, SIGNAL(valueChanged(double)), SLOT(OnScaleChanged(double)), true, 240, 240, 240); SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_ScaleSpin, spinHeight, 10, dmax, 20, SIGNAL(valueChanged(double)), SLOT(OnScaleChanged(double)), true, 240, 240, 240);
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_ZoomSpin, spinHeight, 0, 100, 0.2, SIGNAL(valueChanged(double)), SLOT(OnZoomChanged(double)), true, 0, 0, 0); SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_ZoomSpin, spinHeight, 0, 25, 0.2, SIGNAL(valueChanged(double)), SLOT(OnZoomChanged(double)), true, 0, 0, 0);
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_RotateSpin, spinHeight, -180, 180, 10, SIGNAL(valueChanged(double)), SLOT(OnRotateChanged(double)), true, 0, 0, 0); SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_RotateSpin, spinHeight, -180, 180, 10, SIGNAL(valueChanged(double)), SLOT(OnRotateChanged(double)), true, 0, 0, 0);
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_ZPosSpin, spinHeight, -1000, 1000, 1, SIGNAL(valueChanged(double)), SLOT(OnZPosChanged(double)), true, 0, 1, 0); SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_ZPosSpin, spinHeight, -1000, 1000, 1, SIGNAL(valueChanged(double)), SLOT(OnZPosChanged(double)), true, 0, 1, 0);
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_PerspectiveSpin, spinHeight, -500, 500, 0.01, SIGNAL(valueChanged(double)), SLOT(OnPerspectiveChanged(double)), true, 0, 1, 0); SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_PerspectiveSpin, spinHeight, -500, 500, 0.01, SIGNAL(valueChanged(double)), SLOT(OnPerspectiveChanged(double)), true, 0, 1, 0);
@ -63,7 +63,7 @@ void Fractorium::InitParamsUI()
//Filter. //Filter.
row = 0; row = 0;
table = ui.FilterTable; table = ui.FilterTable;
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_SpatialFilterWidthSpin, spinHeight, 0.1, 10, 0.1, SIGNAL(valueChanged(double)), SLOT(OnSpatialFilterWidthChanged(double)), true, 1.0, 1.0, 1.0); SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_SpatialFilterWidthSpin, spinHeight, 0.1, 2, 0.1, SIGNAL(valueChanged(double)), SLOT(OnSpatialFilterWidthChanged(double)), true, 1.0, 1.0, 1.0);
comboVals = SpatialFilterCreator<float>::FilterTypes(); comboVals = SpatialFilterCreator<float>::FilterTypes();
SetupCombo(table, this, row, 1, m_SpatialFilterTypeCombo, comboVals, SIGNAL(currentIndexChanged(const QString&)), SLOT(OnSpatialFilterTypeComboCurrentIndexChanged(const QString&))); SetupCombo(table, this, row, 1, m_SpatialFilterTypeCombo, comboVals, SIGNAL(currentIndexChanged(const QString&)), SLOT(OnSpatialFilterTypeComboCurrentIndexChanged(const QString&)));
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_DEFilterMinRadiusSpin, spinHeight, 0, 25, 1, SIGNAL(valueChanged(double)), SLOT(OnDEFilterMinRadiusWidthChanged(double)), true, 0, 0, 0); SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_DEFilterMinRadiusSpin, spinHeight, 0, 25, 1, SIGNAL(valueChanged(double)), SLOT(OnDEFilterMinRadiusWidthChanged(double)), true, 0, 0, 0);
@ -116,7 +116,7 @@ void Fractorium::OnBrightnessChanged(double d) { m_Controller->BrightnessChanged
/// else if early clip is true, filter and accum, else final accum only. /// else if early clip is true, filter and accum, else final accum only.
/// </summary> /// </summary>
/// <param name="d">The gamma value</param> /// <param name="d">The gamma value</param>
template <typename T> void FractoriumEmberController<T>::GammaChanged(double d) { Update([&] { m_Ember.m_Gamma = d; }, true, m_Ember.m_TemporalSamples > 1 ? eProcessAction::FULL_RENDER : (m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY)); } template <typename T> void FractoriumEmberController<T>::GammaChanged(double d) { Update([&] { m_Ember.m_Gamma = d; }, true, m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY); }
void Fractorium::OnGammaChanged(double d) { m_Controller->GammaChanged(d); } void Fractorium::OnGammaChanged(double d) { m_Controller->GammaChanged(d); }
/// <summary> /// <summary>
@ -125,7 +125,7 @@ void Fractorium::OnGammaChanged(double d) { m_Controller->GammaChanged(d); }
/// Resets the rendering process to the final accumulation stage. /// Resets the rendering process to the final accumulation stage.
/// </summary> /// </summary>
/// <param name="d">The gamma threshold</param> /// <param name="d">The gamma threshold</param>
template <typename T> void FractoriumEmberController<T>::GammaThresholdChanged(double d) { Update([&] { m_Ember.m_GammaThresh = d; }, true, m_Ember.m_TemporalSamples > 1 ? eProcessAction::FULL_RENDER : (m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY)); } template <typename T> void FractoriumEmberController<T>::GammaThresholdChanged(double d) { Update([&] { m_Ember.m_GammaThresh = d; }, true, m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY); }
void Fractorium::OnGammaThresholdChanged(double d) { m_Controller->GammaThresholdChanged(d); } void Fractorium::OnGammaThresholdChanged(double d) { m_Controller->GammaThresholdChanged(d); }
/// <summary> /// <summary>
@ -134,7 +134,7 @@ void Fractorium::OnGammaThresholdChanged(double d) { m_Controller->GammaThreshol
/// Resets the rendering process to the final accumulation stage if temporal samples is 1, else full reset. /// Resets the rendering process to the final accumulation stage if temporal samples is 1, else full reset.
/// </summary> /// </summary>
/// <param name="d">The vibrancy</param> /// <param name="d">The vibrancy</param>
template <typename T> void FractoriumEmberController<T>::VibrancyChanged(double d) { Update([&] { m_Ember.m_Vibrancy = d; }, true, m_Ember.m_TemporalSamples > 1 ? eProcessAction::FULL_RENDER : (m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY)); } template <typename T> void FractoriumEmberController<T>::VibrancyChanged(double d) { Update([&] { m_Ember.m_Vibrancy = d; }, true, m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY); }
void Fractorium::OnVibrancyChanged(double d) { m_Controller->VibrancyChanged(d); } void Fractorium::OnVibrancyChanged(double d) { m_Controller->VibrancyChanged(d); }
/// <summary> /// <summary>
@ -143,7 +143,7 @@ void Fractorium::OnVibrancyChanged(double d) { m_Controller->VibrancyChanged(d);
/// Resets the rendering process to the final accumulation stage. /// Resets the rendering process to the final accumulation stage.
/// </summary> /// </summary>
/// <param name="d">The highlight power</param> /// <param name="d">The highlight power</param>
template <typename T> void FractoriumEmberController<T>::HighlightPowerChanged(double d) { Update([&] { m_Ember.m_HighlightPower = d; }, true, m_Ember.m_TemporalSamples > 1 ? eProcessAction::FULL_RENDER : (m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY)); } template <typename T> void FractoriumEmberController<T>::HighlightPowerChanged(double d) { Update([&] { m_Ember.m_HighlightPower = d; }, true, m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY); }
void Fractorium::OnHighlightPowerChanged(double d) { m_Controller->HighlightPowerChanged(d); } void Fractorium::OnHighlightPowerChanged(double d) { m_Controller->HighlightPowerChanged(d); }
/// <summary> /// <summary>
@ -286,19 +286,33 @@ void Fractorium::OnDepthBlurChanged(double d) { m_Controller->DepthBlurChanged(d
/// <summary> /// <summary>
/// Set the spatial filter width. /// Set the spatial filter width.
/// Called when the spatial filter width spinner is changed. /// Called when the spatial filter width spinner is changed.
/// Resets the rendering process. /// Resets the rendering process to density filtering if early clip is used, else to final accumulation.
/// </summary> /// </summary>
/// <param name="d">The spatial filter width</param> /// <param name="d">The spatial filter width</param>
template <typename T> void FractoriumEmberController<T>::SpatialFilterWidthChanged(double d) { Update([&] { m_Ember.m_SpatialFilterRadius = d; }); }//Must fully reset because it's used to create bounds. template <typename T> void FractoriumEmberController<T>::SpatialFilterWidthChanged(double d)
{
Update([&]
{
m_Ember.m_SpatialFilterRadius = d;
}, true, m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY);
}
void Fractorium::OnSpatialFilterWidthChanged(double d) { m_Controller->SpatialFilterWidthChanged(d); } void Fractorium::OnSpatialFilterWidthChanged(double d) { m_Controller->SpatialFilterWidthChanged(d); }
/// <summary> /// <summary>
/// Set the spatial filter type. /// Set the spatial filter type.
/// Called when the spatial filter type combo box index is changed. /// Called when the spatial filter type combo box index is changed.
/// Resets the rendering process. /// Resets the rendering process to density filtering if early clip is used, else to final accumulation.
/// </summary> /// </summary>
/// <param name="text">The spatial filter type</param> /// <param name="text">The spatial filter type</param>
template <typename T> void FractoriumEmberController<T>::SpatialFilterTypeChanged(const QString& text) { Update([&] { m_Ember.m_SpatialFilterType = SpatialFilterCreator<T>::FromString(text.toStdString()); }); }//Must fully reset because it's used to create bounds. template <typename T> void FractoriumEmberController<T>::SpatialFilterTypeChanged(const QString& text)
{
Update([&]
{
m_Ember.m_SpatialFilterType = SpatialFilterCreator<T>::FromString(text.toStdString());
}, true, m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY);
}
void Fractorium::OnSpatialFilterTypeComboCurrentIndexChanged(const QString& text) { m_Controller->SpatialFilterTypeChanged(text); } void Fractorium::OnSpatialFilterTypeComboCurrentIndexChanged(const QString& text) { m_Controller->SpatialFilterTypeChanged(text); }
/// <summary> /// <summary>
@ -323,54 +337,61 @@ void Fractorium::OnTemporalFilterTypeComboCurrentIndexChanged(const QString& tex
/// <summary> /// <summary>
/// Set the density estimation filter min radius value. /// Set the density estimation filter min radius value.
/// Resets the rendering process. /// Resets the rendering process to density filtering.
/// </summary> /// </summary>
/// <param name="d">The min radius value</param> /// <param name="d">The min radius value</param>
template <typename T> template <typename T>
void FractoriumEmberController<T>::DEFilterMinRadiusWidthChanged(double d) void FractoriumEmberController<T>::DEFilterMinRadiusWidthChanged(double d)
{ {
Update([&]
{
if (m_Fractorium->m_DEFilterMinRadiusSpin->value() > m_Fractorium->m_DEFilterMaxRadiusSpin->value()) if (m_Fractorium->m_DEFilterMinRadiusSpin->value() > m_Fractorium->m_DEFilterMaxRadiusSpin->value())
{ {
m_Fractorium->m_DEFilterMinRadiusSpin->setValue(m_Fractorium->m_DEFilterMaxRadiusSpin->value() - 1); m_Fractorium->m_DEFilterMinRadiusSpin->SetValueStealth(m_Fractorium->m_DEFilterMaxRadiusSpin->value());
return; return;
} }
Update([&]
{
m_Ember.m_MinRadDE = d; m_Ember.m_MinRadDE = d;
}); }, true, eProcessAction::FILTER_AND_ACCUM);
} }
void Fractorium::OnDEFilterMinRadiusWidthChanged(double d) { m_Controller->DEFilterMinRadiusWidthChanged(d); } void Fractorium::OnDEFilterMinRadiusWidthChanged(double d) { m_Controller->DEFilterMinRadiusWidthChanged(d); }
/// <summary> /// <summary>
/// Set the density estimation filter max radius value. /// Set the density estimation filter max radius value.
/// Resets the rendering process. /// Resets the rendering process to density filtering.
/// </summary> /// </summary>
/// <param name="d">The max radius value</param> /// <param name="d">The max radius value</param>
template <typename T> template <typename T>
void FractoriumEmberController<T>::DEFilterMaxRadiusWidthChanged(double d) void FractoriumEmberController<T>::DEFilterMaxRadiusWidthChanged(double d)
{ {
Update([&]
{
if (m_Fractorium->m_DEFilterMaxRadiusSpin->value() < m_Fractorium->m_DEFilterMinRadiusSpin->value()) if (m_Fractorium->m_DEFilterMaxRadiusSpin->value() < m_Fractorium->m_DEFilterMinRadiusSpin->value())
{ {
m_Fractorium->m_DEFilterMaxRadiusSpin->setValue(m_Fractorium->m_DEFilterMinRadiusSpin->value() + 1); m_Fractorium->m_DEFilterMaxRadiusSpin->SetValueStealth(m_Fractorium->m_DEFilterMinRadiusSpin->value());
return; return;
} }
Update([&]
{
m_Ember.m_MaxRadDE = d; m_Ember.m_MaxRadDE = d;
}); }, true, eProcessAction::FILTER_AND_ACCUM);
} }
void Fractorium::OnDEFilterMaxRadiusWidthChanged(double d) { m_Controller->DEFilterMaxRadiusWidthChanged(d); } void Fractorium::OnDEFilterMaxRadiusWidthChanged(double d) { m_Controller->DEFilterMaxRadiusWidthChanged(d); }
/// <summary> /// <summary>
/// Set the density estimation filter curve value. /// Set the density estimation filter curve value.
/// Resets the rendering process. /// Resets the rendering process to density filtering.
/// </summary> /// </summary>
/// <param name="d">The curve value</param> /// <param name="d">The curve value</param>
template <typename T> void FractoriumEmberController<T>::DEFilterCurveWidthChanged(double d) { Update([&] { m_Ember.m_CurveDE = d; }); } template <typename T> void FractoriumEmberController<T>::DEFilterCurveWidthChanged(double d)
{
Update([&]
{
m_Ember.m_CurveDE = d;
}, true, eProcessAction::FILTER_AND_ACCUM);
}
void Fractorium::OnDEFilterCurveWidthChanged(double d) { m_Controller->DEFilterCurveWidthChanged(d); } void Fractorium::OnDEFilterCurveWidthChanged(double d) { m_Controller->DEFilterCurveWidthChanged(d); }
/// <summary> /// <summary>

View File

@ -377,7 +377,7 @@ bool FractoriumEmberController<T>::Render()
//Change later if better values can be derived/observed. //Change later if better values can be derived/observed.
if (m_Renderer->RendererType() == eRendererType::OPENCL_RENDERER) if (m_Renderer->RendererType() == eRendererType::OPENCL_RENDERER)
{ {
if (m_SubBatchCount < (4 * m_Devices.size()))//More than 3 with OpenCL gives a sluggish UI. if (m_SubBatchCount < (4 * m_Devices.size()))//More than 4 with OpenCL gives a sluggish UI.
m_SubBatchCount += m_Devices.size(); m_SubBatchCount += m_Devices.size();
} }
else else

View File

@ -338,6 +338,7 @@ void FractoriumEmberController<T>::XformNameChanged(int row, int col)
xform->m_Name = m_Fractorium->ui.XformWeightNameTable->item(row, col)->text().toStdString(); xform->m_Name = m_Fractorium->ui.XformWeightNameTable->item(row, col)->text().toStdString();
XformCheckboxAt(index, [&](QCheckBox * checkbox) { checkbox->setText(MakeXformCaption(index)); }); XformCheckboxAt(index, [&](QCheckBox * checkbox) { checkbox->setText(MakeXformCaption(index)); });
}, eXformUpdate::UPDATE_CURRENT, false); }, eXformUpdate::UPDATE_CURRENT, false);
FillSummary();//Manually update because this does not trigger a render, which is where this would normally be called.
} }
void Fractorium::OnXformNameChanged(int row, int col) { m_Controller->XformNameChanged(row, col); } void Fractorium::OnXformNameChanged(int row, int col) { m_Controller->XformNameChanged(row, col); }

View File

@ -23,12 +23,6 @@ void Fractorium::InitXformsColorUI()
m_XformDirectColorSpin->setDecimals(3); m_XformDirectColorSpin->setDecimals(3);
connect(ui.XformColorScroll, SIGNAL(valueChanged(int)), this, SLOT(OnXformScrollColorIndexChanged(int)), Qt::QueuedConnection); connect(ui.XformColorScroll, SIGNAL(valueChanged(int)), this, SLOT(OnXformScrollColorIndexChanged(int)), Qt::QueuedConnection);
connect(ui.SoloXformCheckBox, SIGNAL(stateChanged(int)), this, SLOT(OnSoloXformCheckBoxStateChanged(int)), Qt::QueuedConnection); connect(ui.SoloXformCheckBox, SIGNAL(stateChanged(int)), this, SLOT(OnSoloXformCheckBoxStateChanged(int)), Qt::QueuedConnection);
connect(ui.ResetCurvesButton, SIGNAL(clicked(bool)), this, SLOT(OnResetCurvesButtonClicked(bool)), Qt::QueuedConnection);
connect(ui.CurvesView, SIGNAL(PointChangedSignal(int, int, const QPointF&)), this, SLOT(OnCurvesPointChanged(int, int, const QPointF&)), Qt::QueuedConnection);
connect(ui.CurvesAllRadio, SIGNAL(toggled(bool)), this, SLOT(OnCurvesAllRadioButtonToggled(bool)), Qt::QueuedConnection);
connect(ui.CurvesRedRadio, SIGNAL(toggled(bool)), this, SLOT(OnCurvesRedRadioButtonToggled(bool)), Qt::QueuedConnection);
connect(ui.CurvesGreenRadio, SIGNAL(toggled(bool)), this, SLOT(OnCurvesGreenRadioButtonToggled(bool)), Qt::QueuedConnection);
connect(ui.CurvesBlueRadio, SIGNAL(toggled(bool)), this, SLOT(OnCurvesBlueRadioButtonToggled(bool)), Qt::QueuedConnection);
} }
/// <summary> /// <summary>
@ -147,54 +141,6 @@ void Fractorium::OnXformRefPaletteResized(int logicalIndex, int oldSize, int new
SetPaletteTableItem(&pixmap, ui.XformPaletteRefTable, m_PaletteRefItem, 0, 0); SetPaletteTableItem(&pixmap, ui.XformPaletteRefTable, m_PaletteRefItem, 0, 0);
} }
/// <summary>
/// Reset the color curve values in the current ember to their default state and also update the curves control.
/// Called when ResetCurvesButton is clicked.
/// Resets the rendering process at either ACCUM_ONLY by default, or FILTER_AND_ACCUM when using early clip.
/// </summary>
template <typename T>
void FractoriumEmberController<T>::ClearColorCurves()
{
Update([&]
{
m_Ember.m_Curves.Init();
}, true, m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY);
FillCurvesControl();
}
void Fractorium::OnResetCurvesButtonClicked(bool checked) { m_Controller->ClearColorCurves(); }
/// <summary>
/// Set the coordinate of the curve point.
/// Called when the position of any of the points in the curves editor is is changed.
/// Resets the rendering process at either ACCUM_ONLY by default, or FILTER_AND_ACCUM when using early clip.
/// </summary>
/// <param name="curveIndex">The curve index, 0-1/</param>
/// <param name="pointIndex">The point index within the selected curve, 1-2.</param>
/// <param name="point">The new coordinate of the point in terms of the curves control rect.</param>
template <typename T>
void FractoriumEmberController<T>::ColorCurveChanged(int curveIndex, int pointIndex, const QPointF& point)
{
Update([&]
{
m_Ember.m_Curves.m_Points[curveIndex][pointIndex].x = point.x();
m_Ember.m_Curves.m_Points[curveIndex][pointIndex].y = point.y();
}, true, m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY);
}
void Fractorium::OnCurvesPointChanged(int curveIndex, int pointIndex, const QPointF& point) { m_Controller->ColorCurveChanged(curveIndex, pointIndex, point); }
/// <summary>
/// Set the top most points in the curves control, which makes it easier to
/// select a point by putting it on top of all the others.
/// Called when the any of the curve color radio buttons are toggled.
/// </summary>
/// <param name="curveIndex">The curve index, 0-1/</param>
void Fractorium::OnCurvesAllRadioButtonToggled(bool checked) { if (checked) ui.CurvesView->SetTop(CurveIndex::ALL); }
void Fractorium::OnCurvesRedRadioButtonToggled(bool checked) { if (checked) ui.CurvesView->SetTop(CurveIndex::RED); }
void Fractorium::OnCurvesGreenRadioButtonToggled(bool checked) { if (checked) ui.CurvesView->SetTop(CurveIndex::GREEN); }
void Fractorium::OnCurvesBlueRadioButtonToggled(bool checked) { if (checked) ui.CurvesView->SetTop(CurveIndex::BLUE); }
/// <summary> /// <summary>
/// Look up the passed in index in the current ember's palette /// Look up the passed in index in the current ember's palette
/// and return the QColor equivalent. /// and return the QColor equivalent.
@ -212,27 +158,6 @@ QColor FractoriumEmberController<T>::ColorIndexToQColor(double d)
return QColor::fromRgb(rgb); return QColor::fromRgb(rgb);
} }
/// <summary>
/// Set the points in the curves control to the values of the curve points in the current ember.
/// </summary>
template <typename T>
void FractoriumEmberController<T>::FillCurvesControl()
{
m_Fractorium->ui.CurvesView->blockSignals(true);
for (auto i = 0; i < 4; i++)
{
for (auto j = 1; j < 3; j++)//Only do middle points.
{
QPointF point(m_Ember.m_Curves.m_Points[i][j].x, m_Ember.m_Curves.m_Points[i][j].y);
m_Fractorium->ui.CurvesView->Set(i, j, point);
}
}
m_Fractorium->ui.CurvesView->blockSignals(false);
m_Fractorium->ui.CurvesView->update();
}
/// <summary> /// <summary>
/// Set the color index, speed and opacity spinners with the values of the passed in xform. /// Set the color index, speed and opacity spinners with the values of the passed in xform.
/// Set the cells of the palette ref table as well. /// Set the cells of the palette ref table as well.
@ -245,7 +170,6 @@ void FractoriumEmberController<T>::FillColorWithXform(Xform<T>* xform)
m_Fractorium->m_XformColorSpeedSpin->SetValueStealth(xform->m_ColorSpeed); m_Fractorium->m_XformColorSpeedSpin->SetValueStealth(xform->m_ColorSpeed);
m_Fractorium->m_XformOpacitySpin->SetValueStealth(xform->m_Opacity); m_Fractorium->m_XformOpacitySpin->SetValueStealth(xform->m_Opacity);
m_Fractorium->m_XformDirectColorSpin->SetValueStealth(xform->m_DirectColor); m_Fractorium->m_XformDirectColorSpin->SetValueStealth(xform->m_DirectColor);
FillCurvesControl();
m_Fractorium->OnXformColorIndexChanged(xform->m_ColorX, false);//Had to call stealth before to avoid doing an update, now manually update related controls, still without doing an update. m_Fractorium->OnXformColorIndexChanged(xform->m_ColorX, false);//Had to call stealth before to avoid doing an update, now manually update related controls, still without doing an update.
} }

View File

@ -97,7 +97,7 @@ void FractoriumEmberController<T>::FilteredVariations()
/// Called upon initialization, or controller type change. /// Called upon initialization, or controller type change.
/// </summary> /// </summary>
template <typename T> template <typename T>
void FractoriumEmberController<T>::SetupVariationTree() void FractoriumEmberController<T>::SetupVariationsTree()
{ {
T fMin = TLOW; T fMin = TLOW;
T fMax = TMAX; T fMax = TMAX;

View File

@ -43,7 +43,7 @@ void GLWidget::InitGL()
SetDimensions(w, h); SetDimensions(w, h);
m_Fractorium->m_WidthSpin->setValue(w); m_Fractorium->m_WidthSpin->setValue(w);
m_Fractorium->m_HeightSpin->setValue(h); m_Fractorium->m_HeightSpin->setValue(h);
//Start with a flock of 10 random embers. Can't do this until now because the window wasn't maximized yet, so the sizes would have been off. //Start with a flock of random embers. Can't do this until now because the window wasn't maximized yet, so the sizes would have been off.
m_Fractorium->OnActionNewFlock(false); m_Fractorium->OnActionNewFlock(false);
m_Fractorium->m_Controller->DelayedStartRenderTimer(); m_Fractorium->m_Controller->DelayedStartRenderTimer();
m_Init = true; m_Init = true;

View File

@ -155,7 +155,7 @@
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Checked: show all xforms while dragging.&lt;/p&gt;&lt;p&gt;Unchecked: only show current xform while dragging.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Checked: show all xforms while dragging.&lt;/p&gt;&lt;p&gt;Unchecked: only show current xform while dragging.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="text"> <property name="text">
<string>Show All Xforms</string> <string>Show All Xforms While Dragging</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -421,7 +421,7 @@ in interactive mode for each mouse movement</string>
<bool>true</bool> <bool>true</bool>
</property> </property>
<attribute name="title"> <attribute name="title">
<string>Xml Saving</string> <string>Xml Render Values</string>
</attribute> </attribute>
<layout class="QFormLayout" name="formLayout_2"> <layout class="QFormLayout" name="formLayout_2">
<property name="leftMargin"> <property name="leftMargin">
@ -614,7 +614,7 @@ in interactive mode for each mouse movement</string>
<bool>true</bool> <bool>true</bool>
</property> </property>
<attribute name="title"> <attribute name="title">
<string>Identity</string> <string>Xml Identity Values</string>
</attribute> </attribute>
<layout class="QFormLayout" name="formLayout_3"> <layout class="QFormLayout" name="formLayout_3">
<property name="leftMargin"> <property name="leftMargin">