* GHS GUI first step * GHS GUI first step * GUI step 3 * Hide show ghsmethod * Siril functions for ghs * Init ghs in iplocallab * ghs step 2 * ghs step 4 * Comment copyright Pixlnsight 2021 * Smooth highlights and tooltips * Enabled saturation and luminance ghs mode * First tooltip * Ghs tooltips * Remove wrong packstart inverssh * Change labels and tooltips * Disabled mask in global and other improvments * Comment code * appimage and windows yml ghs * Change tooltip * Ghsmethod hue and change tolltips * Change tooltip * Inverse Stretch step 1 * Inverse GHS * GHS tooltips * Change tooltips * Change tooltip * Linear black point * Small change to blackpoint * Change tooltip * Clean and comment code * forgotten GHS highlight attenuation msg in history * Comment code with Transformation equations * Change tooltip * Wrong default value balck point * Comment code iplocallab * Ghs curve step 1 * GHS curve step 2 * Show GHS setting in a Curve Box * Tooltip for ghs S curve * Disabled warning in compilation simpleprocess * Simplified code part 1 * Simplified code GHS graph part 2 * Improve black point with negatives values * Improve BP and tooltip * Listener enable only with GHS * White point for GHS * Change label and tooltip * Improve behavior white point and black point * Link sliders ghs_SP ghs_LP ghs_HP and change code to avoid balck screen * hide unused button in diagonal curve GHS * prevents the GHS representation in S from displaying artifacts if ghs-d=0 * Change tooltips * Improvment and tooltips * Forgotten tooltip * Improve GUI GHS S curve - change tooltips * Set transition gray areas in S curve GHS with values of the RT-spot * Change label GHS * setlogscale blackpoint and symmetry * Set recursive reference enable by default in controlspotpanel * Change lastlocalCurvesDir Dirghs in locallabtools and options - change labels * Added in converttonormal ghsMode.. not sure if this is useful * DIY to make GHS curve work without the choices * Change RGB calculation with luminance function working profile * 5 modes GHS method * Label to show datas clipped Black point and White point * Various change white point tooltips * Bad behavior wp bp labels * Small change to improccordinator call to ghschanged ghsbwchanged * Set log scale ghs_D * Hide Graduated filter if GHS enable * Luminance Lab in ghsmethod * Lab slope factor step 1 * Slope and Chromaticity GHS improvments * Fixed bad sqrt line 17477 iplocallab * Workaround linear GHS - re-enable Graduated filer GHS * Change limits slope lab factor * Ghs chromaticity Lab (Lch) * Improve ghs chromaticity * Change labels and tooltips Lab chroma * Slope Lab to 100 * Noise and saturation RGB * Saturation RGB standard and labels * Change histogram and navigator panel without gamma when using working profile * Remove gray in GHS curve * Local contrast a minima * Regularization stretch * Improve Graduated Filter in all cases GHS Color and Light etc. * Improves nlmeans to reduce noise after GHS * Change to GF - tooltip Nlmeans * Added oW oH tW tH etc. * Added call GF * tX tY for previewProps * Comment code GF * Improve local contrast ghs * Change norm to norm2 * Improve GUI mode complexity and Lab GHS * Show values BP WP in GUI * Labgrid ghs step 1 * Labgrid for simulation GHS - step 2 * More points for Labgrid ghs * Clean and comment code * Fixed crash in inverse GHS white point - set to 10 points for GSH simulation * Change to black point in inverse GHS * Intilialize simulation with nothing if new spot * Remove curve GHS - optimize code simulation - improve GUI * set ghs default - fixed crash is case HP SP LP * Fixed crash - I hope in inverse GHS * Simplify WP and BP limits to avoid crash in inverse GHS * Clean code with ghscurve - ghsshape * Change tooltips * Change to D - GUI - comment code * Simulation with 4 more points * Best simulation with point 0.05 and 0.95 * Clean code - change for crsah in Inverse GHS * Show values WP and BP
174 lines
7.3 KiB
C++
174 lines
7.3 KiB
C++
/** -*- C++ -*-
|
|
*
|
|
* This file is part of RawTherapee.
|
|
*
|
|
* Copyright (c) 2017 Alberto Griggio <alberto.griggio@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/>.
|
|
*/
|
|
|
|
// adapted from the "color correction" module of Darktable. Original copyright follows
|
|
/*
|
|
copyright (c) 2009--2010 johannes hanika.
|
|
|
|
darktable 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.
|
|
|
|
darktable 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 darktable. If not, see <https://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <gtkmm.h>
|
|
#include "eventmapper.h"
|
|
#include "toolpanel.h"
|
|
|
|
|
|
class LabGridArea final : public Gtk::DrawingArea {
|
|
private:
|
|
rtengine::ProcEvent evt;
|
|
Glib::ustring evtMsg;
|
|
|
|
enum State { NONE, HIGH, LOW, GRE};
|
|
State litPoint;
|
|
double low_a;
|
|
double high_a;
|
|
double low_b;
|
|
double high_b;
|
|
double gre_x;
|
|
double gre_y;
|
|
double whi_x;
|
|
double whi_y;
|
|
double me_x;
|
|
double me_y;
|
|
double ghs_x6;
|
|
double ghs_y6;
|
|
double ghs_x7;
|
|
double ghs_y7;
|
|
double ghs_x8;
|
|
double ghs_y8;
|
|
double ghs_x9;
|
|
double ghs_y9;
|
|
double ghs_x10;
|
|
double ghs_y10;
|
|
double ghs_x11;
|
|
double ghs_y11;//+4 12 11
|
|
double defaultLow_a;
|
|
double defaultHigh_a;
|
|
double defaultLow_b;
|
|
double defaultHigh_b;
|
|
double defaultgre_x;
|
|
double defaultgre_y;
|
|
double defaultwhi_x;
|
|
double defaultwhi_y;
|
|
double defaultme_x;
|
|
double defaultme_y;
|
|
double default_gsx6;//added for GHS
|
|
double default_gsy6;
|
|
double default_gsx7;
|
|
double default_gsy7;
|
|
double default_gsx8;
|
|
double default_gsy8;
|
|
double default_gsx9;
|
|
double default_gsy9;
|
|
double default_gsx10;//+4 12 11
|
|
double default_gsy10;
|
|
double default_gsx11;
|
|
double default_gsy11;
|
|
|
|
ToolPanelListener *listener;
|
|
bool edited;
|
|
bool isDragged;
|
|
sigc::connection delayconn;
|
|
static const int inset = 5;
|
|
|
|
bool low_enabled;
|
|
bool ciexy_enabled;
|
|
bool ghs_enabled;
|
|
bool mous_enabled;
|
|
|
|
bool notifyListener();
|
|
void getLitPoint();
|
|
|
|
public:
|
|
LabGridArea(rtengine::ProcEvent evt, const Glib::ustring &msg, bool enable_low=true, bool ciexy=false, bool ghs=false, bool mous=false);
|
|
|
|
void getParams(double &la, double &lb, double &ha, double &hb, double &gx, double &gy, double &wx, double &wy, double &mx, double &my,
|
|
double &gx6, double &gy6, double &gx7, double &gy7, double &gx8, double &gy8, double &gx9, double &gy9, double &gx10, double &gy10, double &gx11, double &gy11) const;//+4 12 11
|
|
void setParams(double la, double lb, double ha, double hb, double gx, double gy, double wx, double wy, double mx, double my, double gx6, double gy6, double gx7, double gy7, double gx8, double gy8, double gx9, double gy9, double gx10, double gy10, double gx11, double gy11, bool notify);//+4 12 11
|
|
void setDefault (double la, double lb, double ha, double hb, double gx, double gy, double wx, double wy, double mx, double my, double gx6, double gy6, double gx7, double gy7, double gx8, double gy8, double gx9, double gy9, double gx10, double gy10, double gx11, double gy11);//+4 12 11
|
|
void setEdited(bool yes);
|
|
bool getEdited() const;
|
|
void reset(bool toInitial);
|
|
void setListener(ToolPanelListener *l);
|
|
|
|
bool lowEnabled() const;
|
|
void setLowEnabled(bool yes);
|
|
bool ciexyEnabled() const;
|
|
void setciexyEnabled(bool yes);
|
|
bool ghsEnabled() const;
|
|
void setghsEnabled(bool yes);
|
|
bool mousEnabled() const;
|
|
void setmousEnabled(bool yes);
|
|
|
|
bool on_draw(const ::Cairo::RefPtr<Cairo::Context> &cr) override;
|
|
void on_style_updated () override;
|
|
bool on_button_press_event(GdkEventButton *event) override;
|
|
bool on_button_release_event(GdkEventButton *event) override;
|
|
bool on_motion_notify_event(GdkEventMotion *event) override;
|
|
Gtk::SizeRequestMode get_request_mode_vfunc() const override;
|
|
void get_preferred_width_vfunc(int &minimum_width, int &natural_width) const override;
|
|
void get_preferred_height_for_width_vfunc (int width, int &minimum_height, int &natural_height) const override;
|
|
};
|
|
|
|
|
|
class LabGrid: public Gtk::Box {
|
|
private:
|
|
LabGridArea grid;
|
|
|
|
bool resetPressed(GdkEventButton *event);
|
|
|
|
public:
|
|
LabGrid(rtengine::ProcEvent evt, const Glib::ustring &msg, bool enable_low=true, bool ciexy=false, bool ghs=false, bool mous=true);
|
|
|
|
void getParams(double &la, double &lb, double &ha, double &hb, double &gx, double &gy, double &wx, double &wy, double &mx, double &my, double &gx6, double &gy6, double &gx7, double &gy7, double &gx8, double &gy8, double &gx9, double &gy9, double &gx10, double &gy10, double &gx11, double &gy11)
|
|
const { return grid.getParams(la, lb, ha, hb, gx, gy, wx, wy, mx, my, gx6, gy6, gx7, gy7, gx8, gy8, gx9, gy9, gx10, gy10, gx11, gy11); }//+4 12 11
|
|
void setParams(double la, double lb, double ha, double hb, double gx, double gy, double wx, double wy, double mx, double my, double gx6, double gy6, double gx7, double gy7, double gx8, double gy8, double gx9, double gy9, double gx10, double gy10, double gx11, double gy11, bool notify)
|
|
{ grid.setParams(la, lb, ha, hb, gx, gy, wx, wy, mx, my, gx6, gy6, gx7, gy7, gx8, gy8, gx9, gy9, gx10, gy10, gx11, gy11, notify); }//+4 12 11
|
|
void setDefault (double la, double lb, double ha, double hb, double gx, double gy, double wx, double wy, double mx, double my, double gx6, double gy6, double gx7, double gy7, double gx8, double gy8, double gx9, double gy9, double gx10, double gy10, double gx11, double gy11)
|
|
{ grid.setDefault(la, lb, ha, hb, gx, gy, wx, wy, mx, my, gx6, gy6, gx7, gy7, gx8, gy8, gx9, gy9, gx10, gy10, gx11, gy11); }//+4 12 11
|
|
void setEdited(bool yes) { grid.setEdited(yes); }
|
|
bool getEdited() const { return grid.getEdited(); }
|
|
void reset(bool toInitial) { grid.reset(toInitial); }
|
|
void setListener(ToolPanelListener *l) { grid.setListener(l); }
|
|
bool lowEnabled() const { return grid.lowEnabled(); }
|
|
void setLowEnabled(bool yes) { grid.setLowEnabled(yes); }
|
|
bool ciexyEnabled() const { return grid.ciexyEnabled(); }
|
|
void setciexyEnabled(bool yes) { grid.setciexyEnabled(yes); }
|
|
bool ghsEnabled() const { return grid.ghsEnabled(); }
|
|
void setghsEnabled(bool yes) { grid.setghsEnabled(yes); }
|
|
bool mousEnabled() const { return grid.mousEnabled(); }
|
|
void setmousEnabled(bool yes) { grid.setmousEnabled(yes); }
|
|
|
|
};
|
|
|