rawTherapee/rtengine/refreshmap.h
Desmis b73840cf3c
Gamut compression - reduce artifacts resulting from out of gamut (#7205)
* First functions needs for ACES

* New file GUI compressgamut

* GUI first step

* GUI first step

* Gui step 2

* GUI procparams and paramsedit

* GUI read

* GUI step 4

* GUI step 5

* First tooltip

* Gamut compression tooltips

* Various GUI improvment

* History msg

* Comment code with Aces remarks

* First change improccoordinator and events

* Save work on matrix

* Compress gamut next work

* First try gamut compress

* Replace cout by printf in invertmatrix

* Change tooltips and events

* Added namespace std to iplab2rgb

* Comment code

* Active rtthumbnail

* Change tooltip

* Various improvment GUI and rolloff

* Added adobeRGB gamut

* Appimage windows yml

* Remove rttumbnail gamutcompr

* Change event to COMPR

* Change tooltip and verbose

* Restore raw de-haze history message

* Refactor ACES gamut compression functions

* Fix gamut compression color space history message

Correctly display the color space name.

* Add "unchanged" for gamut compression color space

Allow "unchanged" in batch mode.

* Fix gamut compression yellow distance for batch

* Update copyright for gamut compression GUI

* Fix gamut compression color space names

* Refactor gamut compression code

* Remove comment rtthumnail.cc - Acesp1 default

* Change matrix DCI-P3 - threshold maximum to 1 in GUI and in gamut compression - tooltips

* Change tooltip

* Clean code - change tooltips

* Remove appimage windows yml

---------

Co-authored-by: Lawrence Lee <45837045+Lawrence37@users.noreply.github.com>
2024-11-14 13:08:52 +01:00

106 lines
5.6 KiB
C++

/*
* This file is part of RawTherapee.
*
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.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 <unordered_map>
#include "procevents.h"
// Use M_VOID if you wish to update the proc params without updating the preview at all !
#define M_VOID (1<<20)
// Use M_MINUPDATE if you wish to update the preview without modifying the image (think about it like a "refreshPreview")
// Must NOT be used with other event (i.e. will be used for MINUPDATE only)
#define M_MINUPDATE (1<<19)
// Force high quality
#define M_HIGHQUAL (1<<18)
// Elementary functions that can be done to
// the preview image when an event occurs
#define M_WB (1<<17)
#define M_SPOT (1<<16)
#define M_CSHARP (1<<15)
#define M_MONITOR (1<<14)
#define M_RETINEX (1<<13)
#define M_CROP (1<<12)
#define M_PREPROC (1<<11)
#define M_RAW (1<<10)
#define M_INIT (1<<9)
#define M_LINDENOISE (1<<8)
#define M_HDR (1<<7)
#define M_TRANSFORM (1<<6)
#define M_BLURMAP (1<<5)
#define M_AUTOEXP (1<<4)
#define M_RGBCURVE (1<<3)
#define M_LUMACURVE (1<<2)
#define M_LUMINANCE (1<<1)
#define M_COLOR (1<<0)
// Bitfield of functions to do to the preview image when an event occurs
// Use those or create new ones for your new events
#define FIRST (M_PREPROC|M_RAW|M_INIT|M_SPOT|M_LINDENOISE|M_HDR|M_TRANSFORM|M_BLURMAP|M_AUTOEXP|M_RGBCURVE|M_LUMACURVE|M_LUMINANCE|M_COLOR|M_MONITOR) // without HIGHQUAL
#define ALL (M_PREPROC|M_RAW|M_INIT|M_SPOT|M_LINDENOISE|M_HDR|M_TRANSFORM|M_BLURMAP|M_AUTOEXP|M_RGBCURVE|M_LUMACURVE|M_LUMINANCE|M_COLOR) // without HIGHQUAL
#define DARKFRAME (M_PREPROC|M_RAW|M_INIT|M_SPOT|M_LINDENOISE|M_HDR|M_TRANSFORM|M_BLURMAP|M_AUTOEXP|M_RGBCURVE|M_LUMACURVE|M_LUMINANCE|M_COLOR)
#define FLATFIELD (M_PREPROC|M_RAW|M_INIT|M_SPOT|M_LINDENOISE|M_HDR|M_TRANSFORM|M_BLURMAP|M_AUTOEXP|M_RGBCURVE|M_LUMACURVE|M_LUMINANCE|M_COLOR)
#define DEMOSAIC (M_RAW|M_INIT|M_SPOT|M_LINDENOISE|M_HDR|M_TRANSFORM|M_BLURMAP|M_AUTOEXP|M_RGBCURVE|M_LUMACURVE|M_LUMINANCE|M_COLOR)
#define WB (M_WB|M_INIT|M_SPOT|M_LINDENOISE|M_HDR|M_TRANSFORM|M_BLURMAP|M_AUTOEXP|M_RGBCURVE|M_LUMACURVE|M_LUMINANCE|M_COLOR)
#define COMPR (M_INIT|M_SPOT|M_LINDENOISE|M_HDR|M_TRANSFORM|M_BLURMAP|M_AUTOEXP|M_RGBCURVE|M_LUMACURVE|M_LUMINANCE|M_COLOR|M_MONITOR)
#define ALLNORAW (M_INIT|M_SPOT|M_LINDENOISE|M_HDR|M_TRANSFORM|M_BLURMAP|M_AUTOEXP|M_RGBCURVE|M_LUMACURVE|M_LUMINANCE|M_COLOR)
#define CAPTURESHARPEN (M_INIT|M_SPOT|M_LINDENOISE|M_HDR|M_TRANSFORM|M_BLURMAP|M_AUTOEXP|M_RGBCURVE|M_LUMACURVE|M_LUMINANCE|M_COLOR|M_CSHARP)
#define HDR (M_SPOT|M_LINDENOISE|M_HDR|M_TRANSFORM|M_BLURMAP|M_AUTOEXP|M_RGBCURVE|M_LUMACURVE|M_LUMINANCE|M_COLOR)
#define SPOTADJUST (M_SPOT|M_HDR|M_BLURMAP|M_AUTOEXP|M_RGBCURVE|M_LUMACURVE|M_LUMINANCE|M_COLOR)
#define TRANSFORM (M_SPOT|M_HDR|M_TRANSFORM|M_BLURMAP|M_AUTOEXP|M_RGBCURVE|M_LUMACURVE|M_LUMINANCE|M_COLOR)
#define AUTOEXP (M_SPOT|M_HDR|M_AUTOEXP|M_RGBCURVE|M_LUMACURVE|M_LUMINANCE|M_COLOR)
#define RGBCURVE (M_RGBCURVE|M_LUMACURVE|M_LUMINANCE|M_COLOR)
#define LUMINANCECURVE (M_LUMACURVE|M_LUMINANCE|M_COLOR)
#define SHARPENING (M_LUMINANCE|M_COLOR)
#define IMPULSEDENOISE (M_LUMINANCE|M_COLOR)
#define DEFRINGE (M_LUMINANCE|M_COLOR)
#define DIRPYRDENOISE (M_LUMINANCE|M_COLOR)
#define DIRPYREQUALIZER (M_LUMINANCE|M_COLOR)
#define GAMMA M_VOID //M_MONITOR
#define CROP M_CROP
#define RESIZE M_VOID
#define EXIF M_VOID
#define IPTC M_VOID
#define MINUPDATE M_MINUPDATE
#define RETINEX (M_RETINEX|ALLNORAW)
#define MONITORTRANSFORM M_MONITOR
#define OUTPUTPROFILE M_MONITOR
extern int refreshmap[];
namespace rtengine
{
class RefreshMapper {
public:
static RefreshMapper *getInstance();
ProcEvent newEvent();
void mapEvent(ProcEvent event, int action);
int getAction(ProcEvent event) const;
private:
RefreshMapper();
int next_event_;
std::unordered_map<int, int> actions_;
};
} // namespace rtengine