Replace raw arrays with std::array<>
This commit is contained in:
@@ -281,8 +281,8 @@ bool FilmNegative::button1Pressed(int modifierKey)
|
||||
// User has selected 2 reference gray spots. Calculating new exponents
|
||||
// from channel values and updating parameters.
|
||||
|
||||
float newExps[3];
|
||||
if(fnp->getFilmNegativeExponents(refSpotCoords[0], refSpotCoords[1], newExps)) {
|
||||
std::array<float, 3> newExps;
|
||||
if (fnp->getFilmNegativeExponents(refSpotCoords[0], refSpotCoords[1], newExps)) {
|
||||
disableListener();
|
||||
redExp->setValue(newExps[0]);
|
||||
greenExp->setValue(newExps[1]);
|
||||
@@ -335,4 +335,4 @@ void FilmNegative::switchOffEditMode ()
|
||||
refSpotCoords.clear();
|
||||
unsubscribe();
|
||||
spotbutton->set_active(false);
|
||||
}
|
||||
}
|
||||
|
@@ -16,23 +16,25 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef _NEG_H_
|
||||
#define _NEG_H_
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
|
||||
#include <gtkmm.h>
|
||||
#include "toolpanel.h"
|
||||
#include "adjuster.h"
|
||||
#include "guiutils.h"
|
||||
#include "wbprovider.h"
|
||||
#include "editcallbacks.h"
|
||||
#include "../rtengine/procparams.h"
|
||||
|
||||
#include "adjuster.h"
|
||||
#include "editcallbacks.h"
|
||||
#include "guiutils.h"
|
||||
#include "toolpanel.h"
|
||||
#include "wbprovider.h"
|
||||
|
||||
#include "../rtengine/procparams.h"
|
||||
|
||||
class FilmNegProvider
|
||||
{
|
||||
public:
|
||||
virtual ~FilmNegProvider() = default;
|
||||
virtual bool getFilmNegativeExponents(rtengine::Coord spotA, rtengine::Coord spotB, float* newExps) = 0;
|
||||
virtual bool getFilmNegativeExponents(rtengine::Coord spotA, rtengine::Coord spotB, std::array<float, 3>& newExps) = 0;
|
||||
};
|
||||
|
||||
class FilmNegative : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel, public EditSubscriber
|
||||
@@ -89,5 +91,3 @@ public:
|
||||
bool pick1(bool picked) override;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -1023,7 +1023,7 @@ void ToolPanelCoordinator::setEditProvider (EditDataProvider *provider)
|
||||
}
|
||||
}
|
||||
|
||||
bool ToolPanelCoordinator::getFilmNegativeExponents(rtengine::Coord spotA, rtengine::Coord spotB, float* newExps)
|
||||
bool ToolPanelCoordinator::getFilmNegativeExponents(rtengine::Coord spotA, rtengine::Coord spotB, std::array<float, 3>& newExps)
|
||||
{
|
||||
return ipc && ipc->getFilmNegativeExponents(spotA.x, spotA.y, spotB.x, spotB.y, newExps);
|
||||
}
|
||||
|
@@ -292,7 +292,7 @@ public:
|
||||
Glib::ustring GetCurrentImageFilePath() override;
|
||||
|
||||
// FilmNegProvider interface
|
||||
bool getFilmNegativeExponents(rtengine::Coord spotA, rtengine::Coord spotB, float* newExps) override;
|
||||
bool getFilmNegativeExponents(rtengine::Coord spotA, rtengine::Coord spotB, std::array<float, 3>& newExps) override;
|
||||
|
||||
// rotatelistener interface
|
||||
void straightenRequested () override;
|
||||
|
Reference in New Issue
Block a user