mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-07-02 22:34:52 -04:00
Features:
--Add support for Exr files which use 32-bit floats for each RGBA channel. Seems to come out too washed out. --Allow for clearing an individual color curve. --Allow for saving multiple image types in EmberRender and EmberAnimate. All writes are threaded. --Remove --bpc command line argument. Add format png16 as a replacement. --Remove --enable_jpg_comments and --enable_png_comments command line arguments, and replace them with --enable_comments which applies to jpg, png and exr. --Add menu items to variations and affine spinners which allow for easy entry of specific numeric values like pi. --Make final render dialog be wider rather than so tall. Bug fixes: --Fix some OpenCL compile errors on Mac. --Remove ability to save bitmap files on all platforms but Windows. Code changes: --New dependency on OpenEXR. --Allow Curves class to interact with objects of a different template type. --Make m_Curves member of Ember always use float as template type. --Set the length of the curves array to always be 2^17 which should offer enough precision with new 32-bit float pixel types. --Set pixel types to always be 32-bit float. This results in a major reduction of code in the final accumulation part of Renderer.h/cpp. --Remove corresponding code from RendererCL and FinalAccumOpenCLKernelCreator. --Remove Transparency, NumChannels and BytesPerPixel setters from Renderer.h/cpp. --Add new global functions to format final image buffers and place all alpha calculation and scaling code in them. --Blending is no longer needed in OpenGLWidget because of the new pixel type. --Make new class, AffineDoubleSpinBox. --Attempt to make file save dialog code work the same on all OSes. --Remove some unused functions.
This commit is contained in:
@ -169,7 +169,7 @@ void DoubleSpinBox::OnTimeout()
|
||||
/// <returns>false</returns>
|
||||
bool DoubleSpinBox::eventFilter(QObject* o, QEvent* e)
|
||||
{
|
||||
QMouseEvent* me = dynamic_cast<QMouseEvent*>(e);
|
||||
auto me = dynamic_cast<QMouseEvent*>(e);
|
||||
|
||||
if (isEnabled() && me)
|
||||
{
|
||||
@ -287,3 +287,124 @@ void DoubleSpinBox::StopTimer()
|
||||
s_Timer.stop();
|
||||
disconnect(&s_Timer, SIGNAL(timeout()), this, SLOT(OnTimeout()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor that passes agruments to the base and assigns the m_Param and m_Variation members.
|
||||
/// It also sets up the context menu for special numerical values.
|
||||
/// </summary>
|
||||
/// <param name="p">The parent widget</param>
|
||||
/// <param name="widgetItem">The widget item this spinner is contained in</param>
|
||||
/// <param name="id">The variation this spinner is for</param>
|
||||
/// <param name="param">The name of the parameter this is for</param>
|
||||
/// <param name="h">The height of the spin box. Default: 16.</param>
|
||||
/// <param name="step">The step used to increment/decrement the spin box when using the mouse wheel. Default: 0.05.</param>
|
||||
VariationTreeDoubleSpinBox::VariationTreeDoubleSpinBox(QWidget* p, VariationTreeWidgetItem* widgetItem, eVariationId id, const string& param, int h, double step)
|
||||
: DoubleSpinBox(p, h, step)
|
||||
{
|
||||
m_WidgetItem = widgetItem;
|
||||
m_Param = param;
|
||||
m_Id = id;
|
||||
setDecimals(3);
|
||||
//PI
|
||||
auto piAction = new QAction("PI", this);
|
||||
connect(piAction, SIGNAL(triggered(bool)), this, SLOT(PiActionTriggered(bool)), Qt::QueuedConnection);
|
||||
this->addAction(piAction);
|
||||
//PI * 2
|
||||
auto twoPiAction = new QAction("2 PI", this);
|
||||
connect(twoPiAction, SIGNAL(triggered(bool)), this, SLOT(TwoPiActionTriggered(bool)), Qt::QueuedConnection);
|
||||
this->addAction(twoPiAction);
|
||||
//PI / 2
|
||||
auto piOver2Action = new QAction("PI / 2", this);
|
||||
connect(piOver2Action, SIGNAL(triggered(bool)), this, SLOT(PiOver2ActionTriggered(bool)), Qt::QueuedConnection);
|
||||
this->addAction(piOver2Action);
|
||||
//PI / 3
|
||||
auto piOver3Action = new QAction("PI / 3", this);
|
||||
connect(piOver3Action, SIGNAL(triggered(bool)), this, SLOT(PiOver3ActionTriggered(bool)), Qt::QueuedConnection);
|
||||
this->addAction(piOver3Action);
|
||||
//PI / 4
|
||||
auto piOver4Action = new QAction("PI / 4", this);
|
||||
connect(piOver4Action, SIGNAL(triggered(bool)), this, SLOT(PiOver4ActionTriggered(bool)), Qt::QueuedConnection);
|
||||
this->addAction(piOver4Action);
|
||||
//PI / 6
|
||||
auto piOver6Action = new QAction("PI / 6", this);
|
||||
connect(piOver6Action, SIGNAL(triggered(bool)), this, SLOT(PiOver6ActionTriggered(bool)), Qt::QueuedConnection);
|
||||
this->addAction(piOver6Action);
|
||||
//1 / PI
|
||||
auto oneOverPiAction = new QAction("1 / PI", this);
|
||||
connect(oneOverPiAction, SIGNAL(triggered(bool)), this, SLOT(OneOverPiActionTriggered(bool)), Qt::QueuedConnection);
|
||||
this->addAction(oneOverPiAction);
|
||||
//2 / PI
|
||||
auto twoOverPiAction = new QAction("2 / PI", this);
|
||||
connect(twoOverPiAction, SIGNAL(triggered(bool)), this, SLOT(TwoOverPiActionTriggered(bool)), Qt::QueuedConnection);
|
||||
this->addAction(twoOverPiAction);
|
||||
//3 / PI
|
||||
auto threeOverPiAction = new QAction("3 / PI", this);
|
||||
connect(threeOverPiAction, SIGNAL(triggered(bool)), this, SLOT(ThreeOverPiActionTriggered(bool)), Qt::QueuedConnection);
|
||||
this->addAction(threeOverPiAction);
|
||||
//4 / PI
|
||||
auto fourOverPiAction = new QAction("4 / PI", this);
|
||||
connect(fourOverPiAction, SIGNAL(triggered(bool)), this, SLOT(FourOverPiActionTriggered(bool)), Qt::QueuedConnection);
|
||||
this->addAction(fourOverPiAction);
|
||||
//Sqrt(2)
|
||||
auto sqrtTwoAction = new QAction("Sqrt(2)", this);
|
||||
connect(sqrtTwoAction, SIGNAL(triggered(bool)), this, SLOT(SqrtTwoActionTriggered(bool)), Qt::QueuedConnection);
|
||||
this->addAction(sqrtTwoAction);
|
||||
//Sqrt(2)
|
||||
auto sqrtThreeAction = new QAction("Sqrt(3)", this);
|
||||
connect(sqrtThreeAction, SIGNAL(triggered(bool)), this, SLOT(SqrtThreeActionTriggered(bool)), Qt::QueuedConnection);
|
||||
this->addAction(sqrtThreeAction);
|
||||
//Need this for it to show up properly.
|
||||
this->setContextMenuPolicy(Qt::ActionsContextMenu);
|
||||
}
|
||||
|
||||
void VariationTreeDoubleSpinBox::PiActionTriggered(bool checked) { setValue(M_PI); }
|
||||
void VariationTreeDoubleSpinBox::TwoPiActionTriggered(bool checked) { setValue(M_PI * 2); }
|
||||
void VariationTreeDoubleSpinBox::PiOver2ActionTriggered(bool checked) { setValue(M_PI_2); }
|
||||
void VariationTreeDoubleSpinBox::PiOver3ActionTriggered(bool checked) { setValue(M_PI / 3); }
|
||||
void VariationTreeDoubleSpinBox::PiOver4ActionTriggered(bool checked) { setValue(M_PI / 4); }
|
||||
void VariationTreeDoubleSpinBox::PiOver6ActionTriggered(bool checked) { setValue(M_PI / 6); }
|
||||
void VariationTreeDoubleSpinBox::OneOverPiActionTriggered(bool checked) { setValue(1 / M_PI); }
|
||||
void VariationTreeDoubleSpinBox::TwoOverPiActionTriggered(bool checked) { setValue(2 / M_PI); }
|
||||
void VariationTreeDoubleSpinBox::ThreeOverPiActionTriggered(bool checked) { setValue(3 / M_PI); }
|
||||
void VariationTreeDoubleSpinBox::FourOverPiActionTriggered(bool checked) { setValue(4 / M_PI); }
|
||||
void VariationTreeDoubleSpinBox::SqrtTwoActionTriggered(bool checked) { setValue(M_SQRT2); }
|
||||
void VariationTreeDoubleSpinBox::SqrtThreeActionTriggered(bool checked) { setValue(std::sqrt(3.0)); }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor that sets up the context menu for special numerical values specific to affine spinners.
|
||||
/// </summary>
|
||||
/// <param name="p">The parent widget</param>
|
||||
/// <param name="h">The height of the spin box. Default: 20.</param>
|
||||
/// <param name="step">The step used to increment/decrement the spin box when using the mouse wheel. Default: 0.01.</param>
|
||||
AffineDoubleSpinBox::AffineDoubleSpinBox(QWidget* p, int h, double step)
|
||||
: DoubleSpinBox(p, h, step)
|
||||
{
|
||||
//-1
|
||||
auto neg1Action = new QAction("-1", this);
|
||||
connect(neg1Action, SIGNAL(triggered(bool)), this, SLOT(NegOneActionTriggered(bool)), Qt::QueuedConnection);
|
||||
this->addAction(neg1Action);
|
||||
//0
|
||||
auto zeroAction = new QAction("0", this);
|
||||
connect(zeroAction, SIGNAL(triggered(bool)), this, SLOT(ZeroActionTriggered(bool)), Qt::QueuedConnection);
|
||||
this->addAction(zeroAction);
|
||||
//1
|
||||
auto oneAction = new QAction("1", this);
|
||||
connect(oneAction, SIGNAL(triggered(bool)), this, SLOT(OneActionTriggered(bool)), Qt::QueuedConnection);
|
||||
this->addAction(oneAction);
|
||||
//45
|
||||
auto fortyFiveAction = new QAction("45", this);
|
||||
connect(fortyFiveAction, SIGNAL(triggered(bool)), this, SLOT(FortyFiveActionTriggered(bool)), Qt::QueuedConnection);
|
||||
this->addAction(fortyFiveAction);
|
||||
//-45
|
||||
auto negFortyFiveAction = new QAction("-45", this);
|
||||
connect(negFortyFiveAction, SIGNAL(triggered(bool)), this, SLOT(NegFortyFiveActionTriggered(bool)), Qt::QueuedConnection);
|
||||
this->addAction(negFortyFiveAction);
|
||||
//Need this for it to show up properly.
|
||||
this->setContextMenuPolicy(Qt::ActionsContextMenu);
|
||||
}
|
||||
|
||||
void AffineDoubleSpinBox::NegOneActionTriggered(bool checked) { setValue(-1); }
|
||||
void AffineDoubleSpinBox::ZeroActionTriggered(bool checked) { setValue(0); }
|
||||
void AffineDoubleSpinBox::OneActionTriggered(bool checked) { setValue(1); }
|
||||
void AffineDoubleSpinBox::FortyFiveActionTriggered(bool checked) { setValue(0.707107); }
|
||||
void AffineDoubleSpinBox::NegFortyFiveActionTriggered(bool checked) { setValue(-0.707107); }
|
||||
|
Reference in New Issue
Block a user