Skip to content

Commit

Permalink
Local adjustments tools used globally - Laspotmain (#6928)
Browse files Browse the repository at this point in the history
* First step LA globally

* fixed several GUI bad behavior

* better behavior shows additional settings

* Improve transition in main

* First step hide-show invers and scope

* Hide show invers and scope step2

* hide show others inverse and scope

* Try to improve

* Change windows.yml and appimage.yml

* In Preference set choice for default Spot Method

* Optimization call idle_register

* forgotten delete mainfp

* Re-enable sliders scope in colorlight - shadows - vibrance - move setting checkbox others settings

* Fixed bad behavior hide - show

* Optimize behavior

* Bad behavior scope when changing method

* Clean and comment code

* disable preview mask and modif for cbdl and retinex

* Fixed preview deltaE mask and modif log encode - exposure - new button preview color and light

* Button preview deltaE - exposure

* Button preview SH

* Button preview Vibrance

* Improce code using mask

* Fixed several bad behavior - preview TM and Contrast

* Preview log button

* Preview Ciecam button

* Preview common mask button

* Disable Preview button in settings when not used in tools

* Change call to controspotpanel in improcoordinator

* Change Local adjustments title to Selective Editing

* Change default value spotmethod in option

* Missing cddl in preview settings

* Change parameter setting spot type

* put selective editing tab just after exposure tab

* Disable preview ΔE button when another is enabled

Only one button should be active at any given time.

* Deactivate preview ΔE buttons when switching spots

* Change tooltip Spot method

* Change selective editing position

* Remove duplicate line in language default

* Remove appimage.yml windows.yml

---------

Co-authored-by: Lawrence Lee <45837045+Lawrence37@users.noreply.github.com>
  • Loading branch information
Desmis and Lawrence37 committed May 16, 2024
1 parent 5a25619 commit 5571c3a
Show file tree
Hide file tree
Showing 20 changed files with 1,756 additions and 90 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
workflow_dispatch:

env:
publish_pre_dev_labels: '[]'
publish_pre_dev_labels: '[]'

jobs:
build:
Expand Down
14 changes: 8 additions & 6 deletions rtdata/languages/default
Original file line number Diff line number Diff line change
Expand Up @@ -1763,7 +1763,7 @@ MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: <b>Alt-u</b>
MAIN_TAB_FILTER; Filter
MAIN_TAB_INSPECT; Inspect
MAIN_TAB_IPTC;IPTC
MAIN_TAB_LOCALLAB;Local
MAIN_TAB_LOCALLAB;Selective Editing
MAIN_TAB_LOCALLAB_TOOLTIP;Shortcut: <b>Alt-o</b>
MAIN_TAB_METADATA;Metadata
MAIN_TAB_METADATA_TOOLTIP;Shortcut: <b>Alt-m</b>
Expand Down Expand Up @@ -1850,8 +1850,8 @@ PARTIALPASTE_LABCURVE;L*a*b* adjustments
PARTIALPASTE_LENSGROUP;Lens Related Settings
PARTIALPASTE_LENSPROFILE;Profiled lens correction
PARTIALPASTE_LOCALCONTRAST;Local contrast
PARTIALPASTE_LOCALLAB;Local Adjustments
PARTIALPASTE_LOCALLABGROUP;Local Adjustments Settings
PARTIALPASTE_LOCALLAB;Selective Editing
PARTIALPASTE_LOCALLABGROUP;Selective Editing Settings
PARTIALPASTE_METADATA;Metadata mode
PARTIALPASTE_METAGROUP;Metadata settings
PARTIALPASTE_PCVIGNETTE;Vignette filter
Expand Down Expand Up @@ -2083,6 +2083,7 @@ PREFERENCES_SND_HELP;Enter a full file path to set a sound, or leave blank for n
PREFERENCES_SND_LNGEDITPROCDONE;Editor processing done
PREFERENCES_SND_QUEUEDONE;Queue processing done
PREFERENCES_SND_THRESHOLDSECS;After seconds
PREFERENCES_SPOTLOC;Define Spot method for Local Adjustments
PREFERENCES_STARTUPIMDIR;Image Directory at Startup
PREFERENCES_TAB_BROWSER;File Browser
PREFERENCES_TAB_COLORMGR;Color Management
Expand Down Expand Up @@ -2959,7 +2960,7 @@ TP_LOCALLAB_CLARI_TOOLTIP;Levels 0 to 4 (included): 'Sharp mask' is enabled\nLev
TP_LOCALLAB_CLIPTM;Clip restored data (gain)
TP_LOCALLAB_COFR;Color & Light
TP_LOCALLAB_COLORDE;ΔE preview color - intensity
TP_LOCALLAB_COLORDEPREV_TOOLTIP;Preview ΔE button will only work if you have activated one (and only one) of the tools in 'Add tool to current spot' menu.\nTo be able to preview ΔE with several tools enabled, use Mask and modifications - Preview ΔE.
TP_LOCALLAB_COLORDEPREV_TOOLTIP;Preview ΔE button in Settings will only work if you have activated 'Sharpening' or 'Soft Light and Original Retinex' or 'Blur/Grain and Denoise' or 'Dehaze and Retinex' or 'Contrast by Detail Levels' in 'Add tool to current spot' menu.\nFor others tools Preview ΔE button is 'in the tool' - to be able to preview ΔE with several tools enabled, use preferably Mask and modifications.
TP_LOCALLAB_COLORDE_TOOLTIP;Show a blue color preview for ΔE selection if negative and green if positive.\n\nMask and modifications (show modified areas without mask): show actual modifications if positive, show enhanced modifications (luminance only) with blue and yellow if negative.
TP_LOCALLAB_COLORSCOPE;Scope (color tools)
TP_LOCALLAB_COLORSCOPE_TOOLTIP;Common Scope slider for Color and Light, Shadows/Highlights, Vibrance.\nOther tools have their own scope controls.
Expand Down Expand Up @@ -3048,9 +3049,10 @@ TP_LOCALLAB_EV_VIS_ALL;Show all
TP_LOCALLAB_EXCLUF;Excluding
TP_LOCALLAB_EXCLUF_TOOLTIP;'Excluding' mode prevents adjacent spots from influencing certain parts of the image. Adjusting 'Scope' will extend the range of colors.\n You can also add tools to an Excluding spot and use them in the same way as for a normal spot.
TP_LOCALLAB_EXCLUTYPE;Spot method
TP_LOCALLAB_EXCLUTYPE_TOOLTIP;Normal spot uses recursive data.\n\nExcluding spot reinitializes all local adjustment data.\nCan be used to totally or partially cancel a previous action or to carry out operations in Inverse mode.\n\n'Full image' allows you to use the local adjustment tools on the whole image.\n The RT Spot delimiters are set beyond the image preview boundaries.\n The transition is set to 100.\nNote, you may have to reposition the RT Spot slightly and adjust the Spot size to get the desired effect.\nPlease note: using Denoise or Wavelet or FFTW in full-image mode uses large amounts of memory and may cause the application to crash on lower capacity systems.
TP_LOCALLAB_EXCLUTYPE_TOOLTIP;Normal spot uses recursive data.\n\nExcluding spot reinitializes all local adjustment data.\nCan be used to totally or partially cancel a previous action or to carry out operations in Inverse mode.\nUse 'Scope' (Excluding) to set the exclusion intensity.\n\n'Full image' allows you to use the local adjustment tools on the whole image.\n The RT Spot delimiters are set beyond the image preview boundaries.\n The transition is set to 100.\nNote, you may have to reposition the RT Spot slightly and adjust the Spot size to get the desired effect.\nPlease note: using Denoise or Wavelet or FFTW in full-image mode uses large amounts of memory and may cause the application to crash on lower capacity systems.\n\n'Global' allows you to use the local adjustment tools on the whole image, without using deltaE or transitions.
TP_LOCALLAB_EXECLU;Excluding spot
TP_LOCALLAB_EXFULL;Full image
TP_LOCALLAB_EXMAIN;Global
TP_LOCALLAB_EXNORM;Normal spot
TP_LOCALLAB_EXPCBDL_TOOLTIP;Can be used to remove marks on the sensor or lens by reducing the contrast on the appropriate detail level(s).
TP_LOCALLAB_EXPCHROMA;Chroma compensation
Expand Down Expand Up @@ -3182,7 +3184,7 @@ TP_LOCALLAB_JZTARGET_EV;Viewing Mean luminance (Yb%)
TP_LOCALLAB_JZTHRHCIE;Threshold Chroma for Jz(Hz)
TP_LOCALLAB_JZWAVEXP;Wavelet Jz
TP_LOCALLAB_LABBLURM;Blur Mask
TP_LOCALLAB_LABEL;Local Adjustments
TP_LOCALLAB_LABEL;Selective Editing
TP_LOCALLAB_LABGRID;Color correction grid
TP_LOCALLAB_LABGRIDMERG;Background
TP_LOCALLAB_LABGRID_VALUES;High(a)=%1 High(b)=%2\nLow(a)=%3 Low(b)=%4
Expand Down
72 changes: 69 additions & 3 deletions rtengine/improccoordinator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
//std::vector<LocallabListener::locallabRef> locallref;
std::vector<LocallabListener::locallabRetiMinMax> locallretiminmax;
std::vector<LocallabListener::locallabcieLC> locallcielc;
std::vector<LocallabListener::locallabsetLC> locallsetlc;
std::vector<LocallabListener::locallabcieSIG> locallciesig;
huerefs.resize(params->locallab.spots.size());
huerefblurs.resize(params->locallab.spots.size());
Expand All @@ -1154,6 +1155,11 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
lumarefp = new float[sizespot];
float *fabrefp = nullptr;
fabrefp = new float[sizespot];
//new controls mainfp and scopefp with multi spots
int *mainfp = nullptr;
mainfp = new int[sizespot];
int *scopefp = nullptr;
scopefp = new int[sizespot];

for (int sp = 0; sp < (int)params->locallab.spots.size(); sp++) {

Expand All @@ -1164,7 +1170,9 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
if (params->locallab.spots.at(sp).equilret && params->locallab.spots.at(sp).expreti) {
savenormreti.reset(new LabImage(*oprevl, true));
}

if(params->locallab.spots.at(sp).colorscope != 30) {//compatibility with old method in controlspotpanel to change scope - default value 30
scopefp[sp]= params->locallab.spots.at(sp).colorscope;
}
// Set local curves of current spot to LUT
locRETgainCurve.Set(params->locallab.spots.at(sp).localTgaincurve);
locRETtransCurve.Set(params->locallab.spots.at(sp).localTtranscurve);
Expand Down Expand Up @@ -1537,7 +1545,8 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
locciesig.contsigq = contsig;
locciesig.lightsigq = lightsig;
locallciesig.push_back(locciesig);



// Recalculate references after
if (params->locallab.spots.at(sp).spotMethod == "exc") {
ipf.calc_ref(sp, reserv.get(), reserv.get(), 0, 0, pW, pH, scale, huerefblu, chromarefblu, lumarefblu, huer, chromar, lumar, sobeler, avg, locwavCurveden, locwavdenutili);
Expand All @@ -1555,13 +1564,69 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
}



// new used linked to global and scope
mainfp[sp] = 0;
if (params->locallab.spots.at(sp).spotMethod == "main") {
mainfp[sp] = 3;
} else if (params->locallab.spots.at(sp).spotMethod == "full") {
mainfp[sp] = 2;
}
//keep using tools
bool iscolor = params->locallab.spots.at(sp).expcolor;
bool issh = params->locallab.spots.at(sp).expshadhigh;
bool isvib = params->locallab.spots.at(sp).expvibrance;
bool isexpos = params->locallab.spots.at(sp).expexpose;
bool issoft = params->locallab.spots.at(sp).expsoft;
bool isblur = params->locallab.spots.at(sp).expblur;
bool istom = params->locallab.spots.at(sp).exptonemap;
bool isret = params->locallab.spots.at(sp).expreti;
bool issharp = params->locallab.spots.at(sp).expsharp;
bool iscont = params->locallab.spots.at(sp).expcontrast;
bool iscbdl = params->locallab.spots.at(sp).expcbdl;
bool islog = params->locallab.spots.at(sp).explog;
bool ismas = params->locallab.spots.at(sp).expmask;
bool iscie = params->locallab.spots.at(sp).expcie;
bool isset = iscolor || issh || isvib;

//set select spot settings
LocallabListener::locallabsetLC locsetlc;
locsetlc.mainf = mainfp[sp];
locsetlc.iscolo = iscolor;
locsetlc.iss = issh;
locsetlc.isvi = isvib;
locsetlc.isexpo = isexpos;
locsetlc.issof = issoft;
locsetlc.isblu = isblur;
locsetlc.isto = istom;
locsetlc.isre = isret;
locsetlc.isshar = issharp;
locsetlc.iscon = iscont;
locsetlc.iscbd = iscbdl;
locsetlc.islo = islog;
locsetlc.isma = ismas;
locsetlc.isci = iscie;
locallsetlc.push_back(locsetlc);

if (locallListener) {
locallListener->refChanged2(huerefp, chromarefp, lumarefp, fabrefp, params->locallab.selspot);
locallListener->minmaxChanged(locallretiminmax, params->locallab.selspot);
if (params->locallab.spots.at(sp).expprecam) {
locallListener->cieChanged(locallcielc,params->locallab.selspot);
}
locallListener->sigChanged(locallciesig,params->locallab.selspot);
if(params->locallab.spots.at(sp).colorscope != 30) {//compatibility with old method in controlspotpanel
locallListener->scopeChangedcol(scopefp[sp], params->locallab.selspot, iscolor);
locallListener->scopeChangedsh(scopefp[sp], params->locallab.selspot, issh);
locallListener->scopeChangedvib(scopefp[sp], params->locallab.selspot, isvib);
locallListener->scopeChangedset(scopefp[sp], params->locallab.selspot, isset);
params->locallab.spots.at(sp).colorscope = 30;
}
// if (mainfp[sp] >= 0) {//minimize call to idle register
//used by Global fullimage.
locallListener->maiChanged(locallsetlc,params->locallab.selspot);
// }

}

}
Expand All @@ -1570,7 +1635,8 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
delete [] chromarefp;
delete [] lumarefp;
delete [] fabrefp;

delete [] mainfp;
delete [] scopefp;
ipf.lab2rgb(*nprevl, *oprevi, params->icm.workingProfile);
//*************************************************************
// end locallab
Expand Down

0 comments on commit 5571c3a

Please sign in to comment.