New batch of "uninitialized values" bugfix. No issue.
This commit is contained in:
@@ -307,6 +307,10 @@ void Crop::update (int todo) {
|
||||
if (cieCrop) delete cieCrop; cieCrop=NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// all pipette buffer processing should be finished now
|
||||
EditBuffer::setReady();
|
||||
|
||||
// switch back to rgb
|
||||
parent->ipf.lab2monitorRgb (labnCrop, cropImg);
|
||||
|
||||
|
@@ -23,7 +23,7 @@ namespace rtengine {
|
||||
|
||||
EditBuffer::EditBuffer(::EditDataProvider *dataProvider) :
|
||||
objectMap(NULL), objectMap2(NULL), objectMode(OM_255), dataProvider(dataProvider),
|
||||
imgFloatBuffer(NULL), LabBuffer(NULL), singlePlaneBuffer() {}
|
||||
imgFloatBuffer(NULL), LabBuffer(NULL), singlePlaneBuffer(), ready(false) {}
|
||||
|
||||
EditBuffer::~EditBuffer() {
|
||||
flush();
|
||||
@@ -50,6 +50,7 @@ void EditBuffer::flush() {
|
||||
LabBuffer = NULL;
|
||||
}
|
||||
singlePlaneBuffer.flushData();
|
||||
ready = false;
|
||||
}
|
||||
|
||||
/* Upgrade or downgrade the objectModeType; we're assuming that objectMap has been allocated */
|
||||
@@ -155,6 +156,7 @@ void EditBuffer::resize(int newWidth, int newHeight, EditSubscriber* newSubscrib
|
||||
if (objectMap2) objectMap2.clear();
|
||||
}
|
||||
}
|
||||
ready = false;
|
||||
}
|
||||
|
||||
bool EditBuffer::bufferCreated() {
|
||||
@@ -190,29 +192,29 @@ int EditBuffer::getObjectID(const Coord& location) {
|
||||
}
|
||||
|
||||
void EditBuffer::getPipetteData(float* v, int x, int y, int squareSize) {
|
||||
if (dataProvider && dataProvider->getCurrSubscriber()) {
|
||||
if (ready && dataProvider && dataProvider->getCurrSubscriber()) {
|
||||
switch (dataProvider->getCurrSubscriber()->getEditBufferType()) {
|
||||
case (BT_IMAGEFLOAT):
|
||||
if (imgFloatBuffer)
|
||||
if (imgFloatBuffer) {
|
||||
imgFloatBuffer->getPipetteData(v[0], v[1], v[2], x, y, squareSize, 0);
|
||||
else
|
||||
v[0] = v[1] = v[2] = -1.f;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case (BT_LABIMAGE):
|
||||
if (LabBuffer)
|
||||
if (LabBuffer) {
|
||||
LabBuffer->getPipetteData(v[0], v[1], v[2], x, y, squareSize);
|
||||
else
|
||||
v[0] = v[1] = v[2] = -1.f;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case (BT_SINGLEPLANE_FLOAT):
|
||||
if (singlePlaneBuffer.data != NULL) {
|
||||
singlePlaneBuffer.getPipetteData(v[0], x, y, squareSize, 0);
|
||||
v[1] = v[2] = -1.f;
|
||||
return;
|
||||
}
|
||||
else
|
||||
v[0] = v[1] = v[2] = -1.f;
|
||||
}
|
||||
}
|
||||
v[0] = v[1] = v[2] = -1.f;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -47,6 +47,8 @@ protected:
|
||||
LabImage* LabBuffer;
|
||||
PlanarWhateverData<float> singlePlaneBuffer;
|
||||
|
||||
bool ready; // flag that indicates if the _pipette_ buffer is ready
|
||||
|
||||
void createBuffer(int width, int height);
|
||||
void resize(int newWidth, int newHeight, EditSubscriber* newSubscriber);
|
||||
void resize(int newWidth, int newHeight);
|
||||
@@ -56,6 +58,12 @@ public:
|
||||
EditBuffer(::EditDataProvider *dataProvider);
|
||||
~EditBuffer();
|
||||
|
||||
/** @brief Getter to know if the pipette buffer is correctly filled */
|
||||
bool isReady() { return ready; }
|
||||
|
||||
/** @brief Setter to tell that the pipette buffer is correctly filled
|
||||
* You have to use this method once the pipette is filled, so it can be read. */
|
||||
void setReady() { ready = true; }
|
||||
|
||||
void setObjectMode(ObjectMode newType);
|
||||
::EditDataProvider* getDataProvider() { return dataProvider; }
|
||||
|
@@ -2245,7 +2245,6 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, EditBuffer *e
|
||||
|
||||
// Allocating buffer for the EditBuffer
|
||||
float *editIFloatTmpR, *editIFloatTmpG, *editIFloatTmpB, *editWhateverTmp;
|
||||
char *editIFBuffer = NULL;
|
||||
if (editImgFloat) {
|
||||
editIFloatBuffer = (char *) malloc(3*sizeof(float)*TS*TS + 20*64 + 63);
|
||||
data = (char*)( ( uintptr_t(editIFloatBuffer) + uintptr_t(63)) / 64 * 64);
|
||||
|
@@ -116,32 +116,6 @@ void HSVEqualizer::write (ProcParams* pp, ParamsEdited* pedited) {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
void HSVEqualizer::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) {
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
sat[i]->setDefault(defParams->hsvequalizer.sat[i]);
|
||||
val[i]->setDefault(defParams->hsvequalizer.val[i]);
|
||||
hue[i]->setDefault(defParams->hsvequalizer.hue[i]);
|
||||
}
|
||||
|
||||
if (pedited) {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
sat[i]->setDefaultEditedState(pedited->hsvequalizer.sat[i] ? Edited : UnEdited);
|
||||
val[i]->setDefaultEditedState(pedited->hsvequalizer.val[i] ? Edited : UnEdited);
|
||||
hue[i]->setDefaultEditedState(pedited->hsvequalizer.hue[i] ? Edited : UnEdited);
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
sat[i]->setDefaultEditedState(Irrelevant);
|
||||
val[i]->setDefaultEditedState(Irrelevant);
|
||||
hue[i]->setDefaultEditedState(Irrelevant);
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
* Curve listener
|
||||
*
|
||||
@@ -160,58 +134,6 @@ void HSVEqualizer::curveChanged (CurveEditor* ce) {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
void HSVEqualizer::adjusterChanged (Adjuster* a, double newval) {
|
||||
|
||||
if (listener && enabled->get_active()) {
|
||||
std::stringstream ss;
|
||||
ss << "(";
|
||||
int i;
|
||||
if (hsvchannel->get_active_row_number()==0) {
|
||||
for (i = 0; i < 8; i++) {
|
||||
if (i > 0) {
|
||||
ss << ", ";
|
||||
}
|
||||
if (i == 4) {
|
||||
ss << "\n";
|
||||
}
|
||||
ss << static_cast<int>(sat[i]->getValue());
|
||||
}
|
||||
ss << ")";
|
||||
listener->panelChanged (EvHSVEqualizerS, ss.str());
|
||||
}
|
||||
else if (hsvchannel->get_active_row_number()==1) {
|
||||
for (i = 0; i < 8; i++) {
|
||||
if (i > 0) {
|
||||
ss << ", ";
|
||||
}
|
||||
if (i == 4) {
|
||||
ss << "\n";
|
||||
}
|
||||
ss << static_cast<int>(val[i]->getValue());
|
||||
}
|
||||
ss << ")";
|
||||
listener->panelChanged (EvHSVEqualizerV, ss.str());
|
||||
}
|
||||
else if (hsvchannel->get_active_row_number()==2) {
|
||||
for (i = 0; i < 8; i++) {
|
||||
if (i > 0) {
|
||||
ss << ", ";
|
||||
}
|
||||
if (i == 4) {
|
||||
ss << "\n";
|
||||
}
|
||||
ss << static_cast<int>(hue[i]->getValue());
|
||||
}
|
||||
ss << ")";
|
||||
listener->panelChanged (EvHSVEqualizerH, ss.str());
|
||||
}
|
||||
|
||||
//listener->panelChanged (EvHSVEqualizer, ss.str());
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
void HSVEqualizer::colorForValue (double valX, double valY, int callerId, ColorCaller* caller) {
|
||||
|
||||
float r, g, b;
|
||||
|
@@ -751,45 +751,42 @@ void MyDiagonalCurve::pipetteButton1Pressed(EditDataProvider *provider, int modi
|
||||
|
||||
snapToElmt = -100;
|
||||
if (curve.type!=DCT_Parametric) {
|
||||
snapToElmt = -100;
|
||||
if (curve.type!=DCT_Parametric) {
|
||||
std::vector<double>::iterator itx, ity;
|
||||
buttonPressed = true;
|
||||
std::vector<double>::iterator itx, ity;
|
||||
buttonPressed = true;
|
||||
|
||||
// get the pointer position
|
||||
int px = graphX + int(float(graphW)*pipetteVal); // WARNING: converting pipetteVal from float to int, precision loss here!
|
||||
getCursorPosition(Gdk::BUTTON_PRESS, false, px, graphY, Gdk::ModifierType(modifierKey));
|
||||
findClosestPoint();
|
||||
// get the pointer position
|
||||
int px = graphX + int(float(graphW)*pipetteVal); // WARNING: converting pipetteVal from float to int, precision loss here!
|
||||
getCursorPosition(Gdk::BUTTON_PRESS, false, px, graphY, Gdk::ModifierType(modifierKey));
|
||||
findClosestPoint();
|
||||
|
||||
if (distanceX > minDistanceX) {
|
||||
rtengine::DiagonalCurve rtCurve(getPoints(), 200);
|
||||
if (distanceX > minDistanceX) {
|
||||
rtengine::DiagonalCurve rtCurve(getPoints(), 200);
|
||||
|
||||
/* insert a new control point */
|
||||
if (num > 0) {
|
||||
if (clampedX > curve.x[closest_point])
|
||||
++closest_point;
|
||||
}
|
||||
itx = curve.x.begin();
|
||||
ity = curve.y.begin();
|
||||
for (int i=0; i<closest_point; i++) { itx++; ity++; }
|
||||
curve.x.insert (itx, 0);
|
||||
curve.y.insert (ity, 0);
|
||||
num++;
|
||||
|
||||
// the graph is refreshed only if a new point is created (snaped to a pixel)
|
||||
curve.x[closest_point] = clampedX;
|
||||
curve.y[closest_point] = clampedY = rtCurve.getVal(pipetteVal);
|
||||
|
||||
curveIsDirty = true;
|
||||
setDirty(true);
|
||||
draw (closest_point);
|
||||
notifyListener ();
|
||||
/* insert a new control point */
|
||||
if (num > 0) {
|
||||
if (clampedX > curve.x[closest_point])
|
||||
++closest_point;
|
||||
}
|
||||
grab_point = closest_point;
|
||||
lit_point = closest_point;
|
||||
ugpX = curve.x[closest_point];
|
||||
ugpY = curve.y[closest_point];
|
||||
itx = curve.x.begin();
|
||||
ity = curve.y.begin();
|
||||
for (int i=0; i<closest_point; i++) { itx++; ity++; }
|
||||
curve.x.insert (itx, 0);
|
||||
curve.y.insert (ity, 0);
|
||||
num++;
|
||||
|
||||
// the graph is refreshed only if a new point is created (snaped to a pixel)
|
||||
curve.x[closest_point] = clampedX;
|
||||
curve.y[closest_point] = clampedY = rtCurve.getVal(pipetteVal);
|
||||
|
||||
curveIsDirty = true;
|
||||
setDirty(true);
|
||||
draw (closest_point);
|
||||
notifyListener ();
|
||||
}
|
||||
grab_point = closest_point;
|
||||
lit_point = closest_point;
|
||||
ugpX = curve.x[closest_point];
|
||||
ugpY = curve.y[closest_point];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -849,7 +846,7 @@ void MyDiagonalCurve::pipetteButton1Released(EditDataProvider *provider) {
|
||||
draw (lit_point);
|
||||
}
|
||||
grab_point = -1;
|
||||
notifyListener ();
|
||||
//notifyListener ();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -21,7 +21,7 @@
|
||||
#include "imagearea.h"
|
||||
#include "cursormanager.h"
|
||||
|
||||
PreviewWindow::PreviewWindow () : previewHandler(NULL), mainCropWin(NULL), imageArea(NULL), isMoving(false), zoom(0.0) {
|
||||
PreviewWindow::PreviewWindow () : previewHandler(NULL), mainCropWin(NULL), imageArea(NULL), isMoving(false), imgX(0), imgY(0), imgW(0), imgH(0), zoom(0.0) {
|
||||
|
||||
rconn = signal_size_allocate().connect( sigc::mem_fun(*this, &PreviewWindow::on_resized) );
|
||||
}
|
||||
|
@@ -71,16 +71,19 @@ class ToolPanel {
|
||||
ToolPanel () : listener(NULL), tmp(NULL), batchMode(false), multiImage(false) {}
|
||||
virtual ~ToolPanel() {}
|
||||
|
||||
void setParent (Gtk::Box* parent) {}
|
||||
Gtk::Box* getParent () { return NULL; }
|
||||
void setMultiImage (bool m) { multiImage = m; }
|
||||
void setListener (ToolPanelListener* tpl) { listener = tpl; }
|
||||
virtual void setEditProvider (EditDataProvider *provider) {}
|
||||
virtual void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL) {}
|
||||
virtual void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL) {}
|
||||
virtual void trimValues (rtengine::procparams::ProcParams* pp) { return; }
|
||||
virtual void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL) {}
|
||||
virtual void autoOpenCurve () {}
|
||||
virtual void setParent (Gtk::Box* parent) {}
|
||||
virtual Gtk::Box* getParent () { return NULL; }
|
||||
virtual Gtk::Expander* getExpander () { return NULL; }
|
||||
virtual void setExpanded (bool expanded) {}
|
||||
virtual bool getExpanded () { return false; }
|
||||
void setMultiImage (bool m) { multiImage = m; }
|
||||
void setListener (ToolPanelListener* tpl) { listener = tpl; }
|
||||
virtual void setEditProvider (EditDataProvider *provider) {}
|
||||
virtual void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL) {}
|
||||
virtual void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL) {}
|
||||
virtual void trimValues (rtengine::procparams::ProcParams* pp) { return; }
|
||||
virtual void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL) {}
|
||||
virtual void autoOpenCurve () {}
|
||||
|
||||
/** @brief Disable the event broadcasting mechanism
|
||||
*
|
||||
@@ -98,15 +101,18 @@ class ToolPanel {
|
||||
|
||||
class FoldableToolPanel : public ToolPanel {
|
||||
|
||||
protected:
|
||||
protected:
|
||||
Gtk::Box* parentContainer;
|
||||
void foldThemAll (GdkEventButton* event);
|
||||
Gtk::Expander* exp;
|
||||
|
||||
public:
|
||||
Gtk::Expander* exp;
|
||||
|
||||
FoldableToolPanel(Gtk::Box* content);
|
||||
|
||||
Gtk::Expander * getExpander() { return exp; }
|
||||
void setExpanded (bool expanded) { if (exp) exp->set_expanded( expanded ); }
|
||||
bool getExpanded () { if (exp) return exp->get_expanded(); return false; }
|
||||
void setParent (Gtk::Box* parent) { parentContainer = parent; }
|
||||
Gtk::Box* getParent () { return parentContainer; }
|
||||
void setLabel (Glib::ustring label, bool need100Percent=false);
|
||||
|
@@ -213,8 +213,8 @@ void ToolPanelCoordinator::addPanel (Gtk::Box* where, FoldableToolPanel* panel,
|
||||
panel->setParent(where);
|
||||
panel->setLabel(escapeHtmlChars(label), need100Percent);
|
||||
|
||||
expList.push_back (panel->exp);
|
||||
where->pack_start(*panel->exp, false, false);
|
||||
expList.push_back (panel->getExpander());
|
||||
where->pack_start(*panel->getExpander(), false, false);
|
||||
}
|
||||
|
||||
ToolPanelCoordinator::~ToolPanelCoordinator () {
|
||||
@@ -542,18 +542,18 @@ void ToolPanelCoordinator::updateCurveBackgroundHistogram (LUTu & histToneCurve,
|
||||
|
||||
void ToolPanelCoordinator::foldAllButOne (Gtk::Box* parent, FoldableToolPanel* openedSection) {
|
||||
|
||||
FoldableToolPanel* currentTP;
|
||||
|
||||
for (size_t i=0; i<toolPanels.size(); i++) {
|
||||
currentTP = static_cast<FoldableToolPanel*>(toolPanels[i]);
|
||||
if (currentTP->getParent() == parent) {
|
||||
// Section in the same tab, we unfold it if it's not the one that has been clicked
|
||||
if (currentTP != openedSection) {
|
||||
currentTP->exp->set_expanded(false);
|
||||
}
|
||||
else {
|
||||
if (!currentTP->exp->get_expanded())
|
||||
currentTP->exp->set_expanded(true);
|
||||
for (size_t i=0; i<toolPanels.size(); i++) {
|
||||
if (toolPanels[i]->getParent() != NULL) {
|
||||
ToolPanel* currentTP = toolPanels[i];
|
||||
if (currentTP->getParent() == parent) {
|
||||
// Section in the same tab, we unfold it if it's not the one that has been clicked
|
||||
if (currentTP != openedSection) {
|
||||
currentTP->setExpanded(false);
|
||||
}
|
||||
else {
|
||||
if (!currentTP->getExpanded())
|
||||
currentTP->setExpanded(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -561,8 +561,8 @@ void ToolPanelCoordinator::foldAllButOne (Gtk::Box* parent, FoldableToolPanel* o
|
||||
|
||||
bool ToolPanelCoordinator::handleShortcutKey (GdkEventKey* event) {
|
||||
|
||||
//bool ctrl = event->state & GDK_CONTROL_MASK; temporarilly removed because unused
|
||||
//bool shift = event->state & GDK_SHIFT_MASK; temporarilly removed because unused
|
||||
//bool ctrl = event->state & GDK_CONTROL_MASK; temporarily removed because unused
|
||||
//bool shift = event->state & GDK_SHIFT_MASK; temporarily removed because unused
|
||||
bool alt = event->state & GDK_MOD1_MASK;
|
||||
|
||||
if (alt){
|
||||
@@ -627,16 +627,16 @@ void ToolPanelCoordinator::toolSelected (ToolMode tool) {
|
||||
GThreadLock lock; // All GUI acces from idle_add callbacks or separate thread HAVE to be protected
|
||||
switch (tool) {
|
||||
case TMCropSelect:
|
||||
crop->exp->set_expanded(true);
|
||||
crop->setExpanded(true);
|
||||
toolPanelNotebook->set_current_page(toolPanelNotebook->page_num(*transformPanelSW));
|
||||
break;
|
||||
case TMSpotWB:
|
||||
whitebalance->exp->set_expanded(true);
|
||||
whitebalance->setExpanded(true);
|
||||
toolPanelNotebook->set_current_page(toolPanelNotebook->page_num(*colorPanelSW));
|
||||
break;
|
||||
case TMStraighten:
|
||||
lensgeom->exp->set_expanded(true);
|
||||
rotate->exp->set_expanded(true);
|
||||
lensgeom->setExpanded(true);
|
||||
rotate->setExpanded(true);
|
||||
toolPanelNotebook->set_current_page(toolPanelNotebook->page_num(*transformPanelSW));
|
||||
break;
|
||||
default:
|
||||
|
Reference in New Issue
Block a user