[Jdlraw-discussion] jdlRaw/Sources jdlTool_RGB_Gamma.cpp, NONE, 1.1 jdlTool_RGB_Gamma.h, NONE, 1.1
Status: Beta
Brought to you by:
jdla
|
From: Jos De L. <jd...@us...> - 2010-07-18 08:01:42
|
Update of /cvsroot/jdlraw/jdlRaw/Sources In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv16953/Sources Modified Files: jdlDcRaw.i jdlItems.i jdlMain.cpp jdlMain.h jdlMainWindow.cpp jdlProcessor.cpp jdlRGBTemperature.cpp jdlSettings.cpp jdlToolBoxes.i jdlTools.h jdlTools.i Added Files: jdlTool_RGB_Gamma.cpp jdlTool_RGB_Gamma.h jdlTool_RGB_Gamma.i Log Message: *) Allowed WB temperature down to 1000. Probably very unprecise but I needed it for autobalancing fotonegatives. *) Added RGB_Gamma tool (simple contrast enhancement on the basis of gamma) *) Added possibility to save current image as a 'job'. (think of it as the file that describes the conversion parameters of a single raw) Index: jdlMainWindow.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlMainWindow.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** jdlMainWindow.cpp 16 Apr 2010 15:28:25 -0000 1.12 --- jdlMainWindow.cpp 18 Jul 2010 08:01:34 -0000 1.13 *************** *** 388,391 **** --- 388,392 ---- Macro_ConnectSomeMenu(FileExit); Macro_ConnectSomeMenu(FileWriteJob); + Macro_ConnectSomeMenu(FileWriteThisJob); Macro_ConnectSomeMenu(PreviewDetached); Index: jdlDcRaw.i =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlDcRaw.i,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** jdlDcRaw.i 1 May 2010 07:38:25 -0000 1.5 --- jdlDcRaw.i 18 Jul 2010 08:01:34 -0000 1.6 *************** *** 78,82 **** 1, 6500, ! 2000, 12000, 1, --- 78,82 ---- 1, 6500, ! 1000, 12000, 1, *************** *** 94,99 **** 0.0, 5.0, ! 0.01, ! 2, _("R"), _("Red Multiplier in balance")}, --- 94,99 ---- 0.0, 5.0, ! 0.001, ! 3, _("R"), _("Red Multiplier in balance")}, *************** *** 108,113 **** 0.0, 5.0, ! 0.01, ! 2, _("G"), _("Green Multiplier in balance")}, --- 108,113 ---- 0.0, 5.0, ! 0.001, ! 3, _("G"), _("Green Multiplier in balance")}, *************** *** 122,127 **** 0.0, 5.0, ! 0.01, ! 2, _("B"), _("Blue Multiplier in balance")}, --- 122,127 ---- 0.0, 5.0, ! 0.001, ! 3, _("B"), _("Blue Multiplier in balance")}, *************** *** 136,141 **** 0.0, 5.0, ! 0.01, ! 2, _("WB-G"), _("Green Intensity in balance")}, --- 136,141 ---- 0.0, 5.0, ! 0.001, ! 3, _("WB-G"), _("Green Intensity in balance")}, Index: jdlSettings.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlSettings.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** jdlSettings.cpp 1 May 2010 07:38:25 -0000 1.16 --- jdlSettings.cpp 18 Jul 2010 08:01:34 -0000 1.17 *************** *** 338,341 **** --- 338,344 ---- Tmp.replace(QString("@HOME@"),QDir::homePath()); Description.DefaultValue = Tmp; + if (Tmp.size()) { + SettingItem->HasDefaultValue = 1; + } } SettingItem->DefaultValue = Description.DefaultValue; Index: jdlProcessor.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlProcessor.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** jdlProcessor.cpp 13 Apr 2010 19:49:11 -0000 1.26 --- jdlProcessor.cpp 18 Jul 2010 08:01:34 -0000 1.27 *************** *** 88,91 **** --- 88,92 ---- M_InstantiateToolBox(RGB_DeltaGamma); M_InstantiateToolBox(RGB_Exposure); + M_InstantiateToolBox(RGB_Gamma); M_InstantiateToolBox(RGB_GREYC); M_InstantiateToolBox(RGB_Lensfun); *************** *** 148,157 **** short ParsingDefaults = 0; QString CurrentToolboxTabName; ! char LineBuffer[100]; ! char FirstString[100]; ! char SecondString[100]; do { ! if (NULL == fgets(LineBuffer,100,InFile)) break; LineNr++; if (';' == LineBuffer[0]) continue; --- 149,158 ---- short ParsingDefaults = 0; QString CurrentToolboxTabName; ! char LineBuffer[200]; ! char FirstString[200]; ! char SecondString[200]; do { ! if (NULL == fgets(LineBuffer,200,InFile)) break; LineNr++; if (';' == LineBuffer[0]) continue; *************** *** 302,305 **** --- 303,310 ---- jdlRaw->m_Settings->SetDefault(Key,QVariant(ValueString).toDouble()); break; + case QVariant::String: + jdlRaw->m_Settings->SetDefault(Key, + QVariant(ValueString).toString()); + break; case QVariant::StringList: jdlRaw->m_Settings->SetDefault(Key, Index: jdlMain.h =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlMain.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** jdlMain.h 1 May 2010 07:38:25 -0000 1.11 --- jdlMain.h 18 Jul 2010 08:01:34 -0000 1.12 *************** *** 113,116 **** --- 113,117 ---- void CB_MenuFileOpen(const bool HaveFile); void CB_MenuFileWriteJob(const bool); + void CB_MenuFileWriteThisJob(const bool); void CB_MenuFileExit(const bool); void CB_MenuPreviewDetached(const bool Enabled); Index: jdlRGBTemperature.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlRGBTemperature.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** jdlRGBTemperature.cpp 27 Feb 2010 19:02:42 -0000 1.2 --- jdlRGBTemperature.cpp 18 Jul 2010 08:01:34 -0000 1.3 *************** *** 69,73 **** void RGBToTemperature(double RGB[3],int *Temperature,double *Green) { int Tmax = 15000; ! int Tmin = 2000; int Accuracy = (int)(0.001*(Tmax-Tmin)); double TryRGB[3]; --- 69,73 ---- void RGBToTemperature(double RGB[3],int *Temperature,double *Green) { int Tmax = 15000; ! int Tmin = 1000; int Accuracy = (int)(0.001*(Tmax-Tmin)); double TryRGB[3]; Index: jdlMain.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlMain.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** jdlMain.cpp 1 May 2010 07:38:25 -0000 1.26 --- jdlMain.cpp 18 Jul 2010 08:01:34 -0000 1.27 *************** *** 946,949 **** --- 946,963 ---- } + void jdlMain::CB_MenuFileWriteThisJob(const bool) { + + QStringList InputFileNameList; + InputFileNameList = m_Settings->GetStringList("InputFileNameList"); + + QFileInfo PathInfo(InputFileNameList[0]); + QString JobFileName = + PathInfo.absolutePath() + "/" + PathInfo.baseName() + ".jdlj"; + + m_Settings->SetValue("RGB_WriteOutputDirectory_0",PathInfo.absolutePath()); + + WriteJobFile(JobFileName); + } + void jdlMain::CB_MenuFileExit(const bool) { // TODO Do we need some blabla before exiting ? Index: jdlTools.i =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlTools.i,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** jdlTools.i 2 Mar 2010 22:41:59 -0000 1.3 --- jdlTools.i 18 Jul 2010 08:01:34 -0000 1.4 *************** *** 42,45 **** --- 42,46 ---- #include "jdlTool_RGB_DeltaGamma.i" #include "jdlTool_RGB_Exposure.i" + #include "jdlTool_RGB_Gamma.i" #include "jdlTool_RGB_GREYC.i" #include "jdlTool_RGB_Lensfun.i" Index: jdlToolBoxes.i =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlToolBoxes.i,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** jdlToolBoxes.i 2 Mar 2010 22:41:59 -0000 1.12 --- jdlToolBoxes.i 18 Jul 2010 08:01:34 -0000 1.13 *************** *** 58,61 **** --- 58,62 ---- {2, "RGB_DeltaGamma", _("RGB - DeltaGammaTool") }, {2, "RGB_Exposure", _("RGB - Exposure") }, + {4, "RGB_Gamma", _("RGB - GammaTool") }, {2, "RGB_GREYC", _("RGB - GreycStoration") }, {2, "RGB_Lensfun", _("RGB - Lensfun") }, Index: jdlTools.h =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlTools.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** jdlTools.h 2 Mar 2010 22:41:59 -0000 1.8 --- jdlTools.h 18 Jul 2010 08:01:34 -0000 1.9 *************** *** 44,47 **** --- 44,48 ---- #include "jdlTool_RGB_DeltaGamma.h" #include "jdlTool_RGB_Exposure.h" + #include "jdlTool_RGB_Gamma.h" #include "jdlTool_RGB_GREYC.h" #include "jdlTool_RGB_Lensfun.h" --- NEW FILE: jdlTool_RGB_Gamma.i --- //////////////////////////////////////////////////////////////////////////////// // // jdlRaw // // $Id: jdlTool_RGB_Gamma.i,v 1.1 2010/07/18 08:01:34 jdla Exp $ // // Copyright (C) 2008-2010 Jos De Laender <jos...@te...> // // This file is part of jdlRaw. // // jdlRaw 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. // // jdlRaw 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 jdlRaw. If not, see <http://www.gnu.org/licenses/>. // //////////////////////////////////////////////////////////////////////////////// #ifdef JDLRAW_GUI_INPUT_ITEM // Attention : Default,Min,Max,Step should be consistent int or double. // Double *always* in X.Y notation to indicate so. // ToolBox, // Unique Name, // GuiElement, // InitLevel, // InJobFile, // HasDefault (causes button too !), // Default, // Min, // Max, // Step, // NrDecimals, // Label, // ToolTip {"RGB_Gamma", "RGB_GammaAmount", jdlGT_InputSlider, 2, 1, 1, 0.45, 0.0, 2.0, 0.01, 2, _("Gamma"), _("Gamma")}, {"RGB_Gamma", "RGB_GammaLinearity", jdlGT_InputSlider, 2, 1, 1, 0.10, 0.0, 0.5, 0.01, 2, _("Linearity"), _("Linearity")}, #endif #ifdef JDLRAW_GUI_CHECK_ITEM // ToolBox, // Name, // GuiType, // InitLevel, // InJobFile, // Default, // Label, // Tip {"RGB_Gamma", "RGB_EnableGamma", jdlGT_Check, 2, 1, 0, _("Enable"), _("Enable Gamma tool")}, {"RGB_Gamma", "RGB_GammaWithGamma", jdlGT_Check, 2, 1, 1, _("With Gamma"), _("Gammacontrast on an image which should have gamma")}, #endif //////////////////////////////////////////////////////////////////////////////// --- NEW FILE: jdlTool_RGB_Gamma.h --- //////////////////////////////////////////////////////////////////////////////// // // jdlRaw // // $Id: jdlTool_RGB_Gamma.h,v 1.1 2010/07/18 08:01:34 jdla Exp $ // // Copyright (C) 2008-2010 Jos De Laender <jos...@te...> // // This file is part of jdlRaw. // // jdlRaw 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. // // jdlRaw 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 jdlRaw. If not, see <http://www.gnu.org/licenses/>. // //////////////////////////////////////////////////////////////////////////////// #ifndef JDLTOOL_RGB_GAMMA_H #define JDLTOOL_RGB_GAMMA_H #include "jdlTool.h" #include "jdlCurve.h" class jdlTool_RGB_Gamma : public jdlTool { Q_OBJECT public: jdlTool_RGB_Gamma(const short Instance); void SetupGui(QWidget* Parent); public slots: void Run(jdlImage *Image); private : jdlCurve* m_GammaCurve; }; #endif /////////////////////////////////////////////////////////////////////////////// --- NEW FILE: jdlTool_RGB_Gamma.cpp --- //////////////////////////////////////////////////////////////////////////////// // // jdlRaw // // $Id: jdlTool_RGB_Gamma.cpp,v 1.1 2010/07/18 08:01:34 jdla Exp $ // // Copyright (C) 2008-2010 Jos De Laender <jos...@te...> // // This file is part of jdlRaw. // // jdlRaw 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. // // jdlRaw 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 jdlRaw. If not, see <http://www.gnu.org/licenses/>. // //////////////////////////////////////////////////////////////////////////////// #include "jdlTool_RGB_Gamma.h" #include "jdlMain.h" //////////////////////////////////////////////////////////////////////////////// // // Constructor // //////////////////////////////////////////////////////////////////////////////// jdlTool_RGB_Gamma::jdlTool_RGB_Gamma(const short Instance) : jdlTool(Instance) { setParent(jdlRaw); setObjectName(QString("RGB_Gamma_%1").arg(Instance)); printf("(%s,%d) '%s'\n",__FILE__,__LINE__,objectName().toAscii().data()); m_GammaCurve = NULL; }; //////////////////////////////////////////////////////////////////////////////// // // Run() // //////////////////////////////////////////////////////////////////////////////// void jdlTool_RGB_Gamma::Run(jdlImage *Image) { // Protection against running in the gui thread. assert (QThread::currentThread() != jdlRaw->thread()); if (m_Stop) return; TRACEMAIN("Running %s",objectName().toAscii().data()); jdlRaw->ReportProgress( QString("Running %1").arg(objectName().toAscii().data())); m_Image = Image; QString Instance; Instance = QString("_%1").arg(m_Instance); jdlSettings* Settings = jdlRaw->m_Settings; double Gamma = Settings->GetDouble(QString("RGB_GammaAmount")+Instance); double Linearity= Settings->GetDouble(QString("RGB_GammaLinearity")+Instance); short WithGamma = Settings->GetInt(QString("RGB_GammaWithGamma")+Instance); short Enable = Settings->GetInt(QString("RGB_EnableGamma")+Instance); if (Enable) { if (!m_GammaCurve) m_GammaCurve = new jdlCurve(); m_GammaCurve->SetCurveFromFunction(InverseGammaTool,Gamma,Linearity); m_GammaCurve->m_WithGamma = WithGamma; m_Image->ToRGB(jdlRaw->m_Settings->GetInt("WorkColor")); m_Image->ApplyCurve(m_GammaCurve,7); } // Notify changed image. emit(SendOutput(m_Image)); }; //////////////////////////////////////////////////////////////////////////////// // // SetupGui() // //////////////////////////////////////////////////////////////////////////////// void jdlTool_RGB_Gamma::SetupGui(QWidget *Parent) { m_ToolWidget = new QWidget(Parent); m_ToolWidget->setObjectName( QString("TB_RGB_Gamma_%1Widget").arg(m_Instance)); QVBoxLayout* VLayout = new QVBoxLayout(m_ToolWidget); QFrame* TBC_GammaWidget = new QFrame(m_ToolWidget); TBC_GammaWidget->setObjectName( QString("TBC_RGB_Gamma_%1Widget").arg(m_Instance)); TBC_GammaWidget->setFrameShape(QFrame::StyledPanel); TBC_GammaWidget->setFrameShadow(QFrame::Raised); VLayout->addWidget(TBC_GammaWidget); QWidget* EnableGammaWidget = new QWidget(m_ToolWidget); EnableGammaWidget->setObjectName( QString("RGB_EnableGamma_%1Widget").arg(m_Instance)); VLayout->addWidget(EnableGammaWidget); QWidget* WithGammaWidget = new QWidget(m_ToolWidget); WithGammaWidget->setObjectName( QString("RGB_GammaWithGamma_%1Widget").arg(m_Instance)); VLayout->addWidget(WithGammaWidget); QWidget* GammaAmountWidget = new QWidget(m_ToolWidget); GammaAmountWidget->setObjectName( QString("RGB_GammaAmount_%1Widget").arg(m_Instance)); VLayout->addWidget(GammaAmountWidget); QWidget* GammaLinearityWidget = new QWidget(m_ToolWidget); GammaLinearityWidget->setObjectName( QString("RGB_GammaLinearity_%1Widget").arg(m_Instance)); VLayout->addWidget(GammaLinearityWidget); } /////////////////////////////////////////////////////////////////////////////// Index: jdlItems.i =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlItems.i,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** jdlItems.i 27 Feb 2010 19:02:42 -0000 1.9 --- jdlItems.i 18 Jul 2010 08:01:34 -0000 1.10 *************** *** 355,359 **** "CameraColorProfile", 1, ! "", 1}, --- 355,359 ---- "CameraColorProfile", 1, ! "@INSTALL@/Profiles/Camera/Flat/FlatProfile.icc", 1}, |