2014-12-11 00:50:15 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "FractoriumPch.h"
|
2016-12-05 22:04:33 -05:00
|
|
|
#include "FractoriumSettings.h"
|
--User changes
-Add a palette editor.
-Add support for reading .ugr/.gradient/.gradients palette files.
-Allow toggling on spinners whose minimum value is not zero.
-Allow toggling display of image, affines and grid.
-Add new variations: cylinder2, circlesplit, tile_log, truchet_fill, waves2_radial.
--Bug fixes
-cpow2 was wrong.
-Palettes with rapid changes in color would produce slightly different outputs from Apo/Chaotica. This was due to a long standing bug from flam3.
-Use exec() on Apple and show() on all other OSes for dialog boxes.
-Trying to render a sequence with no frames would crash.
-Selecting multiple xforms and rotating them would produce the wrong rotation.
-Better handling when parsing flames using different encoding, such as unicode and UTF-8.
-Switching between SP/DP didn't reselect the selected flame in the Library tab.
--Code changes
-Make all types concerning palettes be floats, including PaletteTableWidgetItem.
-PaletteTableWidgetItem is no longer templated because all palettes are float.
-Include the source colors for user created gradients.
-Change parallel_for() calls to work with very old versions of TBB which are lingering on some systems.
-Split conditional out of accumulation loop on the CPU for better performance.
-Vectorize summing when doing density filter for better performance.
-Make all usage of palettes be of type float, double is pointless.
-Allow palettes to reside in multiple folders, while ensuring only one of each name is added.
-Refactor some palette path searching code.
-Make ReadFile() throw and catch an exception if the file operation fails.
-A little extra safety in foci and foci3D with a call to Zeps().
-Cast to (real_t) in the OpenCL string for the w variation, which was having trouble compiling on Mac.
-Fixing missing comma between paths in InitPaletteList().
-Move Xml and PaletteList classes into cpp to shorten build times when working on them.
-Remove default param values for IterOpenCLKernelCreator<T>::SharedDataIndexDefines in cpp file.
-Change more NULL to nullptr.
2017-02-26 03:02:21 -05:00
|
|
|
#include "PaletteTableWidgetItem.h"
|
2014-12-11 00:50:15 -05:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Fractorium global utility functions.
|
|
|
|
/// </summary>
|
--User changes
-Add a palette editor.
-Add support for reading .ugr/.gradient/.gradients palette files.
-Allow toggling on spinners whose minimum value is not zero.
-Allow toggling display of image, affines and grid.
-Add new variations: cylinder2, circlesplit, tile_log, truchet_fill, waves2_radial.
--Bug fixes
-cpow2 was wrong.
-Palettes with rapid changes in color would produce slightly different outputs from Apo/Chaotica. This was due to a long standing bug from flam3.
-Use exec() on Apple and show() on all other OSes for dialog boxes.
-Trying to render a sequence with no frames would crash.
-Selecting multiple xforms and rotating them would produce the wrong rotation.
-Better handling when parsing flames using different encoding, such as unicode and UTF-8.
-Switching between SP/DP didn't reselect the selected flame in the Library tab.
--Code changes
-Make all types concerning palettes be floats, including PaletteTableWidgetItem.
-PaletteTableWidgetItem is no longer templated because all palettes are float.
-Include the source colors for user created gradients.
-Change parallel_for() calls to work with very old versions of TBB which are lingering on some systems.
-Split conditional out of accumulation loop on the CPU for better performance.
-Vectorize summing when doing density filter for better performance.
-Make all usage of palettes be of type float, double is pointless.
-Allow palettes to reside in multiple folders, while ensuring only one of each name is added.
-Refactor some palette path searching code.
-Make ReadFile() throw and catch an exception if the file operation fails.
-A little extra safety in foci and foci3D with a call to Zeps().
-Cast to (real_t) in the OpenCL string for the w variation, which was having trouble compiling on Mac.
-Fixing missing comma between paths in InitPaletteList().
-Move Xml and PaletteList classes into cpp to shorten build times when working on them.
-Remove default param values for IterOpenCLKernelCreator<T>::SharedDataIndexDefines in cpp file.
-Change more NULL to nullptr.
2017-02-26 03:02:21 -05:00
|
|
|
#define PALETTE_CELL_HEIGHT 16
|
2014-12-11 00:50:15 -05:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Setup a spinner to be placed in a table cell.
|
|
|
|
/// Due to a serious compiler bug in MSVC, this must be declared as an outside function instead of a static member of Fractorium.
|
|
|
|
/// The reason is that the default arguments of type valType will not be interpreted correctly by the compiler.
|
|
|
|
/// If the bug is ever fixed, put it back as a static member function.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="table">The table the spinner belongs to</param>
|
|
|
|
/// <param name="receiver">The receiver object</param>
|
|
|
|
/// <param name="row">The row in the table where this spinner resides</param>
|
|
|
|
/// <param name="col">The col in the table where this spinner resides</param>
|
|
|
|
/// <param name="spinBox">Double pointer to spin box which will hold the spinner upon exit</param>
|
|
|
|
/// <param name="height">The height of the spinner</param>
|
|
|
|
/// <param name="min">The minimum value of the spinner</param>
|
|
|
|
/// <param name="max">The maximum value of the spinner</param>
|
|
|
|
/// <param name="step">The step of the spinner</param>
|
|
|
|
/// <param name="signal">The signal the spinner emits</param>
|
|
|
|
/// <param name="slot">The slot to receive the signal</param>
|
|
|
|
/// <param name="incRow">Whether to increment the row value</param>
|
|
|
|
/// <param name="val">The default value for the spinner</param>
|
|
|
|
/// <param name="doubleClickZero">When the spinner has a value of zero and is double clicked, assign this value</param>
|
|
|
|
/// <param name="doubleClickNonZero">When the spinner has a value of non-zero and is double clicked, assign this value</param>
|
|
|
|
template<typename spinType, typename valType>
|
|
|
|
static void SetupSpinner(QTableWidget* table, const QObject* receiver, int& row, int col, spinType*& spinBox, int height, valType min, valType max, valType step, const char* signal, const char* slot, bool incRow = true, valType val = 0, valType doubleClickZero = -999, valType doubleClickNonZero = -999)
|
|
|
|
{
|
2016-12-05 22:04:33 -05:00
|
|
|
auto settings = FractoriumSettings::DefInstance();
|
2014-12-11 00:50:15 -05:00
|
|
|
spinBox = new spinType(table, height, step);
|
|
|
|
spinBox->setRange(min, max);
|
|
|
|
spinBox->setValue(val);
|
|
|
|
|
|
|
|
if (col >= 0)
|
|
|
|
table->setCellWidget(row, col, spinBox);
|
|
|
|
|
|
|
|
if (string(signal) != "" && string(slot) != "")
|
|
|
|
receiver->connect(spinBox, signal, receiver, slot, Qt::QueuedConnection);
|
|
|
|
|
|
|
|
if (doubleClickNonZero != -999 && doubleClickZero != -999)
|
|
|
|
{
|
|
|
|
spinBox->DoubleClick(true);
|
|
|
|
spinBox->DoubleClickZero(valType(doubleClickZero));
|
|
|
|
spinBox->DoubleClickNonZero(valType(doubleClickNonZero));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (incRow)
|
|
|
|
row++;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Wrapper around QWidget::setTabOrder() to return the second widget.
|
|
|
|
/// This makes it easy to chain multiple calls without having to retype
|
|
|
|
/// all of them if the order changes or if a new widget is inserted.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="p">The parent widget that w1 and w2 belong to</param>
|
|
|
|
/// <param name="w1">The widget to come first in the tab order</param>
|
|
|
|
/// <param name="w2">The widget to come second in the tab order</param>
|
|
|
|
static QWidget* SetTabOrder(QWidget* p, QWidget* w1, QWidget* w2)
|
|
|
|
{
|
|
|
|
p->setTabOrder(w1, w2);
|
|
|
|
return w2;
|
|
|
|
}
|
|
|
|
|
2016-01-16 14:51:29 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Truncates the precision of the value to the specified number of digits
|
|
|
|
/// after the decimal place.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="val">The value to truncate</param>
|
|
|
|
/// <param name="digits">The number of digits to leave after the decimal place</param>
|
|
|
|
/// <returns>The truncated value</returns>
|
|
|
|
static double TruncPrecision(double val, uint digits)
|
|
|
|
{
|
|
|
|
double mult = std::pow(10, digits);
|
|
|
|
return std::round(mult * val) / mult;
|
|
|
|
}
|
|
|
|
|
2014-12-11 00:50:15 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Wrapper around QLocale::system().toDouble().
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="s">The string to convert</param>
|
|
|
|
/// <param name="ok">Pointer to boolean which stores the success value of the conversion</param>
|
|
|
|
/// <returns>The converted value if successful, else 0.</returns>
|
2015-12-31 16:41:59 -05:00
|
|
|
static double ToDouble(const QString& s, bool* ok)
|
2014-12-11 00:50:15 -05:00
|
|
|
{
|
|
|
|
return QLocale::system().toDouble(s, ok);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Wrapper around QLocale::system().toString().
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="s">The value to convert</param>
|
|
|
|
/// <returns>The string value if successful, else "".</returns>
|
|
|
|
template <typename T>
|
|
|
|
static QString ToString(T val)
|
|
|
|
{
|
|
|
|
return QLocale::system().toString(val);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Force a QString to end with the specified value.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="s">The string to append a suffix to</param>
|
|
|
|
/// <param name="e">The suffix to append</param>
|
|
|
|
/// <returns>The original string value if it already ended in e, else the original value appended with e.</returns>
|
|
|
|
template <typename T>
|
|
|
|
static QString MakeEnd(const QString& s, T e)
|
|
|
|
{
|
|
|
|
if (!s.endsWith(e))
|
|
|
|
return s + e;
|
|
|
|
else
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Check if a path is not empty and exists on the file system.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="s">The path to check</param>
|
|
|
|
/// <returns>True if s was not empty and existed, else false.</returns>
|
|
|
|
static bool Exists(const QString& s)
|
|
|
|
{
|
2015-12-31 16:41:59 -05:00
|
|
|
return s != "" && QDir(s).exists();
|
2014-12-11 00:50:15 -05:00
|
|
|
}
|
2015-07-15 23:27:32 -04:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Convert a color to one that is displayable on any background.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="color">The color to convert</param>
|
|
|
|
/// <returns>The converted color</returns>
|
|
|
|
static QColor VisibleColor(const QColor& color)
|
|
|
|
{
|
|
|
|
int threshold = 105;
|
|
|
|
int delta = (color.red() * 0.299) + //Magic numbers gotten from a Stack Overflow post.
|
2015-12-31 16:41:59 -05:00
|
|
|
(color.green() * 0.587) +
|
|
|
|
(color.blue() * 0.114);
|
2015-07-15 23:27:32 -04:00
|
|
|
QColor textColor = (255 - delta < threshold) ? QColor(0, 0, 0) : QColor(255, 255, 255);
|
|
|
|
return textColor;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Determine whether an xform in an ember is linked to any other xform
|
|
|
|
/// in the ember.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="ember">The ember which contains the xform</param>
|
|
|
|
/// <param name="xform">The xform to inspect</param>
|
|
|
|
/// <returns>The index of the xform that the xform argument is linked to, else -1</returns>
|
|
|
|
template <typename T>
|
|
|
|
static intmax_t IsXformLinked(Ember<T>& ember, Xform<T>* xform)
|
|
|
|
{
|
|
|
|
auto count = ember.XformCount();
|
|
|
|
auto index = ember.GetXformIndex(xform);
|
|
|
|
intmax_t linked = -1;
|
|
|
|
size_t toOneCount = 0;
|
|
|
|
size_t toZeroCount = 0;
|
|
|
|
size_t toOneIndex = 0;
|
|
|
|
size_t fromOneCount = 0;
|
|
|
|
size_t fromZeroCount = 0;
|
|
|
|
size_t fromOneIndex = 0;
|
|
|
|
|
|
|
|
if (index >= 0)
|
|
|
|
{
|
|
|
|
for (auto i = 0; i < count; i++)
|
|
|
|
{
|
|
|
|
if (xform->Xaos(i) == 0)
|
|
|
|
toZeroCount++;
|
|
|
|
else if (xform->Xaos(i) == 1)
|
|
|
|
{
|
|
|
|
toOneIndex = i;
|
|
|
|
toOneCount++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((toZeroCount == (count - 1)) && toOneCount == 1)
|
|
|
|
{
|
|
|
|
for (auto i = 0; i < count; i++)
|
|
|
|
{
|
|
|
|
if (auto fromXform = ember.GetXform(i))
|
|
|
|
{
|
|
|
|
if (fromXform->Xaos(toOneIndex) == 0)
|
|
|
|
fromZeroCount++;
|
|
|
|
else if (fromXform->Xaos(toOneIndex) == 1)
|
|
|
|
{
|
|
|
|
fromOneIndex = i;
|
|
|
|
fromOneCount++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((fromZeroCount == (count - 1)) && fromOneCount == 1)
|
|
|
|
{
|
|
|
|
linked = toOneIndex;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return linked;
|
--User changes
-Add support for multiple GPU devices.
--These options are present in the command line and in Fractorium.
-Change scheme of specifying devices from platform,device to just total device index.
--Single number on the command line.
--Change from combo boxes for device selection to a table of all devices in Fractorium.
-Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Bug fixes
-EmberAnimate, EmberRender, FractoriumSettings, FinalRenderDialog: Fix wrong order of arguments to Clamp() when assigning thread priority.
-VariationsDC.h: Fix NVidia OpenCL compilation error in DCTriangleVariation.
-FractoriumXformsColor.cpp: Checking for null pixmap pointer is not enough, must also check if the underlying buffer is null via call to QPixmap::isNull().
--Code changes
-Ember.h: Add case for FLAME_MOTION_NONE and default in ApplyFlameMotion().
-EmberMotion.h: Call base constructor.
-EmberPch.h: #pragma once only on Windows.
-EmberToXml.h:
--Handle different types of exceptions.
--Add default cases to ToString().
-Isaac.h: Remove unused variable in constructor.
-Point.h: Call base constructor in Color().
-Renderer.h/cpp:
--Add bool to Alloc() to only allocate memory for the histogram. Needed for multi-GPU.
--Make CoordMap() return a const ref, not a pointer.
-SheepTools.h:
--Use 64-bit types like the rest of the code already does.
--Fix some comment misspellings.
-Timing.h: Make BeginTime(), EndTime(), ElapsedTime() and Format() be const functions.
-Utils.h:
--Add new functions Equal() and Split().
--Handle more exception types in ReadFile().
--Get rid of most legacy blending of C and C++ argument parsing.
-XmlToEmber.h:
--Get rid of most legacy blending of C and C++ code from flam3.
--Remove some unused variables.
-EmberAnimate:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--If a render fails, exit since there is no point in continuing an animation with a missing frame.
--Pass variables to threaded save better, which most likely fixes a very subtle bug that existed before.
--Remove some unused variables.
-EmberGenome, EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
-EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--Only print values when not rendering with OpenCL, since they're always 0 in that case.
-EmberCLPch.h:
--#pragma once only on Windows.
--#include <atomic>.
-IterOpenCLKernelCreator.h: Add new kernel for summing two histograms. This is needed for multi-GPU.
-OpenCLWrapper.h:
--Move all OpenCL info related code into its own class OpenCLInfo.
--Add members to cache the values of global memory size and max allocation size.
-RendererCL.h/cpp:
--Redesign to accomodate multi-GPU.
--Constructor now takes a vector of devices.
--Remove DumpErrorReport() function, it's handled in the base.
--ClearBuffer(), ReadPoints(), WritePoints(), ReadHist() and WriteHist() now optionally take a device index as a parameter.
--MakeDmap() override and m_DmapCL member removed because it no longer applies since the histogram is always float since the last commit.
--Add new function SumDeviceHist() to sum histograms from two devices by first copying to a temporary on the host, then a temporary on the device, then summing.
--m_Calls member removed, as it's now per-device.
--OpenCLWrapper removed.
--m_Seeds member is now a vector of vector of seeds, to accomodate a separate and different array of seeds for each device.
--Added member m_Devices, a vector of unique_ptr of RendererCLDevice.
-EmberCommon.h
--Added Devices() function to convert from a vector of device indices to a vector of platform,device indices.
--Changed CreateRenderer() to accept a vector of devices to create a single RendererCL which will split work across multiple devices.
--Added CreateRenderers() function to accept a vector of devices to create multiple RendererCL, each which will render on a single device.
--Add more comments to some existing functions.
-EmberCommonPch.h: #pragma once only on Windows.
-EmberOptions.h:
--Remove --platform option, it's just sequential device number now with the --device option.
--Make --out be OPT_USE_RENDER instead of OPT_RENDER_ANIM since it's an error condition when animating. It makes no sense to write all frames to a single image.
--Add Devices() function to parse comma separated --device option string and return a vector of device indices.
--Make int and uint types be 64-bit, so intmax_t and size_t.
--Make better use of macros.
-JpegUtils.h: Make string parameters to WriteJpeg() and WritePng() be const ref.
-All project files: Turn off buffer security check option in Visual Studio (/Gs-)
-deployment.pri: Remove the line OTHER_FILES +=, it's pointless and was causing problems.
-Ember.pro, EmberCL.pro: Add CONFIG += plugin, otherwise it wouldn't link.
-EmberCL.pro: Add new files for multi-GPU support.
-build_all.sh: use -j4 and QMAKE=${QMAKE:/usr/bin/qmake}
-shared_settings.pri:
-Add version string.
-Remove old DESTDIR definitions.
-Add the following lines or else nothing would build:
CONFIG(release, debug|release) {
CONFIG += warn_off
DESTDIR = ../../../Bin/release
}
CONFIG(debug, debug|release) {
DESTDIR = ../../../Bin/debug
}
QMAKE_POST_LINK += $$quote(cp --update ../../../Data/flam3-palettes.xml $${DESTDIR}$$escape_expand(\n\t))
LIBS += -L/usr/lib -lpthread
-AboutDialog.ui: Another futile attempt to make it look correct on Linux.
-FinalRenderDialog.h/cpp:
--Add support for multi-GPU.
--Change from combo boxes for device selection to a table of all devices.
--Ensure device selection makes sense.
--Remove "FinalRender" prefix of various function names, it's implied given the context.
-FinalRenderEmberController.h/cpp:
--Add support for multi-GPU.
--Change m_FinishedImageCount to be atomic.
--Move CancelRender() from the base to FinalRenderEmberController<T>.
--Refactor RenderComplete() to omit any progress related functionality or image saving since it can be potentially ran in a thread.
--Consolidate setting various renderer fields into SyncGuiToRenderer().
-Fractorium.cpp: Allow for resizing of the options dialog to show the entire device table.
-FractoriumCommon.h: Add various functions to handle a table showing the available OpenCL devices on the system.
-FractoriumEmberController.h/cpp: Remove m_FinalImageIndex, it's no longer needed.
-FractoriumRender.cpp: Scale the interactive sub batch count and quality by the number of devices used.
-FractoriumSettings.h/cpp:
--Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Add multi-GPU support, remove old device,platform pair.
-FractoriumToolbar.cpp: Disable OpenCL toolbar button if there are no devices present on the system.
-FractoriumOptionsDialog.h/cpp:
--Add support for multi-GPU.
--Consolidate more assignments in DataToGui().
--Enable/disable CPU/OpenCL items in response to OpenCL checkbox event.
-Misc: Convert almost everything to size_t for unsigned, intmax_t for signed.
2015-09-12 21:33:45 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Convert the passed in QList<QVariant> of absolute device indices to a vector<pair<size_t, size_t>> of platform,device
|
|
|
|
/// index pairs.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="selectedDevices">The absolute device indices</param>
|
|
|
|
/// <returns>The converted device vector of platform,device index pairs</returns>
|
|
|
|
static vector<pair<size_t, size_t>> Devices(const QList<QVariant>& selectedDevices)
|
|
|
|
{
|
|
|
|
vector<pair<size_t, size_t>> vec;
|
2015-12-31 16:41:59 -05:00
|
|
|
auto& devices = OpenCLInfo::Instance()->DeviceIndices();
|
--User changes
-Add support for multiple GPU devices.
--These options are present in the command line and in Fractorium.
-Change scheme of specifying devices from platform,device to just total device index.
--Single number on the command line.
--Change from combo boxes for device selection to a table of all devices in Fractorium.
-Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Bug fixes
-EmberAnimate, EmberRender, FractoriumSettings, FinalRenderDialog: Fix wrong order of arguments to Clamp() when assigning thread priority.
-VariationsDC.h: Fix NVidia OpenCL compilation error in DCTriangleVariation.
-FractoriumXformsColor.cpp: Checking for null pixmap pointer is not enough, must also check if the underlying buffer is null via call to QPixmap::isNull().
--Code changes
-Ember.h: Add case for FLAME_MOTION_NONE and default in ApplyFlameMotion().
-EmberMotion.h: Call base constructor.
-EmberPch.h: #pragma once only on Windows.
-EmberToXml.h:
--Handle different types of exceptions.
--Add default cases to ToString().
-Isaac.h: Remove unused variable in constructor.
-Point.h: Call base constructor in Color().
-Renderer.h/cpp:
--Add bool to Alloc() to only allocate memory for the histogram. Needed for multi-GPU.
--Make CoordMap() return a const ref, not a pointer.
-SheepTools.h:
--Use 64-bit types like the rest of the code already does.
--Fix some comment misspellings.
-Timing.h: Make BeginTime(), EndTime(), ElapsedTime() and Format() be const functions.
-Utils.h:
--Add new functions Equal() and Split().
--Handle more exception types in ReadFile().
--Get rid of most legacy blending of C and C++ argument parsing.
-XmlToEmber.h:
--Get rid of most legacy blending of C and C++ code from flam3.
--Remove some unused variables.
-EmberAnimate:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--If a render fails, exit since there is no point in continuing an animation with a missing frame.
--Pass variables to threaded save better, which most likely fixes a very subtle bug that existed before.
--Remove some unused variables.
-EmberGenome, EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
-EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--Only print values when not rendering with OpenCL, since they're always 0 in that case.
-EmberCLPch.h:
--#pragma once only on Windows.
--#include <atomic>.
-IterOpenCLKernelCreator.h: Add new kernel for summing two histograms. This is needed for multi-GPU.
-OpenCLWrapper.h:
--Move all OpenCL info related code into its own class OpenCLInfo.
--Add members to cache the values of global memory size and max allocation size.
-RendererCL.h/cpp:
--Redesign to accomodate multi-GPU.
--Constructor now takes a vector of devices.
--Remove DumpErrorReport() function, it's handled in the base.
--ClearBuffer(), ReadPoints(), WritePoints(), ReadHist() and WriteHist() now optionally take a device index as a parameter.
--MakeDmap() override and m_DmapCL member removed because it no longer applies since the histogram is always float since the last commit.
--Add new function SumDeviceHist() to sum histograms from two devices by first copying to a temporary on the host, then a temporary on the device, then summing.
--m_Calls member removed, as it's now per-device.
--OpenCLWrapper removed.
--m_Seeds member is now a vector of vector of seeds, to accomodate a separate and different array of seeds for each device.
--Added member m_Devices, a vector of unique_ptr of RendererCLDevice.
-EmberCommon.h
--Added Devices() function to convert from a vector of device indices to a vector of platform,device indices.
--Changed CreateRenderer() to accept a vector of devices to create a single RendererCL which will split work across multiple devices.
--Added CreateRenderers() function to accept a vector of devices to create multiple RendererCL, each which will render on a single device.
--Add more comments to some existing functions.
-EmberCommonPch.h: #pragma once only on Windows.
-EmberOptions.h:
--Remove --platform option, it's just sequential device number now with the --device option.
--Make --out be OPT_USE_RENDER instead of OPT_RENDER_ANIM since it's an error condition when animating. It makes no sense to write all frames to a single image.
--Add Devices() function to parse comma separated --device option string and return a vector of device indices.
--Make int and uint types be 64-bit, so intmax_t and size_t.
--Make better use of macros.
-JpegUtils.h: Make string parameters to WriteJpeg() and WritePng() be const ref.
-All project files: Turn off buffer security check option in Visual Studio (/Gs-)
-deployment.pri: Remove the line OTHER_FILES +=, it's pointless and was causing problems.
-Ember.pro, EmberCL.pro: Add CONFIG += plugin, otherwise it wouldn't link.
-EmberCL.pro: Add new files for multi-GPU support.
-build_all.sh: use -j4 and QMAKE=${QMAKE:/usr/bin/qmake}
-shared_settings.pri:
-Add version string.
-Remove old DESTDIR definitions.
-Add the following lines or else nothing would build:
CONFIG(release, debug|release) {
CONFIG += warn_off
DESTDIR = ../../../Bin/release
}
CONFIG(debug, debug|release) {
DESTDIR = ../../../Bin/debug
}
QMAKE_POST_LINK += $$quote(cp --update ../../../Data/flam3-palettes.xml $${DESTDIR}$$escape_expand(\n\t))
LIBS += -L/usr/lib -lpthread
-AboutDialog.ui: Another futile attempt to make it look correct on Linux.
-FinalRenderDialog.h/cpp:
--Add support for multi-GPU.
--Change from combo boxes for device selection to a table of all devices.
--Ensure device selection makes sense.
--Remove "FinalRender" prefix of various function names, it's implied given the context.
-FinalRenderEmberController.h/cpp:
--Add support for multi-GPU.
--Change m_FinishedImageCount to be atomic.
--Move CancelRender() from the base to FinalRenderEmberController<T>.
--Refactor RenderComplete() to omit any progress related functionality or image saving since it can be potentially ran in a thread.
--Consolidate setting various renderer fields into SyncGuiToRenderer().
-Fractorium.cpp: Allow for resizing of the options dialog to show the entire device table.
-FractoriumCommon.h: Add various functions to handle a table showing the available OpenCL devices on the system.
-FractoriumEmberController.h/cpp: Remove m_FinalImageIndex, it's no longer needed.
-FractoriumRender.cpp: Scale the interactive sub batch count and quality by the number of devices used.
-FractoriumSettings.h/cpp:
--Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Add multi-GPU support, remove old device,platform pair.
-FractoriumToolbar.cpp: Disable OpenCL toolbar button if there are no devices present on the system.
-FractoriumOptionsDialog.h/cpp:
--Add support for multi-GPU.
--Consolidate more assignments in DataToGui().
--Enable/disable CPU/OpenCL items in response to OpenCL checkbox event.
-Misc: Convert almost everything to size_t for unsigned, intmax_t for signed.
2015-09-12 21:33:45 -04:00
|
|
|
vec.reserve(selectedDevices.size());
|
|
|
|
|
2016-02-13 20:24:51 -05:00
|
|
|
for (int i = 0; i < selectedDevices.size(); i++)
|
--User changes
-Add support for multiple GPU devices.
--These options are present in the command line and in Fractorium.
-Change scheme of specifying devices from platform,device to just total device index.
--Single number on the command line.
--Change from combo boxes for device selection to a table of all devices in Fractorium.
-Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Bug fixes
-EmberAnimate, EmberRender, FractoriumSettings, FinalRenderDialog: Fix wrong order of arguments to Clamp() when assigning thread priority.
-VariationsDC.h: Fix NVidia OpenCL compilation error in DCTriangleVariation.
-FractoriumXformsColor.cpp: Checking for null pixmap pointer is not enough, must also check if the underlying buffer is null via call to QPixmap::isNull().
--Code changes
-Ember.h: Add case for FLAME_MOTION_NONE and default in ApplyFlameMotion().
-EmberMotion.h: Call base constructor.
-EmberPch.h: #pragma once only on Windows.
-EmberToXml.h:
--Handle different types of exceptions.
--Add default cases to ToString().
-Isaac.h: Remove unused variable in constructor.
-Point.h: Call base constructor in Color().
-Renderer.h/cpp:
--Add bool to Alloc() to only allocate memory for the histogram. Needed for multi-GPU.
--Make CoordMap() return a const ref, not a pointer.
-SheepTools.h:
--Use 64-bit types like the rest of the code already does.
--Fix some comment misspellings.
-Timing.h: Make BeginTime(), EndTime(), ElapsedTime() and Format() be const functions.
-Utils.h:
--Add new functions Equal() and Split().
--Handle more exception types in ReadFile().
--Get rid of most legacy blending of C and C++ argument parsing.
-XmlToEmber.h:
--Get rid of most legacy blending of C and C++ code from flam3.
--Remove some unused variables.
-EmberAnimate:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--If a render fails, exit since there is no point in continuing an animation with a missing frame.
--Pass variables to threaded save better, which most likely fixes a very subtle bug that existed before.
--Remove some unused variables.
-EmberGenome, EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
-EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--Only print values when not rendering with OpenCL, since they're always 0 in that case.
-EmberCLPch.h:
--#pragma once only on Windows.
--#include <atomic>.
-IterOpenCLKernelCreator.h: Add new kernel for summing two histograms. This is needed for multi-GPU.
-OpenCLWrapper.h:
--Move all OpenCL info related code into its own class OpenCLInfo.
--Add members to cache the values of global memory size and max allocation size.
-RendererCL.h/cpp:
--Redesign to accomodate multi-GPU.
--Constructor now takes a vector of devices.
--Remove DumpErrorReport() function, it's handled in the base.
--ClearBuffer(), ReadPoints(), WritePoints(), ReadHist() and WriteHist() now optionally take a device index as a parameter.
--MakeDmap() override and m_DmapCL member removed because it no longer applies since the histogram is always float since the last commit.
--Add new function SumDeviceHist() to sum histograms from two devices by first copying to a temporary on the host, then a temporary on the device, then summing.
--m_Calls member removed, as it's now per-device.
--OpenCLWrapper removed.
--m_Seeds member is now a vector of vector of seeds, to accomodate a separate and different array of seeds for each device.
--Added member m_Devices, a vector of unique_ptr of RendererCLDevice.
-EmberCommon.h
--Added Devices() function to convert from a vector of device indices to a vector of platform,device indices.
--Changed CreateRenderer() to accept a vector of devices to create a single RendererCL which will split work across multiple devices.
--Added CreateRenderers() function to accept a vector of devices to create multiple RendererCL, each which will render on a single device.
--Add more comments to some existing functions.
-EmberCommonPch.h: #pragma once only on Windows.
-EmberOptions.h:
--Remove --platform option, it's just sequential device number now with the --device option.
--Make --out be OPT_USE_RENDER instead of OPT_RENDER_ANIM since it's an error condition when animating. It makes no sense to write all frames to a single image.
--Add Devices() function to parse comma separated --device option string and return a vector of device indices.
--Make int and uint types be 64-bit, so intmax_t and size_t.
--Make better use of macros.
-JpegUtils.h: Make string parameters to WriteJpeg() and WritePng() be const ref.
-All project files: Turn off buffer security check option in Visual Studio (/Gs-)
-deployment.pri: Remove the line OTHER_FILES +=, it's pointless and was causing problems.
-Ember.pro, EmberCL.pro: Add CONFIG += plugin, otherwise it wouldn't link.
-EmberCL.pro: Add new files for multi-GPU support.
-build_all.sh: use -j4 and QMAKE=${QMAKE:/usr/bin/qmake}
-shared_settings.pri:
-Add version string.
-Remove old DESTDIR definitions.
-Add the following lines or else nothing would build:
CONFIG(release, debug|release) {
CONFIG += warn_off
DESTDIR = ../../../Bin/release
}
CONFIG(debug, debug|release) {
DESTDIR = ../../../Bin/debug
}
QMAKE_POST_LINK += $$quote(cp --update ../../../Data/flam3-palettes.xml $${DESTDIR}$$escape_expand(\n\t))
LIBS += -L/usr/lib -lpthread
-AboutDialog.ui: Another futile attempt to make it look correct on Linux.
-FinalRenderDialog.h/cpp:
--Add support for multi-GPU.
--Change from combo boxes for device selection to a table of all devices.
--Ensure device selection makes sense.
--Remove "FinalRender" prefix of various function names, it's implied given the context.
-FinalRenderEmberController.h/cpp:
--Add support for multi-GPU.
--Change m_FinishedImageCount to be atomic.
--Move CancelRender() from the base to FinalRenderEmberController<T>.
--Refactor RenderComplete() to omit any progress related functionality or image saving since it can be potentially ran in a thread.
--Consolidate setting various renderer fields into SyncGuiToRenderer().
-Fractorium.cpp: Allow for resizing of the options dialog to show the entire device table.
-FractoriumCommon.h: Add various functions to handle a table showing the available OpenCL devices on the system.
-FractoriumEmberController.h/cpp: Remove m_FinalImageIndex, it's no longer needed.
-FractoriumRender.cpp: Scale the interactive sub batch count and quality by the number of devices used.
-FractoriumSettings.h/cpp:
--Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Add multi-GPU support, remove old device,platform pair.
-FractoriumToolbar.cpp: Disable OpenCL toolbar button if there are no devices present on the system.
-FractoriumOptionsDialog.h/cpp:
--Add support for multi-GPU.
--Consolidate more assignments in DataToGui().
--Enable/disable CPU/OpenCL items in response to OpenCL checkbox event.
-Misc: Convert almost everything to size_t for unsigned, intmax_t for signed.
2015-09-12 21:33:45 -04:00
|
|
|
{
|
|
|
|
auto index = selectedDevices[i].toUInt();
|
|
|
|
|
|
|
|
if (index < devices.size())
|
|
|
|
vec.push_back(devices[index]);
|
|
|
|
}
|
|
|
|
|
|
|
|
return vec;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Setup a table showing all available OpenCL devices on the system.
|
|
|
|
/// Create checkboxes and radio buttons which allow the user to specify
|
|
|
|
/// which devices to use, and which one to make the primary device.
|
|
|
|
/// Used in the options dialog and the final render dialog.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="table">The QTableWidget to setup</param>
|
|
|
|
/// <param name="settingsDevices">The absolute indices of the devices to use, with the first being the primary.</param>
|
|
|
|
static void SetupDeviceTable(QTableWidget* table, const QList<QVariant>& settingsDevices)
|
|
|
|
{
|
|
|
|
bool primary = false;
|
2015-12-31 16:41:59 -05:00
|
|
|
auto& deviceNames = OpenCLInfo::Instance()->AllDeviceNames();
|
--User changes
-Add support for multiple GPU devices.
--These options are present in the command line and in Fractorium.
-Change scheme of specifying devices from platform,device to just total device index.
--Single number on the command line.
--Change from combo boxes for device selection to a table of all devices in Fractorium.
-Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Bug fixes
-EmberAnimate, EmberRender, FractoriumSettings, FinalRenderDialog: Fix wrong order of arguments to Clamp() when assigning thread priority.
-VariationsDC.h: Fix NVidia OpenCL compilation error in DCTriangleVariation.
-FractoriumXformsColor.cpp: Checking for null pixmap pointer is not enough, must also check if the underlying buffer is null via call to QPixmap::isNull().
--Code changes
-Ember.h: Add case for FLAME_MOTION_NONE and default in ApplyFlameMotion().
-EmberMotion.h: Call base constructor.
-EmberPch.h: #pragma once only on Windows.
-EmberToXml.h:
--Handle different types of exceptions.
--Add default cases to ToString().
-Isaac.h: Remove unused variable in constructor.
-Point.h: Call base constructor in Color().
-Renderer.h/cpp:
--Add bool to Alloc() to only allocate memory for the histogram. Needed for multi-GPU.
--Make CoordMap() return a const ref, not a pointer.
-SheepTools.h:
--Use 64-bit types like the rest of the code already does.
--Fix some comment misspellings.
-Timing.h: Make BeginTime(), EndTime(), ElapsedTime() and Format() be const functions.
-Utils.h:
--Add new functions Equal() and Split().
--Handle more exception types in ReadFile().
--Get rid of most legacy blending of C and C++ argument parsing.
-XmlToEmber.h:
--Get rid of most legacy blending of C and C++ code from flam3.
--Remove some unused variables.
-EmberAnimate:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--If a render fails, exit since there is no point in continuing an animation with a missing frame.
--Pass variables to threaded save better, which most likely fixes a very subtle bug that existed before.
--Remove some unused variables.
-EmberGenome, EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
-EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--Only print values when not rendering with OpenCL, since they're always 0 in that case.
-EmberCLPch.h:
--#pragma once only on Windows.
--#include <atomic>.
-IterOpenCLKernelCreator.h: Add new kernel for summing two histograms. This is needed for multi-GPU.
-OpenCLWrapper.h:
--Move all OpenCL info related code into its own class OpenCLInfo.
--Add members to cache the values of global memory size and max allocation size.
-RendererCL.h/cpp:
--Redesign to accomodate multi-GPU.
--Constructor now takes a vector of devices.
--Remove DumpErrorReport() function, it's handled in the base.
--ClearBuffer(), ReadPoints(), WritePoints(), ReadHist() and WriteHist() now optionally take a device index as a parameter.
--MakeDmap() override and m_DmapCL member removed because it no longer applies since the histogram is always float since the last commit.
--Add new function SumDeviceHist() to sum histograms from two devices by first copying to a temporary on the host, then a temporary on the device, then summing.
--m_Calls member removed, as it's now per-device.
--OpenCLWrapper removed.
--m_Seeds member is now a vector of vector of seeds, to accomodate a separate and different array of seeds for each device.
--Added member m_Devices, a vector of unique_ptr of RendererCLDevice.
-EmberCommon.h
--Added Devices() function to convert from a vector of device indices to a vector of platform,device indices.
--Changed CreateRenderer() to accept a vector of devices to create a single RendererCL which will split work across multiple devices.
--Added CreateRenderers() function to accept a vector of devices to create multiple RendererCL, each which will render on a single device.
--Add more comments to some existing functions.
-EmberCommonPch.h: #pragma once only on Windows.
-EmberOptions.h:
--Remove --platform option, it's just sequential device number now with the --device option.
--Make --out be OPT_USE_RENDER instead of OPT_RENDER_ANIM since it's an error condition when animating. It makes no sense to write all frames to a single image.
--Add Devices() function to parse comma separated --device option string and return a vector of device indices.
--Make int and uint types be 64-bit, so intmax_t and size_t.
--Make better use of macros.
-JpegUtils.h: Make string parameters to WriteJpeg() and WritePng() be const ref.
-All project files: Turn off buffer security check option in Visual Studio (/Gs-)
-deployment.pri: Remove the line OTHER_FILES +=, it's pointless and was causing problems.
-Ember.pro, EmberCL.pro: Add CONFIG += plugin, otherwise it wouldn't link.
-EmberCL.pro: Add new files for multi-GPU support.
-build_all.sh: use -j4 and QMAKE=${QMAKE:/usr/bin/qmake}
-shared_settings.pri:
-Add version string.
-Remove old DESTDIR definitions.
-Add the following lines or else nothing would build:
CONFIG(release, debug|release) {
CONFIG += warn_off
DESTDIR = ../../../Bin/release
}
CONFIG(debug, debug|release) {
DESTDIR = ../../../Bin/debug
}
QMAKE_POST_LINK += $$quote(cp --update ../../../Data/flam3-palettes.xml $${DESTDIR}$$escape_expand(\n\t))
LIBS += -L/usr/lib -lpthread
-AboutDialog.ui: Another futile attempt to make it look correct on Linux.
-FinalRenderDialog.h/cpp:
--Add support for multi-GPU.
--Change from combo boxes for device selection to a table of all devices.
--Ensure device selection makes sense.
--Remove "FinalRender" prefix of various function names, it's implied given the context.
-FinalRenderEmberController.h/cpp:
--Add support for multi-GPU.
--Change m_FinishedImageCount to be atomic.
--Move CancelRender() from the base to FinalRenderEmberController<T>.
--Refactor RenderComplete() to omit any progress related functionality or image saving since it can be potentially ran in a thread.
--Consolidate setting various renderer fields into SyncGuiToRenderer().
-Fractorium.cpp: Allow for resizing of the options dialog to show the entire device table.
-FractoriumCommon.h: Add various functions to handle a table showing the available OpenCL devices on the system.
-FractoriumEmberController.h/cpp: Remove m_FinalImageIndex, it's no longer needed.
-FractoriumRender.cpp: Scale the interactive sub batch count and quality by the number of devices used.
-FractoriumSettings.h/cpp:
--Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Add multi-GPU support, remove old device,platform pair.
-FractoriumToolbar.cpp: Disable OpenCL toolbar button if there are no devices present on the system.
-FractoriumOptionsDialog.h/cpp:
--Add support for multi-GPU.
--Consolidate more assignments in DataToGui().
--Enable/disable CPU/OpenCL items in response to OpenCL checkbox event.
-Misc: Convert almost everything to size_t for unsigned, intmax_t for signed.
2015-09-12 21:33:45 -04:00
|
|
|
table->clearContents();
|
2016-02-13 20:24:51 -05:00
|
|
|
table->setRowCount(int(deviceNames.size()));
|
--User changes
-Add support for multiple GPU devices.
--These options are present in the command line and in Fractorium.
-Change scheme of specifying devices from platform,device to just total device index.
--Single number on the command line.
--Change from combo boxes for device selection to a table of all devices in Fractorium.
-Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Bug fixes
-EmberAnimate, EmberRender, FractoriumSettings, FinalRenderDialog: Fix wrong order of arguments to Clamp() when assigning thread priority.
-VariationsDC.h: Fix NVidia OpenCL compilation error in DCTriangleVariation.
-FractoriumXformsColor.cpp: Checking for null pixmap pointer is not enough, must also check if the underlying buffer is null via call to QPixmap::isNull().
--Code changes
-Ember.h: Add case for FLAME_MOTION_NONE and default in ApplyFlameMotion().
-EmberMotion.h: Call base constructor.
-EmberPch.h: #pragma once only on Windows.
-EmberToXml.h:
--Handle different types of exceptions.
--Add default cases to ToString().
-Isaac.h: Remove unused variable in constructor.
-Point.h: Call base constructor in Color().
-Renderer.h/cpp:
--Add bool to Alloc() to only allocate memory for the histogram. Needed for multi-GPU.
--Make CoordMap() return a const ref, not a pointer.
-SheepTools.h:
--Use 64-bit types like the rest of the code already does.
--Fix some comment misspellings.
-Timing.h: Make BeginTime(), EndTime(), ElapsedTime() and Format() be const functions.
-Utils.h:
--Add new functions Equal() and Split().
--Handle more exception types in ReadFile().
--Get rid of most legacy blending of C and C++ argument parsing.
-XmlToEmber.h:
--Get rid of most legacy blending of C and C++ code from flam3.
--Remove some unused variables.
-EmberAnimate:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--If a render fails, exit since there is no point in continuing an animation with a missing frame.
--Pass variables to threaded save better, which most likely fixes a very subtle bug that existed before.
--Remove some unused variables.
-EmberGenome, EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
-EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--Only print values when not rendering with OpenCL, since they're always 0 in that case.
-EmberCLPch.h:
--#pragma once only on Windows.
--#include <atomic>.
-IterOpenCLKernelCreator.h: Add new kernel for summing two histograms. This is needed for multi-GPU.
-OpenCLWrapper.h:
--Move all OpenCL info related code into its own class OpenCLInfo.
--Add members to cache the values of global memory size and max allocation size.
-RendererCL.h/cpp:
--Redesign to accomodate multi-GPU.
--Constructor now takes a vector of devices.
--Remove DumpErrorReport() function, it's handled in the base.
--ClearBuffer(), ReadPoints(), WritePoints(), ReadHist() and WriteHist() now optionally take a device index as a parameter.
--MakeDmap() override and m_DmapCL member removed because it no longer applies since the histogram is always float since the last commit.
--Add new function SumDeviceHist() to sum histograms from two devices by first copying to a temporary on the host, then a temporary on the device, then summing.
--m_Calls member removed, as it's now per-device.
--OpenCLWrapper removed.
--m_Seeds member is now a vector of vector of seeds, to accomodate a separate and different array of seeds for each device.
--Added member m_Devices, a vector of unique_ptr of RendererCLDevice.
-EmberCommon.h
--Added Devices() function to convert from a vector of device indices to a vector of platform,device indices.
--Changed CreateRenderer() to accept a vector of devices to create a single RendererCL which will split work across multiple devices.
--Added CreateRenderers() function to accept a vector of devices to create multiple RendererCL, each which will render on a single device.
--Add more comments to some existing functions.
-EmberCommonPch.h: #pragma once only on Windows.
-EmberOptions.h:
--Remove --platform option, it's just sequential device number now with the --device option.
--Make --out be OPT_USE_RENDER instead of OPT_RENDER_ANIM since it's an error condition when animating. It makes no sense to write all frames to a single image.
--Add Devices() function to parse comma separated --device option string and return a vector of device indices.
--Make int and uint types be 64-bit, so intmax_t and size_t.
--Make better use of macros.
-JpegUtils.h: Make string parameters to WriteJpeg() and WritePng() be const ref.
-All project files: Turn off buffer security check option in Visual Studio (/Gs-)
-deployment.pri: Remove the line OTHER_FILES +=, it's pointless and was causing problems.
-Ember.pro, EmberCL.pro: Add CONFIG += plugin, otherwise it wouldn't link.
-EmberCL.pro: Add new files for multi-GPU support.
-build_all.sh: use -j4 and QMAKE=${QMAKE:/usr/bin/qmake}
-shared_settings.pri:
-Add version string.
-Remove old DESTDIR definitions.
-Add the following lines or else nothing would build:
CONFIG(release, debug|release) {
CONFIG += warn_off
DESTDIR = ../../../Bin/release
}
CONFIG(debug, debug|release) {
DESTDIR = ../../../Bin/debug
}
QMAKE_POST_LINK += $$quote(cp --update ../../../Data/flam3-palettes.xml $${DESTDIR}$$escape_expand(\n\t))
LIBS += -L/usr/lib -lpthread
-AboutDialog.ui: Another futile attempt to make it look correct on Linux.
-FinalRenderDialog.h/cpp:
--Add support for multi-GPU.
--Change from combo boxes for device selection to a table of all devices.
--Ensure device selection makes sense.
--Remove "FinalRender" prefix of various function names, it's implied given the context.
-FinalRenderEmberController.h/cpp:
--Add support for multi-GPU.
--Change m_FinishedImageCount to be atomic.
--Move CancelRender() from the base to FinalRenderEmberController<T>.
--Refactor RenderComplete() to omit any progress related functionality or image saving since it can be potentially ran in a thread.
--Consolidate setting various renderer fields into SyncGuiToRenderer().
-Fractorium.cpp: Allow for resizing of the options dialog to show the entire device table.
-FractoriumCommon.h: Add various functions to handle a table showing the available OpenCL devices on the system.
-FractoriumEmberController.h/cpp: Remove m_FinalImageIndex, it's no longer needed.
-FractoriumRender.cpp: Scale the interactive sub batch count and quality by the number of devices used.
-FractoriumSettings.h/cpp:
--Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Add multi-GPU support, remove old device,platform pair.
-FractoriumToolbar.cpp: Disable OpenCL toolbar button if there are no devices present on the system.
-FractoriumOptionsDialog.h/cpp:
--Add support for multi-GPU.
--Consolidate more assignments in DataToGui().
--Enable/disable CPU/OpenCL items in response to OpenCL checkbox event.
-Misc: Convert almost everything to size_t for unsigned, intmax_t for signed.
2015-09-12 21:33:45 -04:00
|
|
|
|
2016-02-13 20:24:51 -05:00
|
|
|
for (int i = 0; i < deviceNames.size(); i++)
|
--User changes
-Add support for multiple GPU devices.
--These options are present in the command line and in Fractorium.
-Change scheme of specifying devices from platform,device to just total device index.
--Single number on the command line.
--Change from combo boxes for device selection to a table of all devices in Fractorium.
-Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Bug fixes
-EmberAnimate, EmberRender, FractoriumSettings, FinalRenderDialog: Fix wrong order of arguments to Clamp() when assigning thread priority.
-VariationsDC.h: Fix NVidia OpenCL compilation error in DCTriangleVariation.
-FractoriumXformsColor.cpp: Checking for null pixmap pointer is not enough, must also check if the underlying buffer is null via call to QPixmap::isNull().
--Code changes
-Ember.h: Add case for FLAME_MOTION_NONE and default in ApplyFlameMotion().
-EmberMotion.h: Call base constructor.
-EmberPch.h: #pragma once only on Windows.
-EmberToXml.h:
--Handle different types of exceptions.
--Add default cases to ToString().
-Isaac.h: Remove unused variable in constructor.
-Point.h: Call base constructor in Color().
-Renderer.h/cpp:
--Add bool to Alloc() to only allocate memory for the histogram. Needed for multi-GPU.
--Make CoordMap() return a const ref, not a pointer.
-SheepTools.h:
--Use 64-bit types like the rest of the code already does.
--Fix some comment misspellings.
-Timing.h: Make BeginTime(), EndTime(), ElapsedTime() and Format() be const functions.
-Utils.h:
--Add new functions Equal() and Split().
--Handle more exception types in ReadFile().
--Get rid of most legacy blending of C and C++ argument parsing.
-XmlToEmber.h:
--Get rid of most legacy blending of C and C++ code from flam3.
--Remove some unused variables.
-EmberAnimate:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--If a render fails, exit since there is no point in continuing an animation with a missing frame.
--Pass variables to threaded save better, which most likely fixes a very subtle bug that existed before.
--Remove some unused variables.
-EmberGenome, EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
-EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--Only print values when not rendering with OpenCL, since they're always 0 in that case.
-EmberCLPch.h:
--#pragma once only on Windows.
--#include <atomic>.
-IterOpenCLKernelCreator.h: Add new kernel for summing two histograms. This is needed for multi-GPU.
-OpenCLWrapper.h:
--Move all OpenCL info related code into its own class OpenCLInfo.
--Add members to cache the values of global memory size and max allocation size.
-RendererCL.h/cpp:
--Redesign to accomodate multi-GPU.
--Constructor now takes a vector of devices.
--Remove DumpErrorReport() function, it's handled in the base.
--ClearBuffer(), ReadPoints(), WritePoints(), ReadHist() and WriteHist() now optionally take a device index as a parameter.
--MakeDmap() override and m_DmapCL member removed because it no longer applies since the histogram is always float since the last commit.
--Add new function SumDeviceHist() to sum histograms from two devices by first copying to a temporary on the host, then a temporary on the device, then summing.
--m_Calls member removed, as it's now per-device.
--OpenCLWrapper removed.
--m_Seeds member is now a vector of vector of seeds, to accomodate a separate and different array of seeds for each device.
--Added member m_Devices, a vector of unique_ptr of RendererCLDevice.
-EmberCommon.h
--Added Devices() function to convert from a vector of device indices to a vector of platform,device indices.
--Changed CreateRenderer() to accept a vector of devices to create a single RendererCL which will split work across multiple devices.
--Added CreateRenderers() function to accept a vector of devices to create multiple RendererCL, each which will render on a single device.
--Add more comments to some existing functions.
-EmberCommonPch.h: #pragma once only on Windows.
-EmberOptions.h:
--Remove --platform option, it's just sequential device number now with the --device option.
--Make --out be OPT_USE_RENDER instead of OPT_RENDER_ANIM since it's an error condition when animating. It makes no sense to write all frames to a single image.
--Add Devices() function to parse comma separated --device option string and return a vector of device indices.
--Make int and uint types be 64-bit, so intmax_t and size_t.
--Make better use of macros.
-JpegUtils.h: Make string parameters to WriteJpeg() and WritePng() be const ref.
-All project files: Turn off buffer security check option in Visual Studio (/Gs-)
-deployment.pri: Remove the line OTHER_FILES +=, it's pointless and was causing problems.
-Ember.pro, EmberCL.pro: Add CONFIG += plugin, otherwise it wouldn't link.
-EmberCL.pro: Add new files for multi-GPU support.
-build_all.sh: use -j4 and QMAKE=${QMAKE:/usr/bin/qmake}
-shared_settings.pri:
-Add version string.
-Remove old DESTDIR definitions.
-Add the following lines or else nothing would build:
CONFIG(release, debug|release) {
CONFIG += warn_off
DESTDIR = ../../../Bin/release
}
CONFIG(debug, debug|release) {
DESTDIR = ../../../Bin/debug
}
QMAKE_POST_LINK += $$quote(cp --update ../../../Data/flam3-palettes.xml $${DESTDIR}$$escape_expand(\n\t))
LIBS += -L/usr/lib -lpthread
-AboutDialog.ui: Another futile attempt to make it look correct on Linux.
-FinalRenderDialog.h/cpp:
--Add support for multi-GPU.
--Change from combo boxes for device selection to a table of all devices.
--Ensure device selection makes sense.
--Remove "FinalRender" prefix of various function names, it's implied given the context.
-FinalRenderEmberController.h/cpp:
--Add support for multi-GPU.
--Change m_FinishedImageCount to be atomic.
--Move CancelRender() from the base to FinalRenderEmberController<T>.
--Refactor RenderComplete() to omit any progress related functionality or image saving since it can be potentially ran in a thread.
--Consolidate setting various renderer fields into SyncGuiToRenderer().
-Fractorium.cpp: Allow for resizing of the options dialog to show the entire device table.
-FractoriumCommon.h: Add various functions to handle a table showing the available OpenCL devices on the system.
-FractoriumEmberController.h/cpp: Remove m_FinalImageIndex, it's no longer needed.
-FractoriumRender.cpp: Scale the interactive sub batch count and quality by the number of devices used.
-FractoriumSettings.h/cpp:
--Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Add multi-GPU support, remove old device,platform pair.
-FractoriumToolbar.cpp: Disable OpenCL toolbar button if there are no devices present on the system.
-FractoriumOptionsDialog.h/cpp:
--Add support for multi-GPU.
--Consolidate more assignments in DataToGui().
--Enable/disable CPU/OpenCL items in response to OpenCL checkbox event.
-Misc: Convert almost everything to size_t for unsigned, intmax_t for signed.
2015-09-12 21:33:45 -04:00
|
|
|
{
|
|
|
|
auto checkItem = new QTableWidgetItem();
|
|
|
|
auto radio = new QRadioButton();
|
|
|
|
auto deviceItem = new QTableWidgetItem(QString::fromStdString(deviceNames[i]));
|
|
|
|
table->setItem(i, 0, checkItem);
|
|
|
|
table->setCellWidget(i, 1, radio);
|
|
|
|
table->setItem(i, 2, deviceItem);
|
|
|
|
|
|
|
|
if (settingsDevices.contains(QVariant::fromValue(i)))
|
|
|
|
{
|
|
|
|
checkItem->setCheckState(Qt::Checked);
|
|
|
|
|
|
|
|
if (!primary)
|
|
|
|
{
|
|
|
|
radio->setChecked(true);
|
|
|
|
primary = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
checkItem->setCheckState(Qt::Unchecked);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!primary && table->rowCount() > 0)//Primary was never set, so just default to the first device and hope it was the one detected as the main display.
|
|
|
|
{
|
|
|
|
table->item(0, 0)->setCheckState(Qt::Checked);
|
|
|
|
qobject_cast<QRadioButton*>(table->cellWidget(0, 1))->setChecked(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Copy the passed in selected absolute device indices to the controls on the passed in table.
|
|
|
|
/// Used in the options dialog and the final render dialog.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="table">The QTableWidget to copy values to</param>
|
|
|
|
/// <param name="settingsDevices">The absolute indices of the devices to use, with the first being the primary.</param>
|
|
|
|
static void SettingsToDeviceTable(QTableWidget* table, QList<QVariant>& settingsDevices)
|
|
|
|
{
|
|
|
|
if (settingsDevices.empty() && table->rowCount() > 0)
|
|
|
|
{
|
|
|
|
table->item(0, 0)->setCheckState(Qt::Checked);
|
|
|
|
qobject_cast<QRadioButton*>(table->cellWidget(0, 1))->setChecked(true);
|
|
|
|
|
|
|
|
for (int row = 1; row < table->rowCount(); row++)
|
|
|
|
if (auto item = table->item(row, 0))
|
|
|
|
item->setCheckState(Qt::Unchecked);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for (int row = 0; row < table->rowCount(); row++)
|
|
|
|
{
|
|
|
|
if (auto item = table->item(row, 0))
|
|
|
|
{
|
|
|
|
if (settingsDevices.contains(row))
|
|
|
|
{
|
|
|
|
item->setCheckState(Qt::Checked);
|
|
|
|
|
|
|
|
if (!settingsDevices.indexOf(QVariant::fromValue(row)))
|
|
|
|
if (auto radio = qobject_cast<QRadioButton*>(table->cellWidget(row, 1)))
|
|
|
|
radio->setChecked(true);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
item->setCheckState(Qt::Unchecked);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Copy the values of the controls on the passed in table to a list of absolute device indices.
|
|
|
|
/// Used in the options dialog and the final render dialog.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="table">The QTableWidget to copy values from</param>
|
|
|
|
/// <returns>The list of absolute device indices</returns>
|
|
|
|
static QList<QVariant> DeviceTableToSettings(QTableWidget* table)
|
|
|
|
{
|
|
|
|
QList<QVariant> devices;
|
|
|
|
auto rows = table->rowCount();
|
|
|
|
|
|
|
|
for (int row = 0; row < rows; row++)
|
|
|
|
{
|
|
|
|
auto checkItem = table->item(row, 0);
|
|
|
|
auto radio = qobject_cast<QRadioButton*>(table->cellWidget(row, 1));
|
|
|
|
|
|
|
|
if (checkItem->checkState() == Qt::Checked)
|
|
|
|
{
|
|
|
|
if (radio && radio->isChecked())
|
|
|
|
devices.push_front(row);
|
|
|
|
else
|
|
|
|
devices.push_back(row);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return devices;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Ensure device selection on the passed in table make sense.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="table">The QTableWidget to setup</param>
|
|
|
|
/// <param name="row">The row of the cell</param>
|
|
|
|
/// <param name="col">The column of the cell</param>
|
|
|
|
static void HandleDeviceTableCheckChanged(QTableWidget* table, int row, int col)
|
|
|
|
{
|
|
|
|
int primaryRow = -1;
|
|
|
|
QRadioButton* primaryRadio = nullptr;
|
|
|
|
|
|
|
|
for (int i = 0; i < table->rowCount(); i++)
|
|
|
|
{
|
|
|
|
if (auto radio = qobject_cast<QRadioButton*>(table->cellWidget(i, 1)))
|
|
|
|
{
|
|
|
|
if (radio->isChecked())
|
|
|
|
{
|
|
|
|
primaryRow = i;
|
|
|
|
primaryRadio = radio;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (primaryRow == -1) primaryRow = 0;
|
|
|
|
|
|
|
|
if (auto primaryItem = table->item(primaryRow, 0))
|
|
|
|
if (primaryItem->checkState() == Qt::Unchecked)
|
|
|
|
primaryItem->setCheckState(Qt::Checked);
|
|
|
|
}
|
2015-10-27 00:31:35 -04:00
|
|
|
|
--User changes
-Add a palette editor.
-Add support for reading .ugr/.gradient/.gradients palette files.
-Allow toggling on spinners whose minimum value is not zero.
-Allow toggling display of image, affines and grid.
-Add new variations: cylinder2, circlesplit, tile_log, truchet_fill, waves2_radial.
--Bug fixes
-cpow2 was wrong.
-Palettes with rapid changes in color would produce slightly different outputs from Apo/Chaotica. This was due to a long standing bug from flam3.
-Use exec() on Apple and show() on all other OSes for dialog boxes.
-Trying to render a sequence with no frames would crash.
-Selecting multiple xforms and rotating them would produce the wrong rotation.
-Better handling when parsing flames using different encoding, such as unicode and UTF-8.
-Switching between SP/DP didn't reselect the selected flame in the Library tab.
--Code changes
-Make all types concerning palettes be floats, including PaletteTableWidgetItem.
-PaletteTableWidgetItem is no longer templated because all palettes are float.
-Include the source colors for user created gradients.
-Change parallel_for() calls to work with very old versions of TBB which are lingering on some systems.
-Split conditional out of accumulation loop on the CPU for better performance.
-Vectorize summing when doing density filter for better performance.
-Make all usage of palettes be of type float, double is pointless.
-Allow palettes to reside in multiple folders, while ensuring only one of each name is added.
-Refactor some palette path searching code.
-Make ReadFile() throw and catch an exception if the file operation fails.
-A little extra safety in foci and foci3D with a call to Zeps().
-Cast to (real_t) in the OpenCL string for the w variation, which was having trouble compiling on Mac.
-Fixing missing comma between paths in InitPaletteList().
-Move Xml and PaletteList classes into cpp to shorten build times when working on them.
-Remove default param values for IterOpenCLKernelCreator<T>::SharedDataIndexDefines in cpp file.
-Change more NULL to nullptr.
2017-02-26 03:02:21 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Set a row in a table to represent a palette.
|
|
|
|
/// This will place the palette name as a string value in the first column,
|
|
|
|
/// and a QPixmap representing the palette in the second column.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="paletteTable">The table write to the row to</param>
|
|
|
|
/// <param name="palette">A pointer to the palette to write to the row</param>
|
|
|
|
/// <param name="row">The row to write the palette to</param>
|
|
|
|
static void AddPaletteToTable(QTableWidget* paletteTable, Palette<float>* palette, int row)
|
|
|
|
{
|
|
|
|
auto v = palette->MakeRgbPaletteBlock(PALETTE_CELL_HEIGHT);
|
|
|
|
auto nameCol = new QTableWidgetItem(palette->m_Name.c_str());
|
|
|
|
nameCol->setToolTip(palette->m_Name.c_str());
|
2017-05-31 22:50:05 -04:00
|
|
|
nameCol->setFlags(palette->m_SourceColors.empty() ? (Qt::ItemIsEnabled | Qt::ItemIsSelectable)
|
|
|
|
: (Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable));
|
--User changes
-Add a palette editor.
-Add support for reading .ugr/.gradient/.gradients palette files.
-Allow toggling on spinners whose minimum value is not zero.
-Allow toggling display of image, affines and grid.
-Add new variations: cylinder2, circlesplit, tile_log, truchet_fill, waves2_radial.
--Bug fixes
-cpow2 was wrong.
-Palettes with rapid changes in color would produce slightly different outputs from Apo/Chaotica. This was due to a long standing bug from flam3.
-Use exec() on Apple and show() on all other OSes for dialog boxes.
-Trying to render a sequence with no frames would crash.
-Selecting multiple xforms and rotating them would produce the wrong rotation.
-Better handling when parsing flames using different encoding, such as unicode and UTF-8.
-Switching between SP/DP didn't reselect the selected flame in the Library tab.
--Code changes
-Make all types concerning palettes be floats, including PaletteTableWidgetItem.
-PaletteTableWidgetItem is no longer templated because all palettes are float.
-Include the source colors for user created gradients.
-Change parallel_for() calls to work with very old versions of TBB which are lingering on some systems.
-Split conditional out of accumulation loop on the CPU for better performance.
-Vectorize summing when doing density filter for better performance.
-Make all usage of palettes be of type float, double is pointless.
-Allow palettes to reside in multiple folders, while ensuring only one of each name is added.
-Refactor some palette path searching code.
-Make ReadFile() throw and catch an exception if the file operation fails.
-A little extra safety in foci and foci3D with a call to Zeps().
-Cast to (real_t) in the OpenCL string for the w variation, which was having trouble compiling on Mac.
-Fixing missing comma between paths in InitPaletteList().
-Move Xml and PaletteList classes into cpp to shorten build times when working on them.
-Remove default param values for IterOpenCLKernelCreator<T>::SharedDataIndexDefines in cpp file.
-Change more NULL to nullptr.
2017-02-26 03:02:21 -05:00
|
|
|
paletteTable->setItem(row, 0, nameCol);
|
|
|
|
QImage image(v.data(), int(palette->Size()), PALETTE_CELL_HEIGHT, QImage::Format_RGB888);
|
|
|
|
auto paletteItem = new PaletteTableWidgetItem(palette);
|
|
|
|
paletteItem->setData(Qt::DecorationRole, QPixmap::fromImage(image));
|
|
|
|
paletteItem->setFlags(paletteItem->flags() & ~Qt::ItemIsEditable);
|
|
|
|
paletteTable->setItem(row, 1, paletteItem);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Read a palette Xml file and populate the palette table with the contents.
|
|
|
|
/// This will clear any previous contents.
|
|
|
|
/// Called upon initialization, palette combo index change, and controller type change.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="s">The name of the palette file without the path</param>
|
2017-02-26 12:34:43 -05:00
|
|
|
/// <param name="paletteTable">The table to populate</param>
|
|
|
|
/// <param name="paletteList">The global PaletteList shared_ptr to retrieve the specified palette file from to populate the table with</param>
|
--User changes
-Add a palette editor.
-Add support for reading .ugr/.gradient/.gradients palette files.
-Allow toggling on spinners whose minimum value is not zero.
-Allow toggling display of image, affines and grid.
-Add new variations: cylinder2, circlesplit, tile_log, truchet_fill, waves2_radial.
--Bug fixes
-cpow2 was wrong.
-Palettes with rapid changes in color would produce slightly different outputs from Apo/Chaotica. This was due to a long standing bug from flam3.
-Use exec() on Apple and show() on all other OSes for dialog boxes.
-Trying to render a sequence with no frames would crash.
-Selecting multiple xforms and rotating them would produce the wrong rotation.
-Better handling when parsing flames using different encoding, such as unicode and UTF-8.
-Switching between SP/DP didn't reselect the selected flame in the Library tab.
--Code changes
-Make all types concerning palettes be floats, including PaletteTableWidgetItem.
-PaletteTableWidgetItem is no longer templated because all palettes are float.
-Include the source colors for user created gradients.
-Change parallel_for() calls to work with very old versions of TBB which are lingering on some systems.
-Split conditional out of accumulation loop on the CPU for better performance.
-Vectorize summing when doing density filter for better performance.
-Make all usage of palettes be of type float, double is pointless.
-Allow palettes to reside in multiple folders, while ensuring only one of each name is added.
-Refactor some palette path searching code.
-Make ReadFile() throw and catch an exception if the file operation fails.
-A little extra safety in foci and foci3D with a call to Zeps().
-Cast to (real_t) in the OpenCL string for the w variation, which was having trouble compiling on Mac.
-Fixing missing comma between paths in InitPaletteList().
-Move Xml and PaletteList classes into cpp to shorten build times when working on them.
-Remove default param values for IterOpenCLKernelCreator<T>::SharedDataIndexDefines in cpp file.
-Change more NULL to nullptr.
2017-02-26 03:02:21 -05:00
|
|
|
/// <returns>True if successful, else false.</returns>
|
2017-02-26 12:34:43 -05:00
|
|
|
static bool FillPaletteTable(const string& s, QTableWidget* paletteTable, shared_ptr<PaletteList<float>> paletteList)
|
--User changes
-Add a palette editor.
-Add support for reading .ugr/.gradient/.gradients palette files.
-Allow toggling on spinners whose minimum value is not zero.
-Allow toggling display of image, affines and grid.
-Add new variations: cylinder2, circlesplit, tile_log, truchet_fill, waves2_radial.
--Bug fixes
-cpow2 was wrong.
-Palettes with rapid changes in color would produce slightly different outputs from Apo/Chaotica. This was due to a long standing bug from flam3.
-Use exec() on Apple and show() on all other OSes for dialog boxes.
-Trying to render a sequence with no frames would crash.
-Selecting multiple xforms and rotating them would produce the wrong rotation.
-Better handling when parsing flames using different encoding, such as unicode and UTF-8.
-Switching between SP/DP didn't reselect the selected flame in the Library tab.
--Code changes
-Make all types concerning palettes be floats, including PaletteTableWidgetItem.
-PaletteTableWidgetItem is no longer templated because all palettes are float.
-Include the source colors for user created gradients.
-Change parallel_for() calls to work with very old versions of TBB which are lingering on some systems.
-Split conditional out of accumulation loop on the CPU for better performance.
-Vectorize summing when doing density filter for better performance.
-Make all usage of palettes be of type float, double is pointless.
-Allow palettes to reside in multiple folders, while ensuring only one of each name is added.
-Refactor some palette path searching code.
-Make ReadFile() throw and catch an exception if the file operation fails.
-A little extra safety in foci and foci3D with a call to Zeps().
-Cast to (real_t) in the OpenCL string for the w variation, which was having trouble compiling on Mac.
-Fixing missing comma between paths in InitPaletteList().
-Move Xml and PaletteList classes into cpp to shorten build times when working on them.
-Remove default param values for IterOpenCLKernelCreator<T>::SharedDataIndexDefines in cpp file.
-Change more NULL to nullptr.
2017-02-26 03:02:21 -05:00
|
|
|
{
|
|
|
|
if (!s.empty())//This occasionally seems to get called with an empty string for reasons unknown.
|
|
|
|
{
|
2017-02-26 12:34:43 -05:00
|
|
|
if (auto palettes = paletteList->GetPaletteListByFilename(s))
|
--User changes
-Add a palette editor.
-Add support for reading .ugr/.gradient/.gradients palette files.
-Allow toggling on spinners whose minimum value is not zero.
-Allow toggling display of image, affines and grid.
-Add new variations: cylinder2, circlesplit, tile_log, truchet_fill, waves2_radial.
--Bug fixes
-cpow2 was wrong.
-Palettes with rapid changes in color would produce slightly different outputs from Apo/Chaotica. This was due to a long standing bug from flam3.
-Use exec() on Apple and show() on all other OSes for dialog boxes.
-Trying to render a sequence with no frames would crash.
-Selecting multiple xforms and rotating them would produce the wrong rotation.
-Better handling when parsing flames using different encoding, such as unicode and UTF-8.
-Switching between SP/DP didn't reselect the selected flame in the Library tab.
--Code changes
-Make all types concerning palettes be floats, including PaletteTableWidgetItem.
-PaletteTableWidgetItem is no longer templated because all palettes are float.
-Include the source colors for user created gradients.
-Change parallel_for() calls to work with very old versions of TBB which are lingering on some systems.
-Split conditional out of accumulation loop on the CPU for better performance.
-Vectorize summing when doing density filter for better performance.
-Make all usage of palettes be of type float, double is pointless.
-Allow palettes to reside in multiple folders, while ensuring only one of each name is added.
-Refactor some palette path searching code.
-Make ReadFile() throw and catch an exception if the file operation fails.
-A little extra safety in foci and foci3D with a call to Zeps().
-Cast to (real_t) in the OpenCL string for the w variation, which was having trouble compiling on Mac.
-Fixing missing comma between paths in InitPaletteList().
-Move Xml and PaletteList classes into cpp to shorten build times when working on them.
-Remove default param values for IterOpenCLKernelCreator<T>::SharedDataIndexDefines in cpp file.
-Change more NULL to nullptr.
2017-02-26 03:02:21 -05:00
|
|
|
{
|
|
|
|
paletteTable->clear();
|
|
|
|
paletteTable->blockSignals(true);
|
|
|
|
paletteTable->setRowCount(int(palettes->size()));
|
|
|
|
//Headers get removed when clearing, so must re-create here.
|
|
|
|
auto nameHeader = new QTableWidgetItem("Name");
|
|
|
|
auto paletteHeader = new QTableWidgetItem("Palette");
|
|
|
|
nameHeader->setTextAlignment(Qt::AlignLeft | Qt::AlignVCenter);
|
|
|
|
paletteHeader->setTextAlignment(Qt::AlignLeft | Qt::AlignVCenter);
|
|
|
|
paletteTable->setHorizontalHeaderItem(0, nameHeader);
|
|
|
|
paletteTable->setHorizontalHeaderItem(1, paletteHeader);
|
|
|
|
|
|
|
|
//Palette list table.
|
|
|
|
for (auto i = 0; i < palettes->size(); i++)
|
|
|
|
if (auto palette = &(*palettes)[i])
|
|
|
|
AddPaletteToTable(paletteTable, palette, i);
|
|
|
|
|
|
|
|
paletteTable->blockSignals(false);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Get the default search paths for config and palette files.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>vector<QString> of paths</returns>
|
|
|
|
static vector<QString> GetDefaultPaths()
|
|
|
|
{
|
|
|
|
static vector<QString> paths =
|
|
|
|
{
|
|
|
|
(QDir::homePath() + "/AppData/Roaming/Fractorium").toLocal8Bit().data(),
|
|
|
|
#ifndef _WIN32
|
|
|
|
QString("/usr/share/fractorium").toLocal8Bit().data(),
|
|
|
|
QString("/usr/local/share/fractorium").toLocal8Bit().data(),
|
|
|
|
(QDir::homePath() + "/.config/fractorium").toLocal8Bit().data(),
|
|
|
|
#endif
|
|
|
|
QDir::currentPath().toLocal8Bit().data(),
|
|
|
|
QCoreApplication::applicationDirPath().toLocal8Bit().data()
|
|
|
|
};
|
|
|
|
return paths;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Get the default user path for config and palette files.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>vector<QString> of paths</returns>
|
|
|
|
static QString GetDefaultUserPath()
|
|
|
|
{
|
|
|
|
#ifdef _WIN32
|
|
|
|
return (QDir::homePath() + "/AppData/Roaming/Fractorium").toLocal8Bit().data();
|
|
|
|
#else
|
|
|
|
return (QDir::homePath() + "/.config/fractorium").toLocal8Bit().data();
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Get the first flam3-palettes.xml file in the default search paths.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>The full path and filename if found, else empty string.</returns>
|
|
|
|
static QString FindFirstDefaultPalette()
|
|
|
|
{
|
|
|
|
auto paths = GetDefaultPaths();
|
|
|
|
|
|
|
|
for (auto& path : paths)
|
|
|
|
{
|
|
|
|
auto full = path + "/flam3-palettes.xml";
|
|
|
|
|
|
|
|
if (QFile::exists(full))
|
|
|
|
return full;
|
|
|
|
}
|
|
|
|
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
2015-10-27 00:31:35 -04:00
|
|
|
/// <summary>
|
|
|
|
/// The basic style that is needed for things to look right, this varies by OS.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>The base style</returns>
|
|
|
|
static QString BaseStyle()
|
|
|
|
{
|
|
|
|
return "/*---Base Style---\n"
|
2015-12-31 16:41:59 -05:00
|
|
|
"This is needed to deal with the large tabs in the fusion theme which is the default on Linux, and optional on Windows.\n"
|
|
|
|
"It's not needed for other themes."
|
|
|
|
"You should keep this at the top of whatever custom style you make to ensure the tabs aren't unusually large.*/\n"
|
2016-03-01 20:26:45 -05:00
|
|
|
#ifndef _WIN32
|
2015-12-31 16:41:59 -05:00
|
|
|
"QTabBar::tab { height: 3ex; }\n\n"
|
2015-10-27 00:31:35 -04:00
|
|
|
#else
|
2017-12-21 23:09:08 -05:00
|
|
|
"QTabBar::tab { height: 3ex; }\n\n"
|
2015-10-27 00:31:35 -04:00
|
|
|
#endif
|
2015-12-31 16:41:59 -05:00
|
|
|
"/*This is needed to give the labels on the status bar some padding.*/\n"
|
|
|
|
"QStatusBar QLabel { padding-left: 2px; padding-right: 2px; }\n\n"
|
|
|
|
;
|
2015-10-27 00:31:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Get all parent objects of the passed in widget.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="widget">The widget whose parents will be retrieved</param>
|
|
|
|
/// <returns>The entire parent object chain in a QList</returns>
|
|
|
|
template <typename T>
|
|
|
|
static QList<T> GetAllParents(QWidget* widget)
|
|
|
|
{
|
|
|
|
QList<T> parents;
|
|
|
|
|
|
|
|
while (auto parent = qobject_cast<QWidget*>(widget->parent()))
|
|
|
|
{
|
|
|
|
if (auto parentT = qobject_cast<T>(parent))
|
|
|
|
parents.push_back(parentT);
|
|
|
|
|
|
|
|
widget = parent;
|
|
|
|
}
|
|
|
|
|
|
|
|
return parents;
|
2016-02-13 20:24:51 -05:00
|
|
|
}
|
2016-06-11 20:47:03 -04:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Constrain the value in low to be less than or equal to the value in high.
|
|
|
|
/// Template expected to be any control which has member functions value() and setValue().
|
|
|
|
/// Most likely QSpinBox or QDoubleSpinbox.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="low">The control which must contain the lower value</param>
|
|
|
|
/// <param name="high">The control which must contain the higher value</param>
|
|
|
|
/// <returns>True if the value of low had to be changed, else false.</returns>
|
|
|
|
template <typename T>
|
|
|
|
bool ConstrainLow(T* low, T* high)
|
|
|
|
{
|
|
|
|
if (low->value() > high->value())
|
|
|
|
{
|
|
|
|
low->blockSignals(true);
|
|
|
|
low->setValue(high->value());
|
|
|
|
low->blockSignals(false);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Constrain the value in high to be greater than or equal to the value in low.
|
|
|
|
/// Template expected to be any control which has member functions value() and setValue().
|
|
|
|
/// Most likely QSpinBox or QDoubleSpinbox.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="low">The control which must contain the lower value</param>
|
|
|
|
/// <param name="high">The control which must contain the higher value</param>
|
|
|
|
/// <returns>True if the value of high had to be changed, else false.</returns>
|
|
|
|
template <typename T>
|
|
|
|
bool ConstrainHigh(T* low, T* high)
|
|
|
|
{
|
|
|
|
if (high->value() < low->value())
|
|
|
|
{
|
|
|
|
high->blockSignals(true);
|
|
|
|
high->setValue(low->value());
|
|
|
|
high->blockSignals(false);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
2016-12-05 22:04:33 -05:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Move all, possibly disjointly, selected items in a range to
|
|
|
|
/// a new location and update all existing locations.
|
|
|
|
/// Atribution: Sean Parent, Going Native 2013.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="f">The location of the first selected item, or the start of the collection.</param>
|
|
|
|
/// <param name="l">The location of the last selected item, or the end of the collection.</param>
|
|
|
|
/// <returns>A pair of iterators representing the start and end locations of the list of newly moved items</returns>
|
|
|
|
template <typename I, typename S>
|
|
|
|
pair<I, I> Gather(I f, I l, I p, S s)
|
|
|
|
{
|
|
|
|
return
|
|
|
|
{
|
|
|
|
stable_partition(f, p, [&](const typename iterator_traits<I>::value_type & x) { return !s(x); }),
|
|
|
|
stable_partition(p, l, s)
|
|
|
|
};
|
|
|
|
}
|