exposure before interpolation from branch default
This commit is contained in:
parent
de5b09080e
commit
291a0f5cac
230
COMPILE.txt
230
COMPILE.txt
@ -1,35 +1,183 @@
|
||||
If you have problems with the compilation, identified the reason and fixed
|
||||
the bug, please send me the updated build scripts (CMakeLists.txt files) to:
|
||||
hgabor@rawtherapee.com
|
||||
If you have problems with the compilation, please ask on the appropriated RawTherapee forum :
|
||||
http://www.rawtherapee.com/forum/viewforum.php?f=10
|
||||
|
||||
|
||||
Windows
|
||||
-------
|
||||
|
||||
METHOD 1:
|
||||
Requirements:
|
||||
- MinGW + MSYS
|
||||
- CMake
|
||||
- GTK and GTKMM development environments
|
||||
|
||||
Compile:
|
||||
- Start MSYS
|
||||
- Enter the root directory of the RawTherapee source tree
|
||||
- Type: cmake -G "MSYS Makefiles" .
|
||||
- Type: make install
|
||||
- You find the compiled program in the release directory
|
||||
The toolchain:
|
||||
|
||||
METHOD 2:
|
||||
Requirements:
|
||||
- tdm-gcc (http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/tdm-gcc-4.5.1.exe/download)
|
||||
- cmake (http://www.cmake.org/cmake/resources/software.html)
|
||||
- mercurial (http://mercurial.selenic.com/wiki/WindowsInstall)
|
||||
- gtkmm (http://ftp.se.debian.org/pub/gnome/binaries/win32/gtkmm/2.22/)
|
||||
|
||||
Compile:
|
||||
- Enter the root directory of the RawTherapee source tree
|
||||
- Type: cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./release -DBINDIR=. -DDATADIR=. -DLIBDIR=.
|
||||
- Type: mingw32-make.exe install
|
||||
- You find the compiled program in the "release" directory
|
||||
There is 2 method to compile RawTherapee, and they each rely on different and common packages. They are
|
||||
now referred to METHOD 1 and METHOD 2.
|
||||
Of course, you'll have to install the package for the build method explained later in this document.
|
||||
|
||||
The rest of this document assumes that you've installed MinGW, MSYS and Gtkmm respectively to "C:\mingw",
|
||||
"C:\msys" and "C:\Gtkmm".
|
||||
This tutorial assume that you've installed the packages in a paths THAT DOES NOT CONTAIN SPACES.
|
||||
|
||||
METHOD 1:
|
||||
- MinGW-TDM (http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/tdm-gcc-4.5.1.exe/download)
|
||||
OpenMP seems to be broken in TDM-GCC4.5.1, so when MinGW has been installed, download and install
|
||||
libgomp form tdm-gcc-4.5.0
|
||||
(http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%204.5%20series/Previous/4.5.0-tdm-1%20SJLJ/gcc-4.5.0-tdm-1-openmp.zip/download)
|
||||
- MSYS (http://downloads.sourceforge.net/mingw/MSYS-1.0.11.exe)
|
||||
If you have some trouble installing MSYS, see here : http://www.mingw.org/wiki/MSYS
|
||||
- CMake (http://www.cmake.org/cmake/resources/software.html)
|
||||
- Gtkmm2.22 (http://ftp.se.debian.org/pub/gnome/binaries/win32/gtkmm/2.22/)
|
||||
|
||||
METHOD 2:
|
||||
- MinGW-TDM (http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/tdm-gcc-4.5.1.exe/download)
|
||||
- CMake (http://www.cmake.org/cmake/resources/software.html)
|
||||
- Gtkmm2.22 (http://ftp.se.debian.org/pub/gnome/binaries/win32/gtkmm/2.22/)
|
||||
|
||||
Additionnal steps:
|
||||
When all the packages of your preferred method are installed:
|
||||
- set the GTKMM_BASEPATH user or system environment variable to the installation directory of Gtkmm
|
||||
(the Gtkmm's installer can do it for you)
|
||||
- set the MINGW_BASEPATH user or system environment variable to the installation directory of MinGW32
|
||||
- set the PKG_CONFIG_PATH user or system environment variable to the location of the pkgconfig directories:
|
||||
c:\mingw\lib\pkgconfig;c:\gtkmm\lib\pkgconfig
|
||||
You have to restart the console to take this new variables into account
|
||||
- Copy the "Win32CMakeOptions-sample.txt" file located in the root directory of RT's source tree, to "cmo.txt" (e.g.)
|
||||
You can edit that copy to change the compilation flags to your needs, but the default values should be fine.
|
||||
|
||||
Dependancies:
|
||||
|
||||
RawTherapee rely on libraries that may not be part of the Gtkmm or MinGW package. There is two ways of installing
|
||||
thoses libraries.
|
||||
|
||||
The simple way:
|
||||
|
||||
For your convenience, those libraries has been precompiled and are downloadable at :
|
||||
|
||||
http://www.rawtherapee.com/releases_head/windows/dependencies_for_creating_builds/
|
||||
|
||||
If you don't find a suitable package for your toolchain, take the DIY way or ask a developer
|
||||
to build them for you.
|
||||
|
||||
Just unpack the content of this archive to the base installation dir of MinGW, and everything
|
||||
should work fine.
|
||||
|
||||
The "Do It Yourself" way:
|
||||
|
||||
The MSYS package is required to build the libraries. See above for the download link.
|
||||
|
||||
Before building them, look if they are already installed in your Gtkmm and MinGW directories. There shouldn't be
|
||||
two versions of the same library in different place.
|
||||
|
||||
Open an MSYS console, that will create a Linux environment, and compile the dependancies in that order:
|
||||
|
||||
zlib:
|
||||
If you have Gtkmm2.22 installed, you can skip this section
|
||||
- download: http://zlib.net/
|
||||
- how to build:
|
||||
cd to the unarchiving directory of zlib-1.2.5
|
||||
make -f win32/Makefile.gcc
|
||||
|
||||
Then, manually copy the files as follows:
|
||||
|
||||
cp -iv zlib1.dll /mingw/bin
|
||||
cp -iv zconf.h zlib.h /mingw/include
|
||||
cp -iv libz.a /mingw/lib
|
||||
cp -iv libzdll.a /mingw/lib/libz.dll.a
|
||||
|
||||
libpng:
|
||||
If you have Gtkmm2.22 installed, you can skip this section
|
||||
- download: http://sourceforge.net/projects/libpng/files/
|
||||
(please note that libpng 1.5 has not been tested yet)
|
||||
- how to build:
|
||||
cd to the unarchiving directory of lpng144
|
||||
|
||||
There's two options to build libpng :
|
||||
1. gtkmm doesn't provide zlib so i've compiled it myself
|
||||
cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=/mingw -DCMAKE_BUILD_TYPE:STRING=Release
|
||||
2. gtkmm provide zlib and i want to reuse it (so we're assuming that you didn't compiled zlib like explained here above)
|
||||
cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=/mingw -DCMAKE_PREFIX_PATH:PATH=C:/gtkmm -DCMAKE_BUILD_TYPE:STRING=Release
|
||||
|
||||
Then build and install:
|
||||
make
|
||||
make install
|
||||
|
||||
libjpeg:
|
||||
- download: http://www.ijg.org/
|
||||
- how to build:
|
||||
cd to the unarchiving directory of jpeg-8b
|
||||
./configure --prefix=/mingw
|
||||
copy the content of jconfig.txt to jconfig.h (overwrite the existing file)
|
||||
make
|
||||
make install
|
||||
|
||||
libtiff:
|
||||
- download: ftp://ftp.remotesensing.org/pub/libtiff/
|
||||
- how to build:
|
||||
./configure --prefix=/mingw
|
||||
make
|
||||
cd libtiff
|
||||
make install
|
||||
|
||||
libiptcdata:
|
||||
- download: http://libiptcdata.sourceforge.net/
|
||||
- how to build:
|
||||
./configure --prefix=/mingw
|
||||
|
||||
Edit the "Makefile" file from the root dir of libiptcdata, and search for "DIST_SUBDIRS ="
|
||||
and "SUBDIRS =". You should only find one line for each search. From those lines, remove "iptc", then
|
||||
|
||||
make
|
||||
make install
|
||||
|
||||
lcms:
|
||||
- download v1.x (v2.x is not supported yet): http://sourceforge.net/projects/lcms/files/
|
||||
- how to build:
|
||||
./configure --prefix=/mingw
|
||||
make
|
||||
make install
|
||||
|
||||
Rawzor:
|
||||
provided in RT's source tree (downloaded from http://www.rawzor.com/developers/)
|
||||
|
||||
IMPORTANT:
|
||||
Make sure that the lcms.pc and libiptcdata.pc files located in the pkgconfig dir has the first
|
||||
line like this : prefix=/mingw
|
||||
|
||||
If everything is well installed, you should see the following lines when running the cmake command (see "Building RT" below) :
|
||||
-- checking for module 'libiptcdata'
|
||||
-- found libiptcdata, version 1.0.4
|
||||
-- checking for module 'lcms<=1.99'
|
||||
-- found lcms, version 1.19
|
||||
-- Found JPEG: C:/mingw/lib/libjpeg.dll.a
|
||||
-- Found ZLIB: C:/gtkmm/lib/libz.dll.a
|
||||
-- Found PNG: C:/gtkmm/lib/libpng.lib
|
||||
-- Found TIFF: C:/mingw/lib/libtiff.dll.a
|
||||
|
||||
Building RT:
|
||||
|
||||
METHOD 1:
|
||||
Requirements:
|
||||
- MinGW + MSYS (FIXME: Do we talk
|
||||
- CMake
|
||||
- GTK and GTKMM development environments
|
||||
|
||||
Compile:
|
||||
- Start an MSYS command line interface
|
||||
- Enter the root directory of the RawTherapee source tree (type: cd "/C/Absolute/Path/To/RawTherapee_sourceTree")
|
||||
- Type: cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -Ccmo.txt .
|
||||
- Type: make install
|
||||
- You'll find the compiled program in the subdirectory named like the value of CMAKE_BUILD_TYPE ("Release" in this example)
|
||||
|
||||
METHOD 2:
|
||||
Requirements:
|
||||
- MinGW-TDM (http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/tdm-gcc-4.5.1.exe/download)
|
||||
- CMake (http://www.cmake.org/cmake/resources/software.html)
|
||||
- Mercurial (http://mercurial.selenic.com/wiki/WindowsInstall)
|
||||
- Gtkmm (http://ftp.se.debian.org/pub/gnome/binaries/win32/gtkmm/2.22/)
|
||||
|
||||
Compile:
|
||||
- Start a standard DOS command line interface (WIN + "R" -> "cmd")
|
||||
- Enter the root directory of the RawTherapee source tree (type: cd C:\Absolute\Path\To\RawTherapee_sourceTree)
|
||||
- Type: cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -Ccmo.txt .
|
||||
- Type: mingw32-make.exe install
|
||||
- You'll find the compiled program in the subdirectory named like the value of CMAKE_BUILD_TYPE ("Release" in this example)
|
||||
|
||||
Linux
|
||||
-----
|
||||
@ -47,8 +195,7 @@ Linux
|
||||
- Enter the root directory of the RawTherapee source tree
|
||||
- Type: cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./release -DBINDIR=. -DDATADIR=. -DLIBDIR=.
|
||||
- Type: make install
|
||||
- You find the compiled program in the release directory (you can copy it
|
||||
anywhere you want)
|
||||
- You find the compiled program in the release directory (you can copy it anywhere you want)
|
||||
|
||||
(By changing the cmake flags, you can change where the release is. By removing all flags it should go to the standard system install location).
|
||||
|
||||
@ -59,36 +206,33 @@ Linux
|
||||
click Help -> Install new Software.
|
||||
The Eclipse Update Site for MercurialEclipse is available at this URL:
|
||||
http://cbes.javaforge.com/update
|
||||
|
||||
|
||||
Import the rawtherapee mercurial repository:
|
||||
File->new->'other'->mercurial->Clone existing repository
|
||||
fill in URL: https://rawtherapee.googlecode.com/hg
|
||||
|
||||
|
||||
Enter root directory of RawTherapee source tree from a terminal window.
|
||||
configure the source for Eclipse with:
|
||||
cmake -G "Eclipse CDT4 - Unix Makefiles" -DCMAKE_INSTALL_PREFIX=./release -DBINDIR=. -DDATADIR=. -DLIBDIR=. -DCMAKE_BUILD_TYPE=Release
|
||||
|
||||
|
||||
Eclipse does not do 'make install' but only 'make all' so to get the release there are 2 ways.
|
||||
1. type 'make install' in the console or,
|
||||
2. in 'Project'->'properties'->'C/C++ Make Project'->'Build (incremental build)' change 'all' to 'install'
|
||||
|
||||
|
||||
...
|
||||
|
||||
OSX
|
||||
---
|
||||
|
||||
Requirements:
|
||||
- XCode Development Tools (you only need a subset of these, but it is probably easier to just install all of them)
|
||||
- MacPorts
|
||||
- Set /opt/local/etc/macports/variants.conf to include "+no_x11 +quartz"
|
||||
- If you want to build for multiple architectures, add +universal to variants.conf. Note that this will increase the size of the final application substantially.
|
||||
- Set /opt/local/etc/macports/macports.conf key 'universal_archs' to the architectures you wish to build for. Possible values
|
||||
include "i386 x86_64 ppc ppc64"
|
||||
- Edit beginning of CMakeLists.txt to enable the same architectures as you added to variants.conf
|
||||
- Run "sudo port install cairomm pango-devel gtk2 cmake glibmm gtkmm lcms libiptcdata" to install all needed libraries and tools
|
||||
- If you don't already have Mercurial installed, run "sudo port install mercurial"
|
||||
- If you want to try OpenMP builds, run "sudo port install gcc45"
|
||||
- Set /opt/local/etc/macports/variants.conf to include "+no_x11 +quartz"
|
||||
- If you want to build for multiple architectures, add +universal to variants.conf. Note that this will increase the size of the final application substantially.
|
||||
- Set /opt/local/etc/macports/macports.conf key 'universal_archs' to the architectures you wish to build for. Possible values
|
||||
include "i386 x86_64 ppc ppc64"
|
||||
- Edit beginning of CMakeLists.txt to enable the same architectures as you added to variants.conf
|
||||
- Run "sudo port install cairomm pango-devel gtk2 cmake glibmm gtkmm lcms libiptcdata" to install all needed libraries and tools
|
||||
- If you don't already have Mercurial installed, run "sudo port install mercurial"
|
||||
- If you want to try OpenMP builds, run "sudo port install gcc45"
|
||||
|
||||
Compile:
|
||||
- Enter root directory of RawTherapee source tree
|
||||
|
@ -451,6 +451,8 @@ PREFERENCES_DIRSOFTWARE;Installation directory
|
||||
PREFERENCES_DMETHOD;Method
|
||||
PREFERENCES_EDITORCMDLINE;Other command line
|
||||
PREFERENCES_EDITORLAYOUT;Editor Layout
|
||||
PREFERENCES_EXPOS;Exposure before interpolation\n :correction (lin)
|
||||
PREFERENCES_PRESER;Exposure before interpolation\n :preserve highlights (EV)
|
||||
PREFERENCES_EXTERNALEDITOR;External editor
|
||||
PREFERENCES_FALSECOLOR;False color suppression steps
|
||||
PREFERENCES_FBROWSEROPTS;File Browser Options
|
||||
|
@ -173,6 +173,8 @@ CA=false
|
||||
HotDeadPixels=false
|
||||
LineDenoise=0
|
||||
GreenEqThreshold=0
|
||||
PreExposure=1
|
||||
PrePreserv=0
|
||||
CcSteps=1
|
||||
Method=amaze
|
||||
DCBIterations=2
|
||||
|
@ -173,6 +173,8 @@ CA=false
|
||||
HotDeadPixels=false
|
||||
LineDenoise=0
|
||||
GreenEqThreshold=0
|
||||
PreExposure=1
|
||||
PrePreserv=0
|
||||
CcSteps=1
|
||||
Method=amaze
|
||||
DCBIterations=2
|
||||
|
@ -172,6 +172,8 @@ CA=false
|
||||
HotDeadPixels=false
|
||||
LineDenoise=0
|
||||
GreenEqThreshold=0
|
||||
PreExposure=1
|
||||
PrePreserv=0
|
||||
CcSteps=1
|
||||
Method=amaze
|
||||
DCBIterations=2
|
||||
|
111
rtengine/expo_before_b.cc
Normal file
111
rtengine/expo_before_b.cc
Normal file
@ -0,0 +1,111 @@
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// //exposure correction before interpolation
|
||||
//
|
||||
// code dated: December 27, 2010
|
||||
//
|
||||
// Expo_before.cc 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.
|
||||
//
|
||||
// This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
////////////////////////////////////////////////////////////////
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
// Jacques Desmis <jdesmis@gmail.com>
|
||||
// use fast-demo(provisional) from Emil Martinec
|
||||
// inspired from work Guillermo Luijk and Manuel LLorens(Perfectraw)
|
||||
// I use OMP
|
||||
// This function uses parameters:
|
||||
// exposure (lineal): 2^(-8..0..8): currently 0.5 +3
|
||||
// preserve (log) : 0..8 : currently 0.1 1
|
||||
|
||||
//modi : 31/12/2010
|
||||
#define LIM(x,min,max) MAX(min,MIN(x,max))
|
||||
#define CLIPF(x) LIM(x,0.0,65535.0)
|
||||
|
||||
void RawImageSource::exp_bef(float expos, float preser) {
|
||||
double dt,dT2;
|
||||
clock_t t1, t2,t3,t4,t5;
|
||||
float Yp, exposure2, K, EV;
|
||||
// float LUT[65536];
|
||||
float *LUT = new float[65536];
|
||||
int i;
|
||||
int row,col;
|
||||
int width=W, height=H;
|
||||
|
||||
// I use with Dcraw FDD interpolate from Luis Sanz , very fast and good, one can change for another : here with Rawtherpee == fastdemo() from Emil Martinec
|
||||
//t1 = clock();
|
||||
//float *img = new float[H*W];//to save configuration : with RT is it necessary ??
|
||||
unsigned short** imgd;
|
||||
imgd = allocArray< unsigned short >(W,H);//with memcpy : faster than for (...)
|
||||
for (int i=0; i<H; i++) {
|
||||
memcpy (imgd[i], rawData[i], W*sizeof(**imgd));}//save configuration but perhaps instable...
|
||||
|
||||
fast_demo (0,0,W,H);//from Emil
|
||||
// calculate CIE luminosity
|
||||
float *YY;
|
||||
YY = (float *)calloc(width*height,sizeof *YY);// for CIE luminosity
|
||||
#pragma omp parallel default(shared)
|
||||
{
|
||||
#pragma omp for
|
||||
for(int row=0;row<height;row++)
|
||||
for(int col=0;col<width;col++)
|
||||
{int i=row*width+col;
|
||||
YY[i]=CLIPF(0.299*(float)red[row][col]+0.587*(float)green[row][col]+0.114*(float)blue[row][col]); // CIE luminosity
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<H; i++) {
|
||||
memcpy (rawData[i], imgd[i], W*sizeof(**imgd));}//restore config
|
||||
|
||||
freeArray<unsigned short>(imgd, H);//free memory imgd
|
||||
|
||||
//exposure correction inspired from G.Luijk
|
||||
if(preser==0.0){ // protect highlights
|
||||
#pragma omp parallel for shared(expos)
|
||||
for(int row=0;row<height;row++)
|
||||
for(int col=0;col<width;col++)
|
||||
{rawData[row][col]=CLIPF((float)rawData[row][col]*expos);}
|
||||
}else{
|
||||
// Exposure correction with highlight preservation
|
||||
if(expos>1){
|
||||
K=65535/expos*exp(-preser*log((double) 2));
|
||||
for(int j=0;j<=65535;j++) LUT[(int)j]=CLIPF(((65535-K*expos)/(65535-K)*(j-65535)+65535)/j);
|
||||
|
||||
#pragma omp parallel for shared(expos)
|
||||
for(int row=0;row<height;row++)
|
||||
for(int col=0;col<width;col++){
|
||||
if(YY[row*width+col]<K){
|
||||
rawData[row][col]=CLIPF((float)rawData[row][col]*expos);}
|
||||
else{
|
||||
float exposure2=LUT[(int)YY[row*width+col]];
|
||||
rawData[row][col]=CLIPF((float)rawData[row][col]*exposure2);}}
|
||||
}
|
||||
else{
|
||||
float EV=log(expos)/log(2.0); // Convert exp. linear to EV
|
||||
float K=65535.0*exp(-preser*log((double) 2));
|
||||
for(int j=0;j<=65535;j++) LUT[(int)j]=CLIPF(exp(EV*(65535.0-j)/(65535.0-K)*log((double) 2)));
|
||||
#pragma omp parallel for shared(expos)
|
||||
for(int row=0;row<height;row++)
|
||||
for(int col=0;col<width;col++){
|
||||
if(YY[row*width+col]<K){
|
||||
rawData[row][col]=CLIPF((float)rawData[row][col]*expos);}
|
||||
else{
|
||||
float exposure2=LUT[(int)YY[row*width+col]];
|
||||
rawData[row][col]=CLIPF((float)rawData[row][col]*exposure2);}}
|
||||
}
|
||||
}
|
||||
free(YY);
|
||||
delete [] LUT;
|
||||
|
||||
}
|
@ -210,7 +210,11 @@ void ProcParams::setDefaults () {
|
||||
raw.dmethod = RAWParams::methodstring[RAWParams::hphd];;
|
||||
raw.dcb_iterations=2;
|
||||
raw.dcb_enhance=false;
|
||||
|
||||
//exposition
|
||||
raw.expos=1.0;
|
||||
raw.preser=0.0;
|
||||
//raw.expos_correc=false;
|
||||
// expos
|
||||
exif.clear ();
|
||||
iptc.clear ();
|
||||
|
||||
@ -435,6 +439,11 @@ int ProcParams::save (Glib::ustring fname) const {
|
||||
keyFile.set_string ("RAW", "Method", raw.dmethod );
|
||||
keyFile.set_integer ("RAW", "DCBIterations", raw.dcb_iterations );
|
||||
keyFile.set_boolean ("RAW", "DCBEnhance", raw.dcb_enhance );
|
||||
//exposure
|
||||
keyFile.set_double ("RAW", "PreExposure", raw.expos );
|
||||
keyFile.set_double ("RAW", "PrePreserv", raw.preser );
|
||||
|
||||
// exposition
|
||||
|
||||
// save exif change list
|
||||
for (int i=0; i<(int)exif.size(); i++)
|
||||
@ -752,6 +761,10 @@ if (keyFile.has_group ("RAW")) {
|
||||
if (keyFile.has_key ("RAW", "Method")) raw.dmethod = keyFile.get_string ("RAW", "Method");
|
||||
if (keyFile.has_key ("RAW", "DCBIterations")) raw.dcb_iterations = keyFile.get_integer("RAW", "DCBIterations");
|
||||
if (keyFile.has_key ("RAW", "DCBEnhance")) raw.dcb_enhance =keyFile.get_boolean("RAW", "DCBEnhance");
|
||||
if (keyFile.has_key ("RAW", "PreExposure")) raw.expos =keyFile.get_double("RAW", "PreExposure");
|
||||
if (keyFile.has_key ("RAW", "PrePreserv")) raw.preser =keyFile.get_double("RAW", "PrePreserv");
|
||||
|
||||
|
||||
}
|
||||
|
||||
// load exif change settings
|
||||
@ -951,7 +964,9 @@ bool ProcParams::operator== (const ProcParams& other) {
|
||||
&& dirpyrequalizer == other.dirpyrequalizer
|
||||
&& hsvequalizer == other.hsvequalizer
|
||||
&& exif==other.exif
|
||||
&& iptc==other.iptc;
|
||||
&& iptc==other.iptc
|
||||
&& raw.expos==other.raw.expos // exposi
|
||||
&& raw.preser==other.raw.preser;
|
||||
}
|
||||
|
||||
bool ProcParams::operator!= (const ProcParams& other) {
|
||||
|
@ -395,6 +395,8 @@ class RAWParams {
|
||||
bool ca_autocorrect;
|
||||
double cared;
|
||||
double cablue;
|
||||
double expos;
|
||||
double preser; // expos
|
||||
bool hotdeadpix_filt;
|
||||
int linenoise;
|
||||
int greenthresh;
|
||||
|
@ -950,8 +950,18 @@ void RawImageSource::preprocess (const RAWParams &raw)
|
||||
plistener->setProgress (0.0);
|
||||
}
|
||||
|
||||
CA_correct_RT(raw.cared, raw.cablue);
|
||||
CA_correct_RT(raw.cared, raw.cablue);
|
||||
}
|
||||
|
||||
if ( raw.expos !=1 ) { // exposure
|
||||
if (plistener) {
|
||||
plistener->setProgressStr ("Exposure Correction...");
|
||||
plistener->setProgress (0.0);
|
||||
}
|
||||
exp_bef(raw.expos, raw.preser);
|
||||
|
||||
}
|
||||
|
||||
t2.set();
|
||||
if( settings->verbose )
|
||||
printf("Preprocessing: %d usec\n", t2.etime(t1));
|
||||
@ -3203,6 +3213,8 @@ void RawImageSource::dcb_demosaic(int iterations, int dcb_enhance)
|
||||
#include "CA_correct_RT.cc"//Emil's CA auto correction
|
||||
#include "cfa_linedn_RT.cc"//Emil's CA auto correction
|
||||
#include "green_equil_RT.cc"//Emil's green channel equilibration
|
||||
#include "expo_before_b.cc"//Jacques's exposure before interpolation
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
|
||||
|
@ -150,6 +150,7 @@ class RawImageSource : public ImageSource {
|
||||
|
||||
int LinEqSolve( int nDim, float* pfMatr, float* pfVect, float* pfSolution);//Emil's CA auto correction
|
||||
void CA_correct_RT (double cared, double cablue);
|
||||
void exp_bef (float expos, float preser);//exposi
|
||||
int cfaCleanFromMap( PixelsMap &bitmapBads );
|
||||
int findHotDeadPixel( PixelsMap &bpMap, float thresh);
|
||||
void ddct8x8s(int isgn, float **a);
|
||||
|
@ -288,6 +288,8 @@ void ParamsEdited::initFrom (const std::vector<rtengine::procparams::ProcParams>
|
||||
raw.caCorrection = raw.caCorrection && p.raw.ca_autocorrect == other.raw.ca_autocorrect;
|
||||
raw.caRed = raw.caRed && p.raw.cared == other.raw.cared;
|
||||
raw.caBlue = raw.caBlue && p.raw.cablue == other.raw.cablue;
|
||||
raw.exPos = raw.exPos && p.raw.expos == other.raw.expos;
|
||||
raw.exPreser = raw.exPreser && p.raw.preser == other.raw.preser; //exposi
|
||||
raw.darkFrame = raw.darkFrame && p.raw.dark_frame == other.raw.dark_frame;
|
||||
raw.dfAuto = raw.dfAuto && p.raw.df_autoselect == other.raw.df_autoselect;
|
||||
raw.greenEq = raw.greenEq && p.raw.greenthresh == other.raw.greenthresh;
|
||||
@ -434,6 +436,8 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten
|
||||
if (raw.caCorrection) toEdit.raw.ca_autocorrect = mods.raw.ca_autocorrect;
|
||||
if (raw.caRed) toEdit.raw.cared = mods.raw.cared;
|
||||
if (raw.caBlue) toEdit.raw.cablue = mods.raw.cablue;
|
||||
if (raw.exPos) toEdit.raw.expos =mods.raw.expos;
|
||||
if (raw.exPreser) toEdit.raw.preser =mods.raw.preser;
|
||||
if (raw.greenEq) toEdit.raw.greenthresh = mods.raw.greenthresh;
|
||||
if (raw.hotDeadPixel) toEdit.raw.hotdeadpix_filt= mods.raw.hotdeadpix_filt;
|
||||
if (raw.linenoise) toEdit.raw.linenoise = mods.raw.linenoise;
|
||||
|
@ -287,6 +287,9 @@ class RAWParamsEdited {
|
||||
bool linenoise;
|
||||
bool darkFrame;
|
||||
bool dfAuto;
|
||||
bool exCorrection;
|
||||
bool exPos;
|
||||
bool exPreser;
|
||||
};
|
||||
|
||||
class ExifPairEdited {
|
||||
|
@ -41,6 +41,20 @@ PreProcess::PreProcess ()
|
||||
caBlue = Gtk::manage(new Adjuster (M("PREFERENCES_CABLUE"),-4.0,4.0,0.1,0));
|
||||
caBlue->setAdjusterListener (this);
|
||||
caBlue->show();
|
||||
//exposi
|
||||
/*exPos = Gtk::manage(new Adjuster (M("PREFERENCES_EXPOS"),0.2,4.0,0.1,1));
|
||||
exPos->setAdjusterListener (this);
|
||||
exPos->show();
|
||||
exPreser = Gtk::manage(new Adjuster (M("PREFERENCES_PRESER"),0,2.5,0.1,0));
|
||||
exPreser->setAdjusterListener (this);
|
||||
exPreser->show();*/
|
||||
PexPos = Gtk::manage(new Adjuster (M("PREFERENCES_EXPOS"),0.2,4.0,0.1,1));
|
||||
PexPos->setAdjusterListener (this);
|
||||
PexPos->show();
|
||||
PexPreser = Gtk::manage(new Adjuster (M("PREFERENCES_PRESER"),0,2.5,0.1,0));
|
||||
PexPreser->setAdjusterListener (this);
|
||||
PexPreser->show();
|
||||
|
||||
|
||||
hotDeadPixel = Gtk::manage(new Gtk::CheckButton((M("PREFERENCES_HOTDEADPIXFILT"))));
|
||||
|
||||
@ -60,6 +74,9 @@ PreProcess::PreProcess ()
|
||||
pack_start( *caAutocorrect, Gtk::PACK_SHRINK, 4);
|
||||
pack_start( *caRed, Gtk::PACK_SHRINK, 4);
|
||||
pack_start( *caBlue, Gtk::PACK_SHRINK, 4);
|
||||
pack_start( *PexPos, Gtk::PACK_SHRINK, 4);//exposi
|
||||
pack_start( *PexPreser, Gtk::PACK_SHRINK, 4);
|
||||
|
||||
pack_start( *Gtk::manage (new Gtk::HSeparator()));
|
||||
pack_start( *lineDenoise, Gtk::PACK_SHRINK, 4);
|
||||
pack_start( *Gtk::manage (new Gtk::HSeparator()));
|
||||
@ -85,6 +102,10 @@ void PreProcess::read(const rtengine::procparams::ProcParams* pp, const ParamsEd
|
||||
caAutocorrect->set_inconsistent(!pedited->raw.caCorrection);
|
||||
caRed->setEditedState( pedited->raw.caRed ? Edited : UnEdited );
|
||||
caBlue->setEditedState( pedited->raw.caBlue ? Edited : UnEdited );
|
||||
PexPos->setEditedState( pedited->raw.exPos ? Edited : UnEdited );
|
||||
PexPreser->setEditedState( pedited->raw.exPreser ? Edited : UnEdited );
|
||||
|
||||
//exposure
|
||||
hotDeadPixel->set_inconsistent (!pedited->raw.hotDeadPixel);
|
||||
lineDenoise->setEditedState( pedited->raw.linenoise ? Edited : UnEdited );
|
||||
greenEqThreshold->setEditedState( pedited->raw.greenEq ? Edited : UnEdited );
|
||||
@ -103,6 +124,9 @@ void PreProcess::read(const rtengine::procparams::ProcParams* pp, const ParamsEd
|
||||
caAutocorrect->set_active(pp->raw.ca_autocorrect);
|
||||
caRed->setValue (pp->raw.cared);
|
||||
caBlue->setValue (pp->raw.cablue);
|
||||
PexPos->setValue (pp->raw.expos);
|
||||
PexPreser->setValue (pp->raw.preser);//exposi
|
||||
|
||||
hotDeadPixel->set_active (pp->raw.hotdeadpix_filt);
|
||||
lineDenoise->setValue (pp->raw.linenoise);
|
||||
greenEqThreshold->setValue (pp->raw.greenthresh);
|
||||
@ -124,6 +148,9 @@ void PreProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedi
|
||||
pp->raw.ca_autocorrect = caAutocorrect->get_active();
|
||||
pp->raw.cared = (double)caRed->getValue();
|
||||
pp->raw.cablue = (double)caBlue->getValue();
|
||||
pp->raw.expos = (double)PexPos->getValue();
|
||||
pp->raw.preser = (double)PexPreser->getValue();//exposi
|
||||
|
||||
pp->raw.hotdeadpix_filt = hotDeadPixel->get_active();
|
||||
pp->raw.linenoise = (int)lineDenoise->getValue();
|
||||
pp->raw.greenthresh = (int)greenEqThreshold->getValue();
|
||||
@ -136,6 +163,9 @@ void PreProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedi
|
||||
pedited->raw.caCorrection = !caAutocorrect->get_inconsistent();
|
||||
pedited->raw.caRed = caRed->getEditedState ();
|
||||
pedited->raw.caBlue = caBlue->getEditedState ();
|
||||
pedited->raw.exPos = PexPos->getEditedState ();
|
||||
pedited->raw.exPreser = PexPreser->getEditedState ();//exposi
|
||||
|
||||
pedited->raw.hotDeadPixel = !hotDeadPixel->get_inconsistent();
|
||||
}
|
||||
}
|
||||
@ -151,6 +181,9 @@ void PreProcess::setBatchMode(bool batchMode)
|
||||
ToolPanel::setBatchMode (batchMode);
|
||||
caRed->showEditedCB ();
|
||||
caBlue->showEditedCB ();
|
||||
PexPos->showEditedCB ();
|
||||
PexPreser->showEditedCB ();//exposi
|
||||
|
||||
lineDenoise->showEditedCB ();
|
||||
greenEqThreshold->showEditedCB ();
|
||||
}
|
||||
@ -160,16 +193,25 @@ void PreProcess::setDefaults(const rtengine::procparams::ProcParams* defParams,
|
||||
lineDenoise->setDefault( defParams->raw.linenoise);
|
||||
caRed->setDefault( defParams->raw.cared);
|
||||
caBlue->setDefault( defParams->raw.cablue);
|
||||
PexPos->setDefault( defParams->raw.expos);
|
||||
PexPreser->setDefault( defParams->raw.preser);
|
||||
|
||||
greenEqThreshold->setDefault (defParams->raw.greenthresh);
|
||||
if (pedited) {
|
||||
lineDenoise->setDefaultEditedState( pedited->raw.linenoise ? Edited : UnEdited);
|
||||
caRed->setDefaultEditedState( pedited->raw.caRed ? Edited : UnEdited);
|
||||
caBlue->setDefaultEditedState( pedited->raw.caBlue ? Edited : UnEdited);
|
||||
PexPos->setDefaultEditedState( pedited->raw.exPos ? Edited : UnEdited);
|
||||
PexPreser->setDefaultEditedState( pedited->raw.exPreser ? Edited : UnEdited);
|
||||
|
||||
greenEqThreshold->setDefaultEditedState(pedited->raw.greenEq ? Edited : UnEdited);
|
||||
}else{
|
||||
lineDenoise->setDefaultEditedState( Irrelevant );
|
||||
caRed->setDefaultEditedState( Irrelevant );
|
||||
caBlue->setDefaultEditedState( Irrelevant );
|
||||
PexPos->setDefaultEditedState( Irrelevant );
|
||||
PexPreser->setDefaultEditedState( Irrelevant );
|
||||
|
||||
greenEqThreshold->setDefaultEditedState(Irrelevant );
|
||||
}
|
||||
}
|
||||
|
@ -37,6 +37,9 @@ class PreProcess : public Gtk::VBox, public AdjusterListener, public ToolPanel{
|
||||
|
||||
Adjuster* caRed;
|
||||
Adjuster* caBlue;
|
||||
Adjuster* PexPos;
|
||||
Adjuster* PexPreser;
|
||||
|
||||
Adjuster* lineDenoise;
|
||||
Adjuster* greenEqThreshold;
|
||||
Gtk::CheckButton* caAutocorrect;
|
||||
|
Loading…
x
Reference in New Issue
Block a user