Merged mfeemster/fractorium into master

This commit is contained in:
Michel Mastriani 2020-03-17 20:22:04 -03:00
commit 283598616a
7 changed files with 21 additions and 9 deletions

View File

@ -126,6 +126,7 @@ public:
m_CamMat = ember.m_CamMat;
m_CenterX = T(ember.m_CenterX);
m_CenterY = T(ember.m_CenterY);
m_RotCenterY = T(ember.m_RotCenterY);
m_Rotate = T(ember.m_Rotate);
m_Brightness = T(ember.m_Brightness);
m_Gamma = T(ember.m_Gamma);
@ -1403,6 +1404,7 @@ public:
m_Palette.m_Index = -1;
m_CenterX = 0;
m_CenterY = 0;
m_RotCenterY = 0;
m_Gamma = 4;
m_Vibrancy = 1;
m_Brightness = 4;
@ -1537,6 +1539,7 @@ public:
<< "Depth Blur: " << m_CamDepthBlur << "\n"
<< "CenterX: " << m_CenterX << "\n"
<< "CenterY: " << m_CenterY << "\n"
<< "RotCenterY: " << m_RotCenterY << "\n"
<< "Rotate: " << m_Rotate << "\n"
<< "Brightness: " << m_Brightness << "\n"
<< "Gamma: " << m_Gamma << "\n"
@ -1677,6 +1680,7 @@ public:
//Xml field: "center".
T m_CenterX = 0;
T m_CenterY = 0;
T m_RotCenterY = 0;
//Rotate the camera by this many degrees. Since this is a camera rotation, the final output image will be rotated counter-clockwise.
//Xml field: "rotate".

View File

@ -1527,9 +1527,9 @@ void Renderer<T, bucketT>::Accumulate(QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand, Poin
if (Rotate() != 0)
{
T p00 = p.m_X - m_Ember.m_CenterX;
T p11 = p.m_Y - m_Ember.m_CenterY;
T p11 = p.m_Y - m_Ember.m_RotCenterY;
p.m_X = (p00 * m_RotMat.A()) + (p11 * m_RotMat.B()) + m_Ember.m_CenterX;
p.m_Y = (p00 * m_RotMat.D()) + (p11 * m_RotMat.E()) + m_Ember.m_CenterY;
p.m_Y = (p00 * m_RotMat.D()) + (p11 * m_RotMat.E()) + m_Ember.m_RotCenterY;
}
//Checking this first before converting gives better performance than converting and checking a single value, which the original did.
@ -1600,9 +1600,9 @@ void Renderer<T, bucketT>::Accumulate(QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand, Poin
if (Rotate() != 0)
{
T p00 = p.m_X - m_Ember.m_CenterX;
T p11 = p.m_Y - m_Ember.m_CenterY;
T p11 = p.m_Y - m_Ember.m_RotCenterY;
p.m_X = (p00 * m_RotMat.A()) + (p11 * m_RotMat.B()) + m_Ember.m_CenterX;
p.m_Y = (p00 * m_RotMat.D()) + (p11 * m_RotMat.E()) + m_Ember.m_CenterY;
p.m_Y = (p00 * m_RotMat.D()) + (p11 * m_RotMat.E()) + m_Ember.m_RotCenterY;
}
if (m_CarToRas.InBounds(p))

View File

@ -1379,6 +1379,7 @@ bool XmlToEmber<T>::ParseEmberElementFromChaos(xmlNode* emberNode, Ember<T>& cur
istringstream istr(pos);
istr >> currentEmber.m_CenterX >> currentEmber.m_CenterY;
currentEmber.m_CenterY *= -1;
currentEmber.m_RotCenterY = currentEmber.m_CenterY;
}
else
{
@ -1668,6 +1669,7 @@ bool XmlToEmber<T>::ParseEmberElement(xmlNode* emberNode, Ember<T>& currentEmber
{
istringstream is(attStr);
is >> currentEmber.m_CenterX >> currentEmber.m_CenterY;
currentEmber.m_RotCenterY = currentEmber.m_CenterY;
}
else if (!Compare(curAtt->name, "filter_shape"))
{

View File

@ -1837,7 +1837,7 @@ void RendererCL<T, bucketT>::ConvertEmber(Ember<T>& ember, EmberCL<T>& emberCL,
emberCL.m_BlurCoef = ember.BlurCoef();
emberCL.m_CamMat = ember.m_CamMat;
emberCL.m_CenterX = ember.m_CenterX;
emberCL.m_CenterY = ember.m_CenterY;
emberCL.m_CenterY = ember.m_RotCenterY;
emberCL.m_RotA = m_RotMat.A();
emberCL.m_RotB = m_RotMat.B();
emberCL.m_RotD = m_RotMat.D();

View File

@ -369,7 +369,7 @@ template <typename T> void FractoriumEmberController<T>::CenterYChanged(double d
{
UpdateAll([&](Ember<T>& ember, bool isMain)
{
ember.m_CenterY = d;
ember.m_CenterY = ember.m_RotCenterY = d;
}, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll());
}
void Fractorium::OnCenterYChanged(double d) { m_Controller->CenterYChanged(d); }
@ -772,7 +772,7 @@ void FractoriumEmberController<T>::SetCenter(double x, double y)
UpdateAll([&](Ember<T>& ember, bool isMain)
{
ember.m_CenterX = x;
ember.m_CenterY = y;
ember.m_CenterY = ember.m_RotCenterY = y;
}, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll());
m_Fractorium->m_CenterXSpin->SetValueStealth(x);//Don't trigger a redraw twice.
m_Fractorium->m_CenterYSpin->SetValueStealth(y);
@ -873,7 +873,7 @@ void FractoriumEmberController<T>::ParamsToEmberPrivate(Ember<U>& ember, bool im
ember.m_FinalRasW = m_Fractorium->m_WidthSpin->value();//Geometry.
ember.m_FinalRasH = m_Fractorium->m_HeightSpin->value();
ember.m_CenterX = m_Fractorium->m_CenterXSpin->value();
ember.m_CenterY = m_Fractorium->m_CenterYSpin->value();
ember.m_CenterY = ember.m_RotCenterY = m_Fractorium->m_CenterYSpin->value();
ember.m_PixelsPerUnit = m_Fractorium->m_ScaleSpin->value();
ember.m_Zoom = m_Fractorium->m_ZoomSpin->value();
ember.m_Rotate = m_Fractorium->m_RotateSpin->value();

View File

@ -1043,7 +1043,7 @@ void GLEmberController<T>::MouseMove(QMouseEvent* e)
v2T v1(x, y);
v2T v2 = rotMat.TransformVector(v1);
ember->m_CenterX = v2.x;
ember->m_CenterY = v2.y;
ember->m_CenterY = ember->m_RotCenterY = v2.y;
m_FractoriumEmberController->SetCenter(ember->m_CenterX, ember->m_CenterY);//Will restart the rendering process.
}
else if (m_DragState == eDragState::DragRotateScale)//Rotating and scaling the whole image.

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
fractorium (1.0.0.19c-0ubuntu1) bionic; urgency=low
* release 1.0.0.19
-- Matt Feemster <matt.feemster@gmail.com> Tue, 17 Mar 2020 08:21:22 -0700
fractorium (1.0.0.19b-0ubuntu1) bionic; urgency=low
* release 1.0.0.19