47 changes: 47 additions & 0 deletions rtgui/preprocesswb.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* This file is part of RawTherapee.
*
* Copyright (c) 2020 Alberto Romei <aldrop8@gmail.com>
*
* RawTherapee is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* RawTherapee is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once

#include <gtkmm.h>

#include "adjuster.h"
#include "toolpanel.h"

class PreprocessWB final:
public ToolParamBlock,
public FoldableToolPanel
{

private:
const rtengine::ProcEvent evPreprocessWBMode;

MyComboBoxText* mode;

public:

PreprocessWB();

void read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr) override;
void write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = nullptr) override;
void setBatchMode(bool batchMode) override;
void setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override;
void setAdjusterBehavior(bool add);
void trimValues(rtengine::procparams::ProcParams* pp) override;
void modeChanged();
};
5 changes: 5 additions & 0 deletions rtgui/toolpanelcoord.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ ToolPanelCoordinator::ToolPanelCoordinator (bool batch) : ipc (nullptr), favorit
flatfield = Gtk::manage (new FlatField ());
rawcacorrection = Gtk::manage (new RAWCACorr ());
rawexposure = Gtk::manage (new RAWExposure ());
preprocessWB = Gtk::manage (new PreprocessWB ());
bayerrawexposure = Gtk::manage (new BayerRAWExposure ());
xtransrawexposure = Gtk::manage (new XTransRAWExposure ());
fattal = Gtk::manage (new FattalToneMapping ());
Expand Down Expand Up @@ -155,6 +156,7 @@ ToolPanelCoordinator::ToolPanelCoordinator (bool batch) : ipc (nullptr), favorit
addfavoritePanel (sensorxtrans->getPackBox(), xtransprocess, 2);
addfavoritePanel (sensorxtrans->getPackBox(), xtransrawexposure, 2);
addfavoritePanel (rawPanel, rawexposure);
addfavoritePanel (rawPanel, preprocessWB);
addfavoritePanel (rawPanel, preprocess);
addfavoritePanel (rawPanel, darkframe);
addfavoritePanel (rawPanel, flatfield);
Expand Down Expand Up @@ -357,6 +359,7 @@ void ToolPanelCoordinator::imageTypeChanged (bool isRaw, bool isBayer, bool isXt
sensorxtrans->FoldableToolPanel::hide();
xtransprocess->FoldableToolPanel::hide();
xtransrawexposure->FoldableToolPanel::hide();
preprocessWB->FoldableToolPanel::hide();
preprocess->FoldableToolPanel::hide();
flatfield->FoldableToolPanel::show();
filmNegative->FoldableToolPanel::hide();
Expand All @@ -377,6 +380,7 @@ void ToolPanelCoordinator::imageTypeChanged (bool isRaw, bool isBayer, bool isXt
sensorxtrans->FoldableToolPanel::hide();
xtransprocess->FoldableToolPanel::hide();
xtransrawexposure->FoldableToolPanel::hide();
preprocessWB->FoldableToolPanel::hide();
preprocess->FoldableToolPanel::hide();
flatfield->FoldableToolPanel::hide();
filmNegative->FoldableToolPanel::hide();
Expand All @@ -398,6 +402,7 @@ void ToolPanelCoordinator::imageTypeChanged (bool isRaw, bool isBayer, bool isXt
sensorxtrans->FoldableToolPanel::hide();
xtransprocess->FoldableToolPanel::hide();
xtransrawexposure->FoldableToolPanel::hide();
preprocessWB->FoldableToolPanel::hide();
preprocess->FoldableToolPanel::hide();
flatfield->FoldableToolPanel::hide();
filmNegative->FoldableToolPanel::hide();
Expand Down
2 changes: 2 additions & 0 deletions rtgui/toolpanelcoord.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
#include "perspective.h"
#include "pparamschangelistener.h"
#include "preprocess.h"
#include "preprocesswb.h"
#include "profilechangelistener.h"
#include "prsharpening.h"
#include "rawcacorrection.h"
Expand Down Expand Up @@ -155,6 +156,7 @@ class ToolPanelCoordinator :
FlatField* flatfield;
RAWCACorr* rawcacorrection;
RAWExposure* rawexposure;
PreprocessWB* preprocessWB;
BayerRAWExposure* bayerrawexposure;
XTransRAWExposure* xtransrawexposure;
FattalToneMapping *fattal;
Expand Down