jdlraw-discussion Mailing List for jdlRaw
Status: Beta
Brought to you by:
jdla
You can subscribe to this list here.
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(18) |
Nov
(57) |
Dec
(96) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
(20) |
Feb
(15) |
Mar
(4) |
Apr
(27) |
May
(8) |
Jun
(4) |
Jul
(4) |
Aug
(6) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
|
From: Jos De L. <jo...@de...> - 2010-11-23 00:15:49
|
http://airsupply.dyndns.org:9960/Feeds/dlRawBlog.xml -- Jos De Laender www.jodela.net |
|
From: Jos De L. <jd...@us...> - 2010-08-07 21:24:57
|
Update of /cvsroot/jdlraw/jdlRaw/Sources In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv1186/Sources Modified Files: jdlChoice.cpp jdlHistogramWindow.cpp jdlInput.cpp jdlItems.i jdlMain.cpp jdlMain.h jdlProcessor.cpp jdlThumbnailer.cpp jdlToolBoxControl.cpp jdlToolBoxes.i Log Message: *) Some restyling and theming possibility. Index: jdlToolBoxes.i =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlToolBoxes.i,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** jdlToolBoxes.i 18 Jul 2010 08:01:34 -0000 1.13 --- jdlToolBoxes.i 7 Aug 2010 21:24:48 -0000 1.14 *************** *** 29,33 **** {1, "Fixed_WorkColorSpace", _("Work Colorspace") }, {1, "Fixed_PreviewColorSpace", _("Preview Colorspace") }, - {1, "Fixed_PipeSize", _("Scaling in pipe") }, {1, "Fixed_GenericCorrections", _("Generic Corrections") }, {1, "Fixed_WhiteBalance", _("White Balance") }, --- 29,32 ---- Index: jdlProcessor.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlProcessor.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** jdlProcessor.cpp 18 Jul 2010 08:01:34 -0000 1.27 --- jdlProcessor.cpp 7 Aug 2010 21:24:48 -0000 1.28 *************** *** 107,112 **** } else if (ToolBoxes[i].Key == "Fixed_PreviewColorSpace") { ; - } else if (ToolBoxes[i].Key == "Fixed_PipeSize") { - ; } else if (ToolBoxes[i].Key == "Fixed_GenericCorrections") { ; --- 107,110 ---- Index: jdlToolBoxControl.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlToolBoxControl.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** jdlToolBoxControl.cpp 27 Feb 2010 19:02:42 -0000 1.4 --- jdlToolBoxControl.cpp 7 Aug 2010 21:24:48 -0000 1.5 *************** *** 116,120 **** QIcon ButtonOnIcon; ButtonOnIcon.addPixmap(QPixmap( ! QString::fromUtf8(":/jdlRaw/Icons/2downarrow.svg")), QIcon::Normal, QIcon::On); m_Button->setIcon(ButtonOnIcon); --- 116,120 ---- QIcon ButtonOnIcon; ButtonOnIcon.addPixmap(QPixmap( ! QString::fromUtf8(":/jdlRaw/Icons/triangle_down_13x13_c0.png")), QIcon::Normal, QIcon::On); m_Button->setIcon(ButtonOnIcon); *************** *** 122,126 **** QIcon ButtonOffIcon; ButtonOffIcon.addPixmap(QPixmap( ! QString::fromUtf8(":/jdlRaw/Icons/2rightarrow.svg")), QIcon::Normal, QIcon::Off); m_Button->setIcon(ButtonOffIcon); --- 122,126 ---- QIcon ButtonOffIcon; ButtonOffIcon.addPixmap(QPixmap( ! QString::fromUtf8(":/jdlRaw/Icons/triangle_right_13x13_c0.png")), QIcon::Normal, QIcon::Off); m_Button->setIcon(ButtonOffIcon); Index: jdlInput.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlInput.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** jdlInput.cpp 27 Feb 2010 19:02:42 -0000 1.4 --- jdlInput.cpp 7 Aug 2010 21:24:48 -0000 1.5 *************** *** 137,140 **** --- 137,144 ---- m_Label = new QLabel(Parent); m_Label->setText(LabelText); + + // XXXX JDLA : Couldn't find better for the moment. + m_SpinBox->setFixedHeight(m_Button->height()-5); + m_Slider->setFixedHeight(m_Button->height()-9); Layout->addWidget(m_Button); Index: jdlHistogramWindow.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlHistogramWindow.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** jdlHistogramWindow.cpp 27 Feb 2010 19:02:42 -0000 1.5 --- jdlHistogramWindow.cpp 7 Aug 2010 21:24:48 -0000 1.6 *************** *** 339,353 **** Painter.save(); if (!m_QPixmap) { ! QString FileName = ! jdlRaw->m_Settings->GetString("SplashDirectory") + "jdlRawLogo.png"; ! m_QPixmap = new QPixmap(FileName); ! QPixmap* Scaled = new QPixmap( ! m_QPixmap->scaled(width(), ! height(), ! Qt::KeepAspectRatio, ! Qt::SmoothTransformation)); delete m_QPixmap; ! m_QPixmap = Scaled; ! } Painter.drawPixmap(0,0,*m_QPixmap); Painter.restore(); --- 339,379 ---- Painter.save(); if (!m_QPixmap) { ! ! int WidgetWidth = width(); ! int WidgetHeight = height(); ! ! // Instantiate an Image8 and put blanco histogram in it. ! delete m_Image8; ! m_Image8 = new jdlImage8(WidgetWidth,WidgetHeight,3); ! ! const uint16_t HistogramMargin = 5; ! const uint16_t HistogramWidth = WidgetWidth-2*HistogramMargin; ! ! // Grid ! int Sections = 5; ! int Step = HistogramWidth/Sections; ! for (short i=1; i<Sections; i++) { ! uint16_t Col=i*Step+HistogramMargin; ! for (uint16_t Row=0; Row<WidgetHeight; Row++) { ! //int value = (int) MIN(MAX(Row-15,0), 0x60); ! const int value = 0x60; ! if (!m_Image8->m_Image[Row*WidgetWidth+Col][0] && ! !m_Image8->m_Image[Row*WidgetWidth+Col][1] && ! !m_Image8->m_Image[Row*WidgetWidth+Col][2]) { ! m_Image8->m_Image[Row*WidgetWidth+Col][0] = value; ! m_Image8->m_Image[Row*WidgetWidth+Col][1] = value; ! m_Image8->m_Image[Row*WidgetWidth+Col][2] = value; ! } ! } ! } ! delete m_QPixmap; ! m_QPixmap = new QPixmap( ! QPixmap::fromImage(QImage((const uchar*) m_Image8->m_Image, ! m_Image8->m_Width, ! m_Image8->m_Height, ! QImage::Format_RGB32))); ! ! } Painter.drawPixmap(0,0,*m_QPixmap); Painter.restore(); Index: jdlChoice.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlChoice.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** jdlChoice.cpp 27 Feb 2010 19:02:41 -0000 1.4 --- jdlChoice.cpp 7 Aug 2010 21:24:48 -0000 1.5 *************** *** 75,80 **** QHBoxLayout *Layout = new QHBoxLayout(Parent); - Layout->setContentsMargins(2,2,2,2); - Layout->setMargin(2); Parent->setLayout(Layout); --- 75,78 ---- *************** *** 97,100 **** --- 95,101 ---- if (!m_HaveDefault) m_Button->hide(); + // XXXX JDLA : Couldn't find better for the moment. + m_ComboBox->setFixedHeight(m_Button->height()-5); + Layout->addWidget(m_Button); Layout->addWidget(m_ComboBox); Index: jdlMain.h =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlMain.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** jdlMain.h 18 Jul 2010 08:01:34 -0000 1.12 --- jdlMain.h 7 Aug 2010 21:24:48 -0000 1.13 *************** *** 97,100 **** --- 97,101 ---- void ToolConfHighlighted(int Index); + void ThemeHighlighted(int Index); void ReportProgress(const QString Message); Index: jdlThumbnailer.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlThumbnailer.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** jdlThumbnailer.cpp 24 Apr 2010 17:30:51 -0000 1.10 --- jdlThumbnailer.cpp 7 Aug 2010 21:24:48 -0000 1.11 *************** *** 404,409 **** CenteredImage = (uint16_t (*)[3]) CALLOC(Size*Size,sizeof(*CenteredImage)); jdlMemoryError(CenteredImage,__FILE__,__LINE__); ! // BG as window. ! QColor BGColor = jdlRaw->palette().color(QPalette::Window); for (uint16_t j=0;j<Size*Size;j++) { CenteredImage[j][0] = BGColor.blue() << 8; --- 404,411 ---- CenteredImage = (uint16_t (*)[3]) CALLOC(Size*Size,sizeof(*CenteredImage)); jdlMemoryError(CenteredImage,__FILE__,__LINE__); ! // The statusbar is an easy one to find and with the ! // slightly lighter color than background. ! QColor BGColor = ! jdlRaw->m_MainWindow->StatusBar->palette().color(QPalette::Window); for (uint16_t j=0;j<Size*Size;j++) { CenteredImage[j][0] = BGColor.blue() << 8; Index: jdlItems.i =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlItems.i,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** jdlItems.i 18 Jul 2010 08:01:34 -0000 1.10 --- jdlItems.i 7 Aug 2010 21:24:48 -0000 1.11 *************** *** 131,135 **** _("Intent of the profile")}, ! {"Fixed_PipeSize", "PipeSize", jdlGT_Choice, --- 131,135 ---- _("Intent of the profile")}, ! {"", "PipeSize", jdlGT_Choice, *************** *** 281,284 **** --- 281,296 ---- {"", + "ThemesDirectory", + 0, + "@INSTALL@/Themes", + 0}, + + {"", + "ThemeFile", + 0, + "@INSTALL@/Themes/Standard.dlt", + 0}, + + {"", "ToolConfsDirectory", 0, Index: jdlMain.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlMain.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** jdlMain.cpp 18 Jul 2010 08:01:34 -0000 1.27 --- jdlMain.cpp 7 Aug 2010 21:24:48 -0000 1.28 *************** *** 183,186 **** --- 183,187 ---- // must be done. // Also the processing pipe is asked here. + // As well as the theme. short RememberSettingLevel = UserSettings->value("RememberSettingLevel",2).toInt(); *************** *** 235,238 **** --- 236,290 ---- assert(ToolConfsIndex > -1); + // For the ThemeFile we do about the same as above for the ToolConfs + + QString ThemesDir = + // XXX TODO Remark that this means that we expect the Themes + // directory at the same place as installed. We have + UserSettings->value("ThemesDirectory","Themes").toString(); + Dir.setPath(ThemesDir); + QStringList Themes = Dir.entryList(QStringList("*.dlt"),QDir::Files); + QStringList ThemesTip; + + // Read the header of each dlt file as tooltip. + for (short i=0; i<Themes.size(); i++) { + ThemesTip << QString(""); + QString FileName = ThemesDir + "/" + Themes[i]; + FILE *InFile = fopen(FileName.toAscii().data(),"r"); + if (!InFile) { + jdlLogError(jdlError_FileOpen, + "File %s could not be opened\n", + FileName.toAscii().data()); + ::exit(EXIT_FAILURE); + } + + char LineBuffer[100]; + do { + if (NULL == fgets(LineBuffer,100,InFile)) break; + if (';' != LineBuffer[0]) break; + if (';' != LineBuffer[1]) continue; + ThemesTip[i] += QString(LineBuffer+2); + } while (!feof(InFile)); + } + + short ThemesIndex = -1; + QString ThemeFile = + UserSettings->value("ThemeFile","Standard.dlt").toString(); + TRACEMAIN("ThemeFile : %s",ThemeFile.toAscii().data()); + + // This is needed at bootup of the jdlRaw system. The default + // Themes must be in the UserSettings. + UserSettings->setValue("ThemeFile",ThemeFile); + + // At which index is the themes file ? + for (short i=0;i<Themes.size();i++) { + if (ThemeFile == Themes[i]) { + ThemesIndex = i; + break; + } + } + assert(ThemesIndex > -1); + + // Here goes the Rememberdialog. + if (PathInfo.exists() && !RememberSettingDontAsk && !m_JobMode) { m_RememberDialog = *************** *** 272,279 **** --- 324,347 ---- SLOT(ToolConfHighlighted(int))); + // Additional stuff for choosing the theme. + m_RememberDialog->ThemeLabel->setText(QObject::tr("Theme :")); + for (short i=0;i<Themes.size();i++) { + m_RememberDialog->ThemeFileChoice-> + addItem(Themes[i],ThemesTip[i]); + if (ThemeFile == Themes[i]) { + m_RememberDialog->ThemeFileChoice->setCurrentIndex(i); + } + } + + connect(m_RememberDialog->ThemeFileChoice, + SIGNAL(highlighted(int)), + this, + SLOT(ThemeHighlighted(int))); + m_RememberDialog->exec(); RememberSettingLevel = m_RememberDialog->ChoiceBox->currentIndex(); RememberSettingDontAsk = m_RememberDialog->DontAskAgainCheck->isChecked(); ToolConfsIndex = m_RememberDialog->ToolConfFileChoice->currentIndex(); + ThemesIndex = m_RememberDialog->ThemeFileChoice->currentIndex(); delete m_RememberDialog; *************** *** 281,284 **** --- 349,353 ---- UserSettings->setValue("RememberSettingDontAsk",RememberSettingDontAsk); UserSettings->setValue("ToolConfFile",ToolConfs[ToolConfsIndex]); + UserSettings->setValue("ThemeFile",Themes[ThemesIndex]); } delete UserSettings; *************** *** 304,313 **** // Start op the Gui stuff. ! QColor BGColor = jdlRaw->palette().color(QPalette::Window); ! jdlRaw->setStyleSheet( ! QString("QSplitter::handle {background-color:rgb(220,220,220);} ") + ! QString("QListWidget {background-color:rgb(%1,%2,%3);}") ! .arg(BGColor.red()).arg(BGColor.green()).arg(BGColor.blue())); m_GuiOptions = new jdlGuiOptions(); --- 373,402 ---- // Start op the Gui stuff. ! // Read the "theme" file, which is in fact a stylesheet. Apply it. ! QString FileName = jdlRaw->m_Settings->GetString(QString("ThemesDirectory")) ! + "/" ! + jdlRaw->m_Settings->GetString(QString("ThemeFile")); ! QFile StyleSheetFile(FileName); ! ! if (!StyleSheetFile.open(QIODevice::ReadOnly|QIODevice::Text)) { ! jdlLogError(jdlError_FileOpen, ! m_Settings->GetString("ThemeFile").toAscii().data()); ! assert(0); ! } ! QTextStream StyleSheetStream(&StyleSheetFile); ! QString StyleSheet; ! while (!StyleSheetStream.atEnd()) { ! QString Line = StyleSheetStream.readLine(); ! // ; will be considered comment. ! if (!Line.startsWith(";")) { ! StyleSheet += Line + " "; ! } ! } ! StyleSheetFile.close(); + jdlRaw->setStyleSheet(StyleSheet); + + + // Load gui options and all the windows. m_GuiOptions = new jdlGuiOptions(); *************** *** 423,426 **** --- 512,530 ---- //////////////////////////////////////////////////////////////////////////////// // + // theme highlighted. Show tooltip with description. + // + //////////////////////////////////////////////////////////////////////////////// + + void jdlMain::ThemeHighlighted(int Index) { + QPoint ThePoint = m_RememberDialog->pos(); + ThePoint.setX(ThePoint.x()+m_RememberDialog->width()/3); + ThePoint.setY(ThePoint.y()+m_RememberDialog->height()*2/3); + QToolTip::showText(ThePoint, + m_RememberDialog->ThemeFileChoice-> + itemData(Index).toString()); + } + + //////////////////////////////////////////////////////////////////////////////// + // // Determine and update the preview image. // *************** *** 752,758 **** m_Settings->SetValue(QString("RawsDirectory"),DirName); - QColor BGColor = jdlRaw->palette().color(QPalette::Window); - QColor AltColor = jdlRaw->palette().color(QPalette::AlternateBase); - QIcon Icon; Icon.addPixmap(QPixmap(QString(":/jdlRaw/Icons/Dia.jpg")), --- 856,859 ---- *************** *** 1926,1933 **** UpdatePreviewImage(); return; - } else if (ToolBoxName == "Fixed_PipeSize") { - QVariant Dummy; - CB_PipeSize(Dummy); - return; } else if (ToolBoxName == "Fixed_GenericCorrections") { m_TheProcessor->m_TriggerUpdateExifInfoAtEnd = 0; --- 2027,2030 ---- |
|
From: Jos De L. <jd...@us...> - 2010-08-07 21:24:56
|
Update of /cvsroot/jdlraw/jdlRaw/UI In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv1186/UI Modified Files: jdlMainWindow.ui jdlRememberDialog.ui Log Message: *) Some restyling and theming possibility. Index: jdlRememberDialog.ui =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/UI/jdlRememberDialog.ui,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** jdlRememberDialog.ui 28 Dec 2009 15:20:40 -0000 1.1 --- jdlRememberDialog.ui 7 Aug 2010 21:24:48 -0000 1.2 *************** *** 1,35 **** ! <ui version="4.0" > <class>jdlRememberDialog</class> ! <widget class="QDialog" name="jdlRememberDialog" > ! <property name="geometry" > <rect> <x>0</x> <y>0</y> <width>718</width> ! <height>622</height> </rect> </property> ! <property name="windowTitle" > <string>Dialog</string> </property> ! <layout class="QVBoxLayout" name="verticalLayout" > <item> ! <widget class="QLabel" name="label" > ! <property name="sizePolicy" > ! <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> ! <property name="contextMenuPolicy" > <enum>Qt::ActionsContextMenu</enum> </property> ! <property name="text" > <string/> </property> ! <property name="pixmap" > ! <pixmap resource="../jdlRaw.qrc" >:/jdlRaw/Icons/Bayer_pattern_on_sensor.svg</pixmap> </property> ! <property name="scaledContents" > <bool>true</bool> </property> --- 1,36 ---- ! <?xml version="1.0" encoding="UTF-8"?> ! <ui version="4.0"> <class>jdlRememberDialog</class> ! <widget class="QDialog" name="jdlRememberDialog"> ! <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>718</width> ! <height>639</height> </rect> </property> ! <property name="windowTitle"> <string>Dialog</string> </property> ! <layout class="QVBoxLayout" name="verticalLayout"> <item> ! <widget class="QLabel" name="label"> ! <property name="sizePolicy"> ! <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> ! <property name="contextMenuPolicy"> <enum>Qt::ActionsContextMenu</enum> </property> ! <property name="text"> <string/> </property> ! <property name="pixmap"> ! <pixmap resource="../jdlRaw.qrc">:/jdlRaw/Icons/Bayer_pattern_on_sensor.svg</pixmap> </property> ! <property name="scaledContents"> <bool>true</bool> </property> *************** *** 37,48 **** </item> <item> ! <widget class="QLabel" name="MessageLabel" > ! <property name="sizePolicy" > ! <sizepolicy vsizetype="Preferred" hsizetype="Preferred" > <horstretch>0</horstretch> <verstretch>1</verstretch> </sizepolicy> </property> ! <property name="text" > <string>The message</string> </property> --- 38,49 ---- </item> <item> ! <widget class="QLabel" name="MessageLabel"> ! <property name="sizePolicy"> ! <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>1</verstretch> </sizepolicy> </property> ! <property name="text"> <string>The message</string> </property> *************** *** 50,60 **** </item> <item> ! <widget class="QComboBox" name="ChoiceBox" /> </item> <item> ! <layout class="QHBoxLayout" name="horizontalLayout" > <item> ! <widget class="QCheckBox" name="DontAskAgainCheck" > ! <property name="text" > <string>Don't ask again</string> </property> --- 51,61 ---- </item> <item> ! <widget class="QComboBox" name="ChoiceBox"/> </item> <item> ! <layout class="QHBoxLayout" name="horizontalLayout"> <item> ! <widget class="QCheckBox" name="DontAskAgainCheck"> ! <property name="text"> <string>Don't ask again</string> </property> *************** *** 62,70 **** </item> <item> ! <spacer name="horizontalSpacer" > ! <property name="orientation" > <enum>Qt::Horizontal</enum> </property> ! <property name="sizeHint" stdset="0" > <size> <width>40</width> --- 63,71 ---- </item> <item> ! <spacer name="horizontalSpacer"> ! <property name="orientation"> <enum>Qt::Horizontal</enum> </property> ! <property name="sizeHint" stdset="0"> <size> <width>40</width> *************** *** 75,83 **** </item> <item> ! <widget class="QPushButton" name="OKButton" > ! <property name="text" > <string>OK</string> </property> ! <property name="default" > <bool>true</bool> </property> --- 76,84 ---- </item> <item> ! <widget class="QPushButton" name="OKButton"> ! <property name="text"> <string>OK</string> </property> ! <property name="default"> <bool>true</bool> </property> *************** *** 87,102 **** </item> <item> ! <layout class="QHBoxLayout" name="horizontalLayout_2" > ! <item> ! <widget class="QLabel" name="ProcessorLabel" > ! <property name="text" > <string>TextLabel</string> </property> </widget> </item> ! <item> ! <widget class="QComboBox" name="ToolConfFileChoice" > ! <property name="sizePolicy" > ! <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > <horstretch>0</horstretch> <verstretch>0</verstretch> --- 88,120 ---- </item> <item> ! <layout class="QGridLayout" name="gridLayout"> ! <item row="0" column="0"> ! <widget class="QLabel" name="ProcessorLabel"> ! <property name="text"> <string>TextLabel</string> </property> </widget> </item> ! <item row="0" column="1"> ! <widget class="QComboBox" name="ToolConfFileChoice"> ! <property name="sizePolicy"> ! <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> ! <horstretch>0</horstretch> ! <verstretch>0</verstretch> ! </sizepolicy> ! </property> ! </widget> ! </item> ! <item row="1" column="0"> ! <widget class="QLabel" name="ThemeLabel"> ! <property name="text"> ! <string>TextLabel</string> ! </property> ! </widget> ! </item> ! <item row="1" column="1"> ! <widget class="QComboBox" name="ThemeFileChoice"> ! <property name="sizePolicy"> ! <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> *************** *** 110,114 **** </widget> <resources> ! <include location="../jdlRaw.qrc" /> </resources> <connections/> --- 128,132 ---- </widget> <resources> ! <include location="../jdlRaw.qrc"/> </resources> <connections/> Index: jdlMainWindow.ui =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/UI/jdlMainWindow.ui,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** jdlMainWindow.ui 18 Jul 2010 08:01:34 -0000 1.10 --- jdlMainWindow.ui 7 Aug 2010 21:24:48 -0000 1.11 *************** *** 52,56 **** </property> <property name="focusPolicy"> ! <enum>Qt::ClickFocus</enum> </property> </widget> --- 52,56 ---- </property> <property name="focusPolicy"> ! <enum>Qt::NoFocus</enum> </property> </widget> *************** *** 155,159 **** </property> <property name="currentIndex"> ! <number>1</number> </property> <widget class="QWidget" name="GenericTab"> --- 155,159 ---- </property> <property name="currentIndex"> ! <number>12</number> </property> <widget class="QWidget" name="GenericTab"> *************** *** 173,183 **** <bool>true</bool> </property> ! <widget class="QWidget" name="scrollAreaWidgetContents_8"> <property name="geometry"> <rect> <x>0</x> <y>0</y> ! <width>291</width> ! <height>597</height> </rect> </property> --- 173,183 ---- <bool>true</bool> </property> ! <widget class="QWidget" name="GenericTabWidget"> <property name="geometry"> <rect> <x>0</x> <y>0</y> ! <width>102</width> ! <height>350</height> </rect> </property> *************** *** 321,343 **** </item> <item> - <widget class="QWidget" name="TB_Fixed_PipeSizeWidget" native="true"> - <layout class="QVBoxLayout" name="verticalLayout_21b"> - <item> - <widget class="QFrame" name="TBC_Fixed_PipeSizeWidget"> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - </widget> - </item> - <item> - <widget class="QWidget" name="PipeSizeWidget" native="true"/> - </item> - </layout> - </widget> - </item> - <item> <spacer name="verticalSpacer_3"> <property name="orientation"> --- 321,324 ---- *************** *** 394,404 **** <bool>true</bool> </property> ! <widget class="QWidget" name="scrollAreaWidgetContents"> <property name="geometry"> <rect> <x>0</x> <y>0</y> ! <width>277</width> ! <height>583</height> </rect> </property> --- 375,385 ---- <bool>true</bool> </property> ! <widget class="QWidget" name="CameraTabWidget"> <property name="geometry"> <rect> <x>0</x> <y>0</y> ! <width>102</width> ! <height>561</height> </rect> </property> *************** *** 601,609 **** <widget class="QWidget" name="InterpolationWidget" native="true"/> </item> - <item> <widget class="QWidget" name="FBDDWidget" native="true"/> </item> - <item> <layout class="QHBoxLayout" name="horizontalLayout_4"> --- 582,588 ---- *************** *** 616,620 **** </layout> </item> - <item> <layout class="QHBoxLayout" name="horizontalLayout_4a"> --- 595,598 ---- *************** *** 630,634 **** </layout> </item> - </layout> </widget> --- 608,611 ---- *************** *** 715,720 **** <x>0</x> <y>0</y> ! <width>291</width> ! <height>597</height> </rect> </property> --- 692,697 ---- <x>0</x> <y>0</y> ! <width>96</width> ! <height>26</height> </rect> </property> *************** *** 753,758 **** <x>0</x> <y>0</y> ! <width>291</width> ! <height>597</height> </rect> </property> --- 730,735 ---- <x>0</x> <y>0</y> ! <width>96</width> ! <height>26</height> </rect> </property> *************** *** 791,796 **** <x>0</x> <y>0</y> ! <width>291</width> ! <height>597</height> </rect> </property> --- 768,773 ---- <x>0</x> <y>0</y> ! <width>96</width> ! <height>26</height> </rect> </property> *************** *** 829,834 **** <x>0</x> <y>0</y> ! <width>291</width> ! <height>597</height> </rect> </property> --- 806,811 ---- <x>0</x> <y>0</y> ! <width>96</width> ! <height>26</height> </rect> </property> *************** *** 867,872 **** <x>0</x> <y>0</y> ! <width>291</width> ! <height>597</height> </rect> </property> --- 844,849 ---- <x>0</x> <y>0</y> ! <width>96</width> ! <height>26</height> </rect> </property> *************** *** 905,910 **** <x>0</x> <y>0</y> ! <width>291</width> ! <height>597</height> </rect> </property> --- 882,887 ---- <x>0</x> <y>0</y> ! <width>96</width> ! <height>26</height> </rect> </property> *************** *** 943,948 **** <x>0</x> <y>0</y> ! <width>291</width> ! <height>597</height> </rect> </property> --- 920,925 ---- <x>0</x> <y>0</y> ! <width>96</width> ! <height>26</height> </rect> </property> *************** *** 981,986 **** <x>0</x> <y>0</y> ! <width>291</width> ! <height>597</height> </rect> </property> --- 958,963 ---- <x>0</x> <y>0</y> ! <width>96</width> ! <height>26</height> </rect> </property> *************** *** 1019,1024 **** <x>0</x> <y>0</y> ! <width>291</width> ! <height>597</height> </rect> </property> --- 996,1001 ---- <x>0</x> <y>0</y> ! <width>96</width> ! <height>26</height> </rect> </property> *************** *** 1057,1062 **** <x>0</x> <y>0</y> ! <width>291</width> ! <height>597</height> </rect> </property> --- 1034,1039 ---- <x>0</x> <y>0</y> ! <width>96</width> ! <height>26</height> </rect> </property> *************** *** 1096,1106 **** <bool>true</bool> </property> ! <widget class="QWidget" name="scrollAreaWidgetContents_7"> <property name="geometry"> <rect> <x>0</x> <y>0</y> ! <width>291</width> ! <height>597</height> </rect> </property> --- 1073,1083 ---- <bool>true</bool> </property> ! <widget class="QWidget" name="InfoTabWidget"> <property name="geometry"> <rect> <x>0</x> <y>0</y> ! <width>305</width> ! <height>601</height> </rect> </property> *************** *** 1255,1258 **** --- 1232,1238 ---- <layout class="QHBoxLayout" name="horizontalLayout_2"> <item> + <widget class="QWidget" name="PipeSizeWidget" native="true"/> + </item> + <item> <widget class="QToolButton" name="ZoomFullButton"> <property name="toolTip"> |
|
From: Jos De L. <jd...@us...> - 2010-08-07 21:24:56
|
Update of /cvsroot/jdlraw/jdlRaw/ToolConfs In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv1186/ToolConfs Modified Files: Standard.dlp Log Message: *) Some restyling and theming possibility. Index: Standard.dlp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/ToolConfs/Standard.dlp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Standard.dlp 20 Dec 2009 21:28:11 -0000 1.8 --- Standard.dlp 7 Aug 2010 21:24:48 -0000 1.9 *************** *** 36,39 **** --- 36,40 ---- RGB_Exposure_0 RGB_DeltaGamma_0 + RGB_Gamma_0 RGB_LMHLightRecovery_0 RGB_Curve_0 |
Update of /cvsroot/jdlraw/jdlRaw/Icons In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv1186/Icons Added Files: Dia.jpg checkbox_checked.png checkbox_checked_13x13_c0.png imagegallery.svg triangle_down_13x13_c0.png triangle_right_13x13_c0.png Log Message: *) Some restyling and theming possibility. --- NEW FILE: checkbox_checked_13x13_c0.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: triangle_down_13x13_c0.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Dia.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: checkbox_checked.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: imagegallery.svg --- <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> <!-- Created with Inkscape (http://www.inkscape.org/) --> <svg version="1.0" x="0" y="0" width="60.0000000" height="60.0000000" id="svg1" sodipodi:version="0.32" inkscape:version="0.38.1" sodipodi:docname="imagegallery.svg" sodipodi:docbase="/home/danny/flat/scalable/actions" xmlns="http://www.w3.org/2000/svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:xlink="http://www.w3.org/1999/xlink"> <sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="9.8238822" inkscape:cx="35.190521" inkscape:cy="22.677082" inkscape:window-width="1016" inkscape:window-height="693" inkscape:window-x="0" inkscape:window-y="0" /> <defs id="defs3" /> <path style="fill:none;fill-rule:evenodd;stroke:#333333;stroke-opacity:1;stroke-width:5.0000000;stroke-linejoin:round;stroke-linecap:round;fill-opacity:0.75;stroke-dasharray:5.0000000,5.0000000;stroke-dashoffset:0.0000000;" d="M 9.1613476,19.410140 C 17.177527,8.0856968 19.976828,-9.8552761 49.369485,19.664622" id="path744" sodipodi:nodetypes="cc" sodipodi:stroke-cmyk="(0 0 0 0.8)" /> <rect style="font-size:12;fill:#cccccc;fill-rule:evenodd;stroke:none;stroke-width:3.125;stroke-dasharray:none;fill-opacity:1.0000000;" id="rect727" width="52.6777496" height="37.6633186" x="4.58067369" y="9.35810661" transform="matrix(0.999073,-4.305951e-2,4.305951e-2,0.999073,-1.948606,10.00991)" rx="2" /> <path style="font-size:12.000000;fill:#7f7f7f;fill-rule:evenodd;stroke:#333333;stroke-width:2.3050191;stroke-linecap:round;stroke-linejoin:round;" d="M 45.351900,54.472865 C 43.692297,50.326696 41.516259,46.292085 37.779346,44.222542 C 33.934596,44.246682 29.097981,44.654618 24.427514,44.887069 C 20.583939,47.185014 18.604737,51.470561 17.239243,55.872045" id="path849" sodipodi:nodetypes="cccc" /> <path sodipodi:type="arc" style="font-size:12;fill:#bfbfbf;fill-rule:evenodd;stroke:#333333;stroke-width:2.39607;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;" id="path716" sodipodi:cx="19.52412605" sodipodi:cy="22.30134201" sodipodi:rx="12.32629108" sodipodi:ry="12.32629108" d="M 31.850417 22.301342 A 12.326291 12.326291 0 1 0 7.197835,22.301342 A 12.3263 12.3263 0 1 0 31.8504 22.3013 L 19.524126 22.301342 z" transform="matrix(0.960809,-4.781999e-2,4.781999e-2,0.960809,10.12540,15.43920)" sodipodi:stroke-cmyk="(0 0 0 0.8)" /> <rect style="font-size:12;fill:none;fill-rule:evenodd;stroke:#333333;stroke-width:3.125;stroke-dasharray:none;stroke-linejoin:round;" id="rect834" width="52.6777496" height="37.6633186" x="4.58067369" y="9.35810661" transform="matrix(0.999073,-4.305951e-2,4.305951e-2,0.999073,-1.948606,10.00991)" rx="2" sodipodi:stroke-cmyk="(0 0 0 0.8)" /> <metadata> <rdf:RDF xmlns="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <Work rdf:about=""> <dc:title>Part of the Flat Icon Collection (Wed Aug 25 23:29:46 2004)</dc:title> <dc:description></dc:description> <dc:subject> <rdf:Bag> <rdf:li>action</rdf:li> </rdf:Bag> </dc:subject> <dc:publisher> <Agent rdf:about=""> <dc:title></dc:title> </Agent> </dc:publisher> <dc:creator> <Agent rdf:about=""> <dc:title>Danny Allen</dc:title> </Agent> </dc:creator> <dc:rights> <Agent rdf:about=""> <dc:title>Danny Allen</dc:title> </Agent> </dc:rights> <dc:date></dc:date> <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> <license rdf:resource="http://web.resource.org/cc/PublicDomain"> <dc:date></dc:date> </license> <dc:language>en</dc:language> </Work> <License rdf:about="http://web.resource.org/cc/PublicDomain"> <permits rdf:resource="http://web.resource.org/cc/Reproduction" /> <permits rdf:resource="http://web.resource.org/cc/Distribution" /> <permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" /> </License> </rdf:RDF> </metadata> </svg> --- NEW FILE: triangle_right_13x13_c0.png --- (This appears to be a binary file; contents omitted.) |
|
From: Jos De L. <jd...@us...> - 2010-08-07 21:24:56
|
Update of /cvsroot/jdlraw/jdlRaw/Themes In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv1186/Themes Added Files: None.dlt Standard.dlt Log Message: *) Some restyling and theming possibility. --- NEW FILE: None.dlt --- ; ; jdlRaw ; ; $Id: None.dlt,v 1.1 2010/08/07 21:24:48 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/>. ; ; ;; No theme : Just use the one that your window manager is dictating. ; --- NEW FILE: Standard.dlt --- ; ; jdlRaw ; ; $Id: Standard.dlt,v 1.1 2010/08/07 21:24:48 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/>. ; ; ;; Mimic a lightroom like color scheme that distracts as few ;; as possible from the image. ; * { font-size:8pt; } QMainWindow, QDialog { background-color: #303030; color: #C0C0C0; } QStatusBar, QStatusBar > QLabel, QMenuBar, QMenu, QMenu::item, QScrollBar, QComboBox, QComboBox QAbstractItemView, QAbstractSpinBox, QLineEdit, QSlider, QPushButton , QToolButton { background-color: #404040; color: #C0C0C0; } QMenu::separator { background-color: #505050; color: #C0C0C0; } QCheckBox::indicator:non-exclusive:checked { background-color: #505050; image: url(:/jdlRaw/Icons/checkbox_checked_13x13_c0.png); } QCheckBox::indicator:non-exclusive:unchecked { background-color: #505050; } QFrame { border-style: none; background-color: #303030; color: #C0C0C0; } QGroupBox { background-color: #303030; color: #C0C0C0; } QComboBox:disabled { background-color: #404040; color: #000000; font-style: normal; font-weight: normal; } QCheckBox { background-color: #303030; color: #C0C0C0; } ;due to its tiny size we have to make it some lighter than a button. QCheckBox::indicator:checked { background-color: #505050; image: url(:/jdlRaw/Icons/checkbox_checked_13x13_c0.png); } QCheckBox::indicator:unchecked { background-color: #505050; } QAbstractScrollArea { background-color: #303030; color: #C0C0C0; } ; The central tabwidget is somehow more complicated due to the labels below. QTabWidget , QWidget#GenericTabWidget , QWidget#CameraTabWidget , QWidget#InfoTabWidget , QWidget#InfoLabel , QWidget#ParentForToolboxes_0 , QWidget#ParentForToolboxes_1 , QWidget#ParentForToolboxes_2 , QWidget#ParentForToolboxes_3 , QWidget#ParentForToolboxes_4 , QWidget#ParentForToolboxes_5 , QWidget#ParentForToolboxes_6 , QWidget#ParentForToolboxes_7 , QWidget#ParentForToolboxes_8 , QWidget#ParentForToolboxes_9 { background-color: #303030; color: #C0C0C0; } QTabBar { background-color: #404040; color: #C0C0C0; } ;For the toolboxcontrols and it doesn't hurt nowhere. ;.QFrame to avoid impact on label. ; QWidget#GenericTabWidget .QFrame , QWidget#CameraTab .QFrame , QWidget#InfoTabWidget .QFrame , QWidget#ParentForToolboxes_0 .QFrame , QWidget#ParentForToolboxes_1 .QFrame , QWidget#ParentForToolboxes_2 .QFrame , QWidget#ParentForToolboxes_3 .QFrame , QWidget#ParentForToolboxes_4 .QFrame , QWidget#ParentForToolboxes_5 .QFrame , QWidget#ParentForToolboxes_6 .QFrame , QWidget#ParentForToolboxes_7 .QFrame , QWidget#ParentForToolboxes_8 .QFrame , QWidget#ParentForToolboxes_9 .QFrame { border-style: none; border-width: 1px; background-color: #404040; color: #C0C0C0; } ;Overwrite the label bg as used in the toolboxcontrols QWidget#GenericTabWidget .QFrame > QLabel , QWidget#CameraTab .QFrame > QLabel , QWidget#InfoTabWidget .QFrame > QLabel , QWidget#ParentForToolboxes_0 .QFrame > QLabel , QWidget#ParentForToolboxes_1 .QFrame > QLabel , QWidget#ParentForToolboxes_2 .QFrame > QLabel , QWidget#ParentForToolboxes_3 .QFrame > QLabel , QWidget#ParentForToolboxes_4 .QFrame > QLabel , QWidget#ParentForToolboxes_5 .QFrame > QLabel , QWidget#ParentForToolboxes_6 .QFrame > QLabel , QWidget#ParentForToolboxes_7 .QFrame > QLabel , QWidget#ParentForToolboxes_8 .QFrame > QLabel , QWidget#ParentForToolboxes_9 .QFrame > QLabel { background-color: #404040; color: #C0C0C0; } QWidget#GenericTabWidget .QFrame > QCheckBox , QWidget#CameraTab .QFrame > QCheckBox , QWidget#InfoTabWidget .QFrame > QCheckBox , QWidget#ParentForToolboxes_0 .QFrame > QCheckBox , QWidget#ParentForToolboxes_1 .QFrame > QCheckBox , QWidget#ParentForToolboxes_2 .QFrame > QCheckBox , QWidget#ParentForToolboxes_3 .QFrame > QCheckBox , QWidget#ParentForToolboxes_4 .QFrame > QCheckBox , QWidget#ParentForToolboxes_5 .QFrame > QCheckBox , QWidget#ParentForToolboxes_6 .QFrame > QCheckBox , QWidget#ParentForToolboxes_7 .QFrame > QCheckBox , QWidget#ParentForToolboxes_8 .QFrame > QCheckBox , QWidget#ParentForToolboxes_9 .QFrame > QCheckBox { background-color: #404040; color: #C0C0C0; } |
|
From: Jos De L. <jd...@us...> - 2010-08-07 21:24:56
|
Update of /cvsroot/jdlraw/jdlRaw In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv1186 Modified Files: CHANGELOG jdlRaw.qrc Log Message: *) Some restyling and theming possibility. Index: jdlRaw.qrc =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/jdlRaw.qrc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** jdlRaw.qrc 16 Apr 2010 15:28:24 -0000 1.2 --- jdlRaw.qrc 7 Aug 2010 21:24:47 -0000 1.3 *************** *** 16,19 **** --- 16,22 ---- <file>Icons/imagegallery.svg</file> <file>Icons/Dia.jpg</file> + <file>Icons/checkbox_checked_13x13_c0.png</file> + <file>Icons/triangle_down_13x13_c0.png</file> + <file>Icons/triangle_right_13x13_c0.png</file> </qresource> </RCC> Index: CHANGELOG =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/CHANGELOG,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** CHANGELOG 18 Jul 2010 08:01:34 -0000 1.55 --- CHANGELOG 7 Aug 2010 21:24:47 -0000 1.56 *************** *** 1,5 **** ! Latest change : 20100718_1000 (manipulate me to force CVS log) $Log$ Revision 1.55 2010/07/18 08:01:34 jdla --- 1,9 ---- ! Latest change : 20100807_2330 (manipulate me to force CVS log) $Log$ + Revision 1.56 2010/08/07 21:24:47 jdla + + *) Some restyling and theming possibility. + Revision 1.55 2010/07/18 08:01:34 jdla |
|
From: Jos De L. <jd...@us...> - 2010-07-18 10:51:50
|
Update of /cvsroot/jdlraw/jdlRaw/Themes In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv30785/Themes Log Message: Directory /cvsroot/jdlraw/jdlRaw/Themes added to the repository |
|
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}, |
|
From: Jos De L. <jd...@us...> - 2010-07-18 08:01:42
|
Update of /cvsroot/jdlraw/jdlRaw/UI In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv16953/UI Modified Files: jdlMainWindow.ui 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.ui =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/UI/jdlMainWindow.ui,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** jdlMainWindow.ui 1 May 2010 07:38:25 -0000 1.9 --- jdlMainWindow.ui 18 Jul 2010 08:01:34 -0000 1.10 *************** *** 1497,1500 **** --- 1497,1501 ---- <addaction name="separator"/> <addaction name="actionFileWriteJob"/> + <addaction name="actionFileWriteThisJob"/> <addaction name="separator"/> <addaction name="actionFileExit"/> *************** *** 1536,1539 **** --- 1537,1545 ---- </property> </action> + <action name="actionFileWriteThisJob"> + <property name="text"> + <string>Write This Job</string> + </property> + </action> <action name="actionOpen"> <property name="text"> |
|
From: Jos De L. <jd...@us...> - 2010-07-18 08:01:42
|
Update of /cvsroot/jdlraw/jdlRaw In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv16953 Modified Files: CHANGELOG 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: CHANGELOG =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/CHANGELOG,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** CHANGELOG 5 Jun 2010 09:22:37 -0000 1.54 --- CHANGELOG 18 Jul 2010 08:01:34 -0000 1.55 *************** *** 1,5 **** ! Latest change : 20100605_1130 (manipulate me to force CVS log) $Log$ Revision 1.54 2010/06/05 09:22:37 jdla --- 1,15 ---- ! Latest change : 20100718_1000 (manipulate me to force CVS log) $Log$ + Revision 1.55 2010/07/18 08:01:34 jdla + + *) 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) + Revision 1.54 2010/06/05 09:22:37 jdla |
|
From: Jos De L. <jd...@us...> - 2010-06-05 09:22:46
|
Update of /cvsroot/jdlraw/jdlRaw/Sources In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv8895/Sources Modified Files: jdlDcRaw.cpp jdlDcRaw.h jdlDefines.h Log Message: *) Corrected (long standing) error in rework of dcraw , impacting canon sraw formats. Index: jdlDefines.h =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlDefines.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** jdlDefines.h 1 Jun 2010 20:38:57 -0000 1.11 --- jdlDefines.h 5 Jun 2010 09:22:38 -0000 1.12 *************** *** 156,159 **** --- 156,160 ---- // depth is 3 or 4 (according to buffer layout). + /* #define DROP_IMAGE(w,h,b,depth) { \ char FileName[100]; \ *************** *** 164,167 **** --- 165,183 ---- fclose(DropFile); \ } + */ + + #define DROP_IMAGE(w,h,b,depth) { \ + FILE *DropFile = fopen("ImageDrop.txt","wt"); \ + if (!DropFile) exit(EXIT_FAILURE); \ + int r,c; \ + for (r=h/2; r<h/2+10; r++) \ + for (c=w/2; c<w/2+10; c++) \ + fprintf(DropFile,"%04x %04x %04x %04x\n", \ + b[r*w+c][0], \ + b[r*w+c][1], \ + b[r*w+c][2], \ + b[r*w+c][3]); \ + fclose(DropFile); \ + } #endif Index: jdlDcRaw.h =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlDcRaw.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** jdlDcRaw.h 1 Jun 2010 20:38:57 -0000 1.13 --- jdlDcRaw.h 5 Jun 2010 09:22:38 -0000 1.14 *************** *** 137,140 **** --- 137,152 ---- //////////////////////////////////////////////////////////////////////////////// + // + // SET_LOAD_RAW + // + // Macro to try and analyze the m_LoadRawFunction in the dcraw jungle + // + //////////////////////////////////////////////////////////////////////////////// + + #define SET_LOAD_RAW(x) {m_LoadRawFunction = (x); \ + m_LineWhereLoadRawSet = __LINE__; \ + strncpy(m_LoadRawName,#x,sizeof(m_LoadRawName)-1); } + + //////////////////////////////////////////////////////////////////////////////// // // m_UserSetting_* : *************** *** 471,474 **** --- 483,489 ---- void (DcRaw::*m_ThumbLoadRawFunction)(); + int m_LineWhereLoadRawSet; + char m_LoadRawName[128]; + jmp_buf m_Failure; Index: jdlDcRaw.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlDcRaw.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** jdlDcRaw.cpp 1 Jun 2010 20:38:57 -0000 1.20 --- jdlDcRaw.cpp 5 Jun 2010 09:22:37 -0000 1.21 *************** *** 187,191 **** memset (white, 0, sizeof white); m_ThumbOffset = m_ThumbLength = m_ThumbWidth = m_ThumbHeight = 0; ! m_LoadRawFunction = m_ThumbLoadRawFunction = 0; m_WriteThumb = &CLASS jpeg_thumb; m_Data_Offset = m_MetaLength = m_Tiff_bps = m_Tiff_Compress = 0; --- 187,191 ---- memset (white, 0, sizeof white); m_ThumbOffset = m_ThumbLength = m_ThumbWidth = m_ThumbHeight = 0; ! SET_LOAD_RAW( m_ThumbLoadRawFunction = 0); m_WriteThumb = &CLASS jpeg_thumb; [...1146 lines suppressed...] ! m_LoadRawFunction = &CLASS LoadMagick; m_Filters = 0; // No interpolation of course as it is no raw image. --- 8437,8441 ---- m_WhiteLevel = 0xffff; // Per construction XXX JDLA Check. ! SET_LOAD_RAW( &CLASS LoadMagick); m_Filters = 0; // No interpolation of course as it is no raw image. *************** *** 8654,8657 **** --- 8657,8663 ---- // That's the hook into the real workhorse. + TRACEKEYVALS("LoadRawFunction","%s",m_LoadRawName); + TRACEKEYVALS("Set at line","%d",m_LineWhereLoadRawSet); + (*this.*m_LoadRawFunction)(); |
|
From: Jos De L. <jd...@us...> - 2010-06-05 09:22:46
|
Update of /cvsroot/jdlraw/jdlRaw In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv8895 Modified Files: CHANGELOG Log Message: *) Corrected (long standing) error in rework of dcraw , impacting canon sraw formats. Index: CHANGELOG =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/CHANGELOG,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** CHANGELOG 1 Jun 2010 20:38:57 -0000 1.53 --- CHANGELOG 5 Jun 2010 09:22:37 -0000 1.54 *************** *** 1,5 **** ! Latest change : 20100601_2230 (manipulate me to force CVS log) $Log$ Revision 1.53 2010/06/01 20:38:57 jdla --- 1,10 ---- ! Latest change : 20100605_1130 (manipulate me to force CVS log) $Log$ + Revision 1.54 2010/06/05 09:22:37 jdla + + *) Corrected (long standing) error in rework of dcraw , impacting + canon sraw formats. + Revision 1.53 2010/06/01 20:38:57 jdla |
|
From: Jos De L. <jd...@us...> - 2010-06-01 20:39:05
|
Update of /cvsroot/jdlraw/jdlRaw/Sources In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv6145/Sources Modified Files: jdlAdobeTable.h jdlDcRaw.cpp jdlDcRaw.h jdlDefines.h jdlExposure.cpp Log Message: *) Synced with latest dcraw (V9.01) Index: jdlDefines.h =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlDefines.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** jdlDefines.h 27 Feb 2010 19:02:41 -0000 1.10 --- jdlDefines.h 1 Jun 2010 20:38:57 -0000 1.11 *************** *** 50,54 **** #define ULIM(x,y,z) ((y) < (z) ? LIM(x,y,z) : LIM(x,z,y)) #define CLIP(x) LIM(x,0,0xffff) ! #define SWAP(a,b) { a ^= b; a ^= (b ^= a); } // Input power factor on some inputs. For those who like. See Levels f.i. --- 50,54 ---- #define ULIM(x,y,z) ((y) < (z) ? LIM(x,y,z) : LIM(x,z,y)) #define CLIP(x) LIM(x,0,0xffff) ! #define SWAP(a,b) { a=a+b; b=a-b; a=a-b; } // Input power factor on some inputs. For those who like. See Levels f.i. Index: jdlDcRaw.h =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlDcRaw.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** jdlDcRaw.h 2 May 2010 10:14:02 -0000 1.12 --- jdlDcRaw.h 1 Jun 2010 20:38:57 -0000 1.13 *************** *** 38,42 **** // Adaptation of dcraw.c stuff. ! #define VERSION "8.99" // Update along with dcraw syncing ... #ifndef _GNU_SOURCE --- 38,42 ---- // Adaptation of dcraw.c stuff. ! #define VERSION "9.01" // Update along with dcraw syncing ... #ifndef _GNU_SOURCE *************** *** 439,443 **** --- 439,445 ---- unsigned m_Tiff_Compress; unsigned m_BlackLevel; + unsigned m_CBlackLevel[8]; unsigned m_BlackLevel_AfterPhase1; + unsigned m_CBlackLevel_AfterPhase1[4]; // Yes 4 ! The upper 4 not needed. unsigned m_WhiteLevel; unsigned m_WhiteLevel_AfterPhase1; *************** *** 669,673 **** int canon_600_color(int ratio[2],int mar); void canon_600_fixed_wb(int temp); - void canon_black (double dark[2],int nblack); void read_shorts(uint16_t *pixel,int count); double getreal(int type); --- 671,674 ---- Index: jdlAdobeTable.h =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlAdobeTable.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** jdlAdobeTable.h 27 Feb 2010 19:02:41 -0000 1.4 --- jdlAdobeTable.h 1 Jun 2010 20:38:57 -0000 1.5 *************** *** 43,538 **** static const jdlAdobeTableItem AdobeTable[] = { ! { "AGFAPHOTO DC-833m", 0, 0, /* DJC */ ! { 11438,-3762,-1115,-2409,9914,2497,-1227,2295,5300 } }, ! { "Apple QuickTake", 0, 0, /* DJC */ ! { 21392,-5653,-3353,2406,8010,-415,7166,1427,2078 } }, ! { "Canon EOS D2000", 0, 0, ! { 24542,-10860,-3401,-1490,11370,-297,2858,-605,3225 } }, ! { "Canon EOS D6000", 0, 0, ! { 20482,-7172,-3125,-1033,10410,-285,2542,226,3136 } }, [...979 lines suppressed...] ! { "SONY DSLR-A330", 0, 0, ! { 9847,-3091,-929,-8485,16346,2225,-714,595,7103 } }, ! { "SONY DSLR-A350", 0, 0xffc, ! { 6038,-1484,-578,-9146,16746,2513,-875,746,7217 } }, ! { "SONY DSLR-A380", 0, 0, ! { 6038,-1484,-579,-9145,16746,2512,-875,746,7218 } }, ! { "SONY DSLR-A5", 126, 0, ! { 4950,-580,-103,-5228,12542,3029,-709,1435,7371 } }, ! { "SONY DSLR-A700", 126, 0, ! { 5775,-805,-359,-8574,16295,2391,-1943,2341,7249 } }, ! { "SONY DSLR-A850", 128, 0, ! { 5413,-1162,-365,-5665,13098,2866,-608,1179,8440 } }, ! { "SONY DSLR-A900", 128, 0, ! { 5209,-1072,-397,-8845,16120,2919,-1618,1803,8654 } }, ! { "SONY NEX-3", 138, 0, /* DJC */ ! { 6907,-1256,-645,-4940,12621,2320,-1710,2581,6230 } }, ! { "SONY NEX-5", 116, 0, /* DJC */ ! { 6807,-1350,-342,-4216,11649,2567,-1089,2001,6420 } } }; Index: jdlDcRaw.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlDcRaw.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** jdlDcRaw.cpp 26 May 2010 19:08:46 -0000 1.19 --- jdlDcRaw.cpp 1 Jun 2010 20:38:57 -0000 1.20 *************** *** 184,187 **** --- 184,188 ---- m_ColorDescriptor[0] = m_Description[0] = m_Artist[0] = m_CameraMake[0] = m_CameraModel[0] = m_CameraModelBis[0] = 0; m_IsoSpeed = m_Shutter = m_Aperture = m_FocalLength = unique_id = 0; + memset(m_CBlackLevel,0,sizeof m_CBlackLevel); memset (white, 0, sizeof white); m_ThumbOffset = m_ThumbLength = m_ThumbWidth = m_ThumbHeight = 0; *************** *** 418,435 **** } - void CLASS canon_black (double dark[2], int nblack) - { - int c, diff, row, col; - - if (!nblack) return; - for (c=0; c<2; c++) dark[c] /= nblack >> 1; - if ((diff = (int)(dark[0] - dark[1]))) - for (row=0; row < m_Height; row++) - for (col=1; col < m_Width; col+=2) - BAYER(row,col) += diff; - dark[1] += diff; - m_BlackLevel = (unsigned)((dark[0] + dark[1] + 1) / 2); - } - void CLASS canon_600_fixed_wb (int temp) { --- 419,422 ---- *************** *** 787,794 **** { uint16_t *pixel, *prow, *huff[2]; ! int nblocks, lowbits, i, c, row, r, col, save, val, nblack=0; unsigned irow, icol; int block, diffbuf[64], leaf, len, diff, carry=0, pnum=0, base[2]; - double dark[2] = {0,0}; crw_init_tables (m_Tiff_Compress,huff); --- 774,780 ---- { uint16_t *pixel, *prow, *huff[2]; ! int nblocks, lowbits, i, c, row, r, col, save, val; unsigned irow, icol; int block, diffbuf[64], leaf, len, diff, carry=0, pnum=0, base[2]; crw_init_tables (m_Tiff_Compress,huff); *************** *** 843,851 **** for (col=0; col < m_RawWidth; col++) { icol = col - m_LeftMargin; if (icol < m_Width) BAYER(irow,icol) = pixel[r*m_RawWidth+col]; else if (col > 1 && (unsigned)(col-m_LeftMargin+2) > (unsigned) m_Width+3) ! dark[icol & 1] += (nblack++,pixel[r*m_RawWidth+col]); } } --- 829,838 ---- for (col=0; col < m_RawWidth; col++) { icol = col - m_LeftMargin; + c = FC(irow,icol); if (icol < m_Width) BAYER(irow,icol) = pixel[r*m_RawWidth+col]; else if (col > 1 && (unsigned)(col-m_LeftMargin+2) > (unsigned) m_Width+3) ! m_CBlackLevel[c] += (m_CBlackLevel[4+c]++,pixel[r*m_RawWidth+col]); } } *************** *** 854,858 **** FREE(huff[0]); FREE(huff[1]); ! canon_black(dark,nblack); } --- 841,847 ---- FREE(huff[0]); FREE(huff[1]); ! for (c=0;c<4;c++) { ! if (m_CBlackLevel[4+c]) m_CBlackLevel[c] /= m_CBlackLevel[4+c]; ! } } *************** *** 978,983 **** void CLASS lossless_jpeg_load_raw() { ! int jwide, jrow, jcol, val, jidx, i, j, row=0, col=0, nblack=0; ! double dark[2] = { 0,0 }; struct jhead jh; int min=INT_MAX; --- 967,971 ---- void CLASS lossless_jpeg_load_raw() { ! int jwide, jrow, jcol, val, jidx, c, i, j, row=0, col=0; struct jhead jh; int min=INT_MAX; *************** *** 1007,1010 **** --- 995,999 ---- col += (row--,m_RawWidth); if ((unsigned) (row-m_TopMargin) < m_Height) { + c = FC(row-m_TopMargin,col-m_LeftMargin); if ((unsigned) (col-m_LeftMargin) < m_Width) { BAYER(row-m_TopMargin,col-m_LeftMargin) = val; *************** *** 1012,1017 **** } else if (col > 1 && (unsigned) (col-m_LeftMargin+2) > (unsigned) m_Width+3) ! dark[(col-m_LeftMargin) & 1] += (nblack++,val); ! } if (++col >= m_RawWidth) --- 1001,1005 ---- } else if (col > 1 && (unsigned) (col-m_LeftMargin+2) > (unsigned) m_Width+3) ! m_CBlackLevel[c] += (m_CBlackLevel[4+c]++,val); } if (++col >= m_RawWidth) *************** *** 1020,1024 **** } ljpeg_end(&jh); ! canon_black(dark,nblack); if (!strcasecmp(m_CameraMake,"KODAK")) { m_BlackLevel = min; --- 1008,1014 ---- } ljpeg_end(&jh); ! for (c=0;c<4;c++) { ! if (m_CBlackLevel[4+c]) m_CBlackLevel[c] /= m_CBlackLevel[4+c]; ! } if (!strcasecmp(m_CameraMake,"KODAK")) { m_BlackLevel = min; *************** *** 1867,1871 **** i = (col ^ (bite == 24)) - m_LeftMargin; if ((unsigned) i < m_Width) ! BAYER(row,i) = val << (m_Load_Flags >> 6); else if (m_Load_Flags & 32) m_BlackLevel += val; --- 1857,1861 ---- i = (col ^ (bite == 24)) - m_LeftMargin; if ((unsigned) i < m_Width) ! BAYER(row,i) = val; else if (m_Load_Flags & 32) m_BlackLevel += val; *************** *** 1894,1898 **** fseek (m_InputFile, 2*(m_RawWidth - m_Width), SEEK_CUR); for (col=0; col < m_Width; col++) ! if ((BAYER2(row,col) = pixel[col]) >> bits) derror(); } FREE (pixel); --- 1884,1888 ---- fseek (m_InputFile, 2*(m_RawWidth - m_Width), SEEK_CUR); for (col=0; col < m_Width; col++) ! if ((BAYER2(row,col) = pixel[col] >> m_Load_Flags) >> bits) derror(); } FREE (pixel); *************** *** 2612,2616 **** } for (i=0; i < 16; i++, col+=2) ! BAYER(row,col) = m_Curve[pix[i] << 1] >> 1; col -= col & 1 ? 1:31; } --- 2602,2606 ---- } for (i=0; i < 16; i++, col+=2) ! BAYER(row,col) = m_Curve[pix[i] << 1] >> 2; col -= col & 1 ? 1:31; } *************** *** 3498,3501 **** --- 3488,3493 ---- } FREE (pixel); + FCLOSE(fp); + memset(m_CBlackLevel,0,sizeof m_CBlackLevel); m_BlackLevel = 0; } *************** *** 3611,3615 **** // jdlScaleColors // Be aware : jdlWaveletDenoising has as side effect that ! // m_Blacklevel and m_Whitelevel change. // //////////////////////////////////////////////////////////////////////////////// --- 3603,3607 ---- // jdlScaleColors // Be aware : jdlWaveletDenoising has as side effect that ! // m_Blacklevel , m_CBlackLevel[c] and m_Whitelevel change. // //////////////////////////////////////////////////////////////////////////////// *************** *** 3620,3623 **** --- 3612,3622 ---- double dsum[8], dmin, dmax; + // JDLA This is again dcraw obfuscation. + // Earlier we splitted in the common term (in m_BlackLevel) and + // the diffs (in m_CBlackChannel[c]) + // Now the common term is again added putting everyting + // in m_CBlackChannel[c] + for (c=0; c<4; c++) m_CBlackLevel[c] += m_BlackLevel; + // Use the UserSetting_Multipliers if they are defined. // Remark that they will be overwritten if we have a AutoWb on CameraWb on ! *************** *** 3664,3668 **** val = m_Image[y*m_Width+x][c]; if ((unsigned) val > m_WhiteLevel-25) goto skip_block; ! if ((val -= m_BlackLevel) < 0) val = 0; sum[c] += val; sum[c+4]++; --- 3663,3667 ---- val = m_Image[y*m_Width+x][c]; if ((unsigned) val > m_WhiteLevel-25) goto skip_block; ! if ((val -= m_CBlackLevel[c]) < 0) val = 0; sum[c] += val; sum[c+4]++; *************** *** 3693,3697 **** for (col=0; col < 8; col++) { c = FC(row,col); ! if ((val = white[row][col] - m_BlackLevel) > 0) sum[c] += val; sum[c+4]++; --- 3692,3696 ---- for (col=0; col < 8; col++) { c = FC(row,col); ! if ((val = white[row][col] - m_CBlackLevel[c]) > 0) sum[c] += val; sum[c+4]++; *************** *** 3748,3752 **** ASSIGN(m_PreMultipliers[c],VALUE(m_PreMultipliers[c]) / dmax); ASSIGN(m_Multipliers[c], ! VALUE(m_PreMultipliers[c])*0xffff/(m_WhiteLevel-m_BlackLevel)); } m_MinPreMulti = dmin/dmax; // And the maximum is per construction 1.0 --- 3747,3751 ---- ASSIGN(m_PreMultipliers[c],VALUE(m_PreMultipliers[c]) / dmax); ASSIGN(m_Multipliers[c], ! VALUE(m_PreMultipliers[c])*0xffff/(m_WhiteLevel-m_CBlackLevel[c])); } m_MinPreMulti = dmin/dmax; // And the maximum is per construction 1.0 *************** *** 3812,3817 **** for (short Color=0; Color<4; Color++) { uint32_t Value = m_Image[Pos][Color]; ! if (Value > m_BlackLevel) { ! Value -= m_BlackLevel; Value = (uint32_t)(Value*VALUE(m_Multipliers[Color])); } else { --- 3811,3816 ---- for (short Color=0; Color<4; Color++) { uint32_t Value = m_Image[Pos][Color]; ! if (Value > m_CBlackLevel[Color]) { ! Value -= m_CBlackLevel[Color]; Value = (uint32_t)(Value*VALUE(m_Multipliers[Color])); } else { *************** *** 3897,3901 **** if (m_Image[Pos][Color] >= (uint16_t) ! ((m_WhiteLevel-m_BlackLevel)*VALUE(m_Multipliers[Color]))) { Clipped = 1; } --- 3896,3900 ---- if (m_Image[Pos][Color] >= (uint16_t) ! ((m_WhiteLevel-m_CBlackLevel[Color])*VALUE(m_Multipliers[Color]))) { Clipped = 1; } *************** *** 5121,5125 **** m_ShotOrder = (get4(),get4()); if (tag == 0x200 && len == 4) ! m_BlackLevel = (get2()+get2()+get2()+get2())/4; if (tag == 0x201 && len == 4) goto get2_rggb; --- 5120,5124 ---- m_ShotOrder = (get4(),get4()); if (tag == 0x200 && len == 4) ! for (c=0; c<4; c++) m_CBlackLevel[c ^ c >> 1] = get2(); if (tag == 0x201 && len == 4) goto get2_rggb; *************** *** 5127,5131 **** meta_offset = ftell(m_InputFile) + 14; if (tag == 0x401 && type ==4 && len == 4) { ! m_BlackLevel = (get4()+get4()+get4()+get4())/4; } if (tag == 0xe01) { /* Nikon Capture Note */ --- 5126,5130 ---- meta_offset = ftell(m_InputFile) + 14; if (tag == 0x401 && type ==4 && len == 4) { ! for (c=0; c<4; c++) m_CBlackLevel[c ^ c >> 1] = get4(); } if (tag == 0xe01) { /* Nikon Capture Note */ *************** *** 5159,5164 **** for (c=0; c<3; c++) m_cmatrix[i][c] = ((short) get2()) / 256.0; if ((tag == 0x1012 || tag == 0x20400600) && len == 4) ! for (m_BlackLevel = i=0; i < 4; i++) ! m_BlackLevel += get2() << 2; if (tag == 0x1017 || tag == 0x20400100) ASSIGN(m_CameraMultipliers[0], get2() / 256.0); --- 5158,5162 ---- for (c=0; c<3; c++) m_cmatrix[i][c] = ((short) get2()) / 256.0; if ((tag == 0x1012 || tag == 0x20400600) && len == 4) ! for (c=0;c<4;c++) m_CBlackLevel[c ^ c >> 1] = get2(); if (tag == 0x1017 || tag == 0x20400100) ASSIGN(m_CameraMultipliers[0], get2() / 256.0); *************** *** 5180,5184 **** parse_makernote (base, 0x2040); if (tag == 0xb028) { ! fseek (m_InputFile, get4(), SEEK_SET); parse_thumb_note (base, 136, 137); } --- 5178,5182 ---- parse_makernote (base, 0x2040); if (tag == 0xb028) { ! fseek (m_InputFile, get4()+base, SEEK_SET); parse_thumb_note (base, 136, 137); } *************** *** 5396,5399 **** --- 5394,5398 ---- int i, j, c; int l_ImageLength=0; + int blrr=1, blrc=1, dblack[] = { 0,0,0,0 }; char l_Software[64]; char *l_cbuf; *************** *** 5402,5406 **** uint8_t l_cfa_pc[] = { 0,1,2,3 }; uint8_t l_tab[256]; - double l_dblack; double l_cc[4][4]; double l_cm[4][3]; --- 5401,5404 ---- *************** *** 5450,5462 **** m_ThumbLength = l_Length; break; ! case 2: case 256: /* ImageWidth */ m_Tiff_IFD[l_ifd].width = getint(l_Type); break; ! case 3: case 257: /* ImageHeight */ m_Tiff_IFD[l_ifd].height = getint(l_Type); break; case 258: /* BitsPerSample */ m_Tiff_IFD[l_ifd].samples = l_Length & 7; ! m_Tiff_IFD[l_ifd].bps = get2(); break; case 259: /* Compression */ --- 5448,5464 ---- m_ThumbLength = l_Length; break; ! case 61440: /* Fuji HS10 table */ ! parse_tiff_ifd (l_Base); ! break; ! case 2: case 256: case 61441: /* ImageWidth */ m_Tiff_IFD[l_ifd].width = getint(l_Type); break; ! case 3: case 257: case 61442: /* ImageHeight */ m_Tiff_IFD[l_ifd].height = getint(l_Type); break; case 258: /* BitsPerSample */ + case 61443: m_Tiff_IFD[l_ifd].samples = l_Length & 7; ! m_Tiff_IFD[l_ifd].bps = getint(l_Type); break; case 259: /* Compression */ *************** *** 5482,5485 **** --- 5484,5488 ---- case 273: /* StripOffset */ case 513: + case 61447: m_Tiff_IFD[l_ifd].offset = get4()+l_Base; if (!m_Tiff_IFD[l_ifd].bps) { *************** *** 5502,5507 **** --- 5505,5514 ---- case 279: /* StripByteCounts */ case 514: + case 61448: m_Tiff_IFD[l_ifd].bytes = get4(); break; + case 61454: + for (c=0; c<3; c++) ASSIGN(m_CameraMultipliers[(4-c)%3], getint(l_Type)); + break; case 305: case 11: /* Software */ jdlfgets (l_Software, 64, m_InputFile); *************** *** 5567,5571 **** break; case 29459: ! for (c=0; c < 4; c++) ASSIGN(m_CameraMultipliers[c ^ (c >> 1)], get2()); break; case 33405: /* Model2 */ --- 5574,5580 ---- break; case 29459: ! for (c=0; c < 4; c++) ASSIGN(m_CameraMultipliers[c], get2()); ! i = (m_CameraMultipliers[1] == 1024 && m_CameraMultipliers[2] == 1024) << 1; ! SWAP (m_CameraMultipliers[i],m_CameraMultipliers[i+1]) break; case 33405: /* Model2 */ *************** *** 5724,5733 **** linear_table (l_Length); break; case 50714: /* BlackLevel */ ! case 50715: /* BlackLevelDeltaH */ ! case 50716: /* BlackLevelDeltaV */ ! for (l_dblack=i=0; (unsigned) i < l_Length; i++) ! l_dblack += getreal(l_Type); ! m_BlackLevel = (unsigned) (m_BlackLevel+l_dblack/l_Length + 0.5); break; case 50717: /* WhiteLevel */ --- 5733,5752 ---- linear_table (l_Length); break; + case 50713: /* BlackLevelRepeatDim */ + blrr = get2(); + blrc = get2(); + break; case 50714: /* BlackLevel */ ! m_BlackLevel = getreal(l_Type); ! if (!m_Filters || !~m_Filters) break; ! dblack[0] = m_BlackLevel; ! dblack[1] = (blrc == 2) ? getreal(l_Type):dblack[0]; ! dblack[2] = (blrr == 2) ? getreal(l_Type):dblack[0]; ! dblack[3] = (blrc == 2 && blrr == 2) ? getreal(l_Type):dblack[1]; ! if (m_Colors == 3) ! m_Filters |= ((m_Filters >> 2 & 0x22222222) | ! (m_Filters << 2 & 0x88888888)) & m_Filters << 1; ! for (c=0;c<4;c++) m_CBlackLevel[m_Filters >> (c << 1) & 3] = dblack[c]; ! m_BlackLevel = 0; break; case 50717: /* WhiteLevel */ *************** *** 5902,5908 **** if (m_Tiff_IFD[l_Raw].bytes * 5 == m_RawWidth * m_RawHeight * 8) { m_Tiff_bps = 12; - m_WhiteLevel = 0xffff; m_LoadRawFunction = &CLASS packed_load_raw; ! m_Load_Flags = 273; } break; --- 5921,5926 ---- if (m_Tiff_IFD[l_Raw].bytes * 5 == m_RawWidth * m_RawHeight * 8) { m_Tiff_bps = 12; m_LoadRawFunction = &CLASS packed_load_raw; ! m_Load_Flags = 17; } break; *************** *** 5926,5933 **** break; } ! m_Load_Flags = 79; case 32769: m_Load_Flags++; break; case 32773: m_LoadRawFunction = &CLASS packed_load_raw; --- 5944,5952 ---- break; } ! m_Load_Flags = 15; case 32769: m_Load_Flags++; break; + case 32770: case 32773: m_LoadRawFunction = &CLASS packed_load_raw; *************** *** 6372,6375 **** --- 6391,6399 ---- fseek (m_InputFile, save+len, SEEK_SET); } + if (!m_RawHeight) { + m_Filters = 0x16161616; + m_LoadRawFunction = &CLASS packed_load_raw; + m_Load_Flags = 24; + } m_Height <<= fuji_layout; m_Width >>= fuji_layout; *************** *** 6715,6718 **** --- 6739,6744 ---- char* l_CharPointer; unsigned l_HLen; + int l_FLen; + int l_ZeroFileSize=1; unsigned l_FileSize; unsigned l_IsCanon; *************** *** 6742,6746 **** --- 6768,6774 ---- { 1920000, "AVT", "F-201C" ,0 }, { 5067304, "AVT", "F-510C" ,0 }, + { 5067316, "AVT", "F-510C" ,0 }, { 10134608, "AVT", "F-510C" ,0 }, + { 10134620, "AVT", "F-510C" ,0 }, { 16157136, "AVT", "F-810C" ,0 }, { 1409024, "Sony", "XCD-SX910CR" ,0 }, *************** *** 6786,6789 **** --- 6814,6818 ---- { 10834368, "CASIO", "EX-Z750" ,1 }, { 12310144, "CASIO", "EX-Z850" ,1 }, + { 15499264, "CASIO", "EX-Z1050" ,1 }, { 7426656, "CASIO", "EX-P505" ,1 }, { 9313536, "CASIO", "EX-P600" ,1 }, *************** *** 6796,6803 **** { 16098048, "SAMSUNG", "S85" ,1 }, { 16215552, "SAMSUNG", "S85" ,1 }, { 12582980, "Sinar", "" ,0 }, { 33292868, "Sinar", "" ,0 }, { 44390468, "Sinar", "" ,0 } }; - static const char *l_Corporation[] = { "Canon", "NIKON", "EPSON", "KODAK", "Kodak", "OLYMPUS", "PENTAX", --- 6825,6833 ---- { 16098048, "SAMSUNG", "S85" ,1 }, { 16215552, "SAMSUNG", "S85" ,1 }, + { 20487168, "SAMSUNG", "WB550" ,1 }, + { 24000000, "SAMSUNG", "WB550" ,1 }, { 12582980, "Sinar", "" ,0 }, { 33292868, "Sinar", "" ,0 }, { 44390468, "Sinar", "" ,0 } }; static const char *l_Corporation[] = { "Canon", "NIKON", "EPSON", "KODAK", "Kodak", "OLYMPUS", "PENTAX", *************** *** 6815,6819 **** jdlfread (l_Head, 1, 32, m_InputFile); fseek (m_InputFile, 0, SEEK_END); ! l_FileSize = ftell(m_InputFile); if ((l_CharPointer = (char *) memmem (l_Head, 32, "MMMM", 4)) || --- 6845,6849 ---- jdlfread (l_Head, 1, 32, m_InputFile); fseek (m_InputFile, 0, SEEK_END); ! l_FLen = l_FileSize = ftell(m_InputFile); if ((l_CharPointer = (char *) memmem (l_Head, 32, "MMMM", 4)) || *************** *** 6824,6828 **** if (!memcmp (l_Head+6,"HEAPCCDR",8)) { m_Data_Offset = l_HLen; ! parse_ciff (l_HLen, l_FileSize - l_HLen); } else { parse_tiff(0); --- 6854,6858 ---- if (!memcmp (l_Head+6,"HEAPCCDR",8)) { m_Data_Offset = l_HLen; ! parse_ciff (l_HLen, l_FLen - l_HLen); } else { parse_tiff(0); *************** *** 6865,6869 **** } fseek (m_InputFile, 100, SEEK_SET); ! m_Data_Offset = get4(); parse_tiff (m_ThumbOffset+12); } else if (!memcmp (l_Head,"RIFF",4)) { --- 6895,6899 ---- } fseek (m_InputFile, 100, SEEK_SET); ! parse_tiff(m_Data_Offset = get4()); parse_tiff (m_ThumbOffset+12); } else if (!memcmp (l_Head,"RIFF",4)) { *************** *** 6892,6896 **** parse_cine(); else { ! for (i=0; i < sizeof l_Table / sizeof *l_Table; i++) if (l_FileSize == (unsigned) l_Table[i].fsize) { strcpy (m_CameraMake, l_Table[i].make ); --- 6922,6926 ---- parse_cine(); else { ! for (l_ZeroFileSize=i=0; i < sizeof l_Table / sizeof *l_Table; i++) if (l_FileSize == (unsigned) l_Table[i].fsize) { strcpy (m_CameraMake, l_Table[i].make ); *************** *** 6901,6905 **** } ! if (m_CameraMake[0] == 0) parse_smal (0, l_FileSize); if (m_CameraMake[0] == 0) parse_jpeg (m_IsRaw = 0); --- 6931,6937 ---- } ! if (l_ZeroFileSize) l_FileSize = 0; ! ! if (m_CameraMake[0] == 0) parse_smal (0, l_FLen); if (m_CameraMake[0] == 0) parse_jpeg (m_IsRaw = 0); *************** *** 7235,7238 **** --- 7267,7277 ---- m_RawWidth *= 4; m_Width = 4916; + } else if (l_IsCanon && m_RawWidth == 1336) { + m_TopMargin = 51; + m_LeftMargin = 142; + m_RawWidth = m_Width *= 4; + if (unique_id == 0x80000270) + adobe_coeff ("Canon","EOS 550D"); + goto canon_cr2; } else if (l_IsCanon && m_RawWidth == 1340) { m_TopMargin = 51; *************** *** 7366,7371 **** } if (m_CameraMake[0] == 'O') { ! int li = find_green (12, 32, 0, l_FileSize/2); ! int lc = find_green (12, 32, 0, 3096); if (abs(li) < abs(lc)) { SWAP(li,lc); --- 7405,7410 ---- } if (m_CameraMake[0] == 'O') { ! int li = find_green (12, 32, 1188864, 3576832); ! int lc = find_green (12, 32, 2383920, 2387016); if (abs(li) < abs(lc)) { SWAP(li,lc); *************** *** 7406,7410 **** m_Width = 2880; m_Flip = 6; ! } else m_WhiteLevel = 0x3e00; if (m_IsRaw == 2 && m_UserSetting_ShotSelect) --- 7445,7449 ---- m_Width = 2880; m_Flip = 6; ! } else if (m_LoadRawFunction != &CLASS packed_load_raw) m_WhiteLevel = 0x3e00; if (m_IsRaw == 2 && m_UserSetting_ShotSelect) *************** *** 7517,7520 **** --- 7556,7575 ---- m_LoadRawFunction = &CLASS unpacked_load_raw; m_WhiteLevel = 0xffff; + } else if (!strcmp(m_CameraModel,"NX10")) { + m_Height -= m_TopMargin = 4; + m_Width -= 2 * (m_LeftMargin = 8); + } else if (l_FileSize == 20487168) { + m_Height = 2808; + m_Width = 3648; + goto wb550; + } else if (l_FileSize == 24000000) { + m_Height = 3000; + m_Width = 4000; + wb550: + strcpy (m_CameraModel, "WB550"); + m_ByteOrder = 0x4d4d; + m_LoadRawFunction = &CLASS unpacked_load_raw; + m_Load_Flags = 6; + m_WhiteLevel = 0x3df; } else if (!strcmp(m_CameraModel,"STV680 VGA")) { m_Height = 484; *************** *** 7548,7551 **** --- 7603,7607 ---- m_LoadRawFunction = l_FileSize < 7500000 ? &CLASS eight_bit_load_raw : &CLASS unpacked_load_raw; + m_Data_Offset = l_FileSize - m_Width*m_Height*(l_FileSize >> 22); m_WhiteLevel = 0xfff0; } else if (!strcmp(m_CameraModel,"F-810C")) { *************** *** 7657,7664 **** } } else if (!strcmp(m_CameraMake,"LEICA") || !strcmp(m_CameraMake,"Panasonic")) { ! m_WhiteLevel = 0xfff0; ! if ((l_FileSize-m_Data_Offset) / (m_Width*8/7) == m_Height) m_LoadRawFunction = &CLASS panasonic_load_raw; ! if (!m_LoadRawFunction) m_LoadRawFunction = &CLASS unpacked_load_raw; switch (m_Width) { case 2568: --- 7713,7722 ---- } } else if (!strcmp(m_CameraMake,"LEICA") || !strcmp(m_CameraMake,"Panasonic")) { ! if ((l_FLen - m_Data_Offset) / (m_Width*8/7) == m_Height) m_LoadRawFunction = &CLASS panasonic_load_raw; ! if (!m_LoadRawFunction) { ! m_LoadRawFunction = &CLASS unpacked_load_raw; ! m_Load_Flags = 4; ! } switch (m_Width) { case 2568: *************** *** 7680,7683 **** --- 7738,7742 ---- case 3177: m_Width -= 10; + m_Load_Flags = 2; m_Filters = 0x49494949; m_ZeroIsBad = 1; *************** *** 7690,7694 **** m_Width += 43; m_LeftMargin = -6; ! m_WhiteLevel = 0xf7f0; case 3370: m_Width -= 82; --- 7749,7753 ---- m_Width += 43; m_LeftMargin = -6; ! m_WhiteLevel = 0xf7f; case 3370: m_Width -= 82; *************** *** 7726,7729 **** --- 7785,7789 ---- m_Width -= 22; m_LeftMargin = 6; + m_Load_Flags = 2; m_ZeroIsBad = 1; adobe_coeff ("Panasonic","DMC-LX1"); break; *************** *** 7772,7794 **** m_Filters = exif_cfa; if (m_Width == 4100) m_Width -= 4; ! if (m_LoadRawFunction == &CLASS olympus_load_raw) { ! m_Tiff_bps = 12; ! m_BlackLevel >>= 4; ! } else if (!strcmp(m_CameraModel,"E-10") || ! !strncmp(m_CameraModel,"E-20",4)) { ! m_BlackLevel <<= 2; ! } else if (!strcmp(m_CameraModel,"E-300") || ! !strcmp(m_CameraModel,"E-500")) { m_Width -= 20; if (m_LoadRawFunction == &CLASS unpacked_load_raw) { ! m_WhiteLevel = 0xfc30; ! m_BlackLevel = 0; } } else if (!strcmp(m_CameraModel,"E-330")) { m_Width -= 30; if (m_LoadRawFunction == &CLASS unpacked_load_raw) ! m_WhiteLevel = 0xf790; } else if (!strcmp(m_CameraModel,"SP550UZ")) { ! m_ThumbLength = l_FileSize - (m_ThumbOffset = 0xa39800); m_ThumbHeight = 480; m_ThumbWidth = 640; --- 7832,7851 ---- m_Filters = exif_cfa; if (m_Width == 4100) m_Width -= 4; ! if (m_LoadRawFunction == &CLASS unpacked_load_raw) ! m_Load_Flags = 4; ! m_Tiff_bps = 12; ! if (!strcmp(m_CameraModel,"E-300") || ! !strcmp(m_CameraModel,"E-500")) { m_Width -= 20; if (m_LoadRawFunction == &CLASS unpacked_load_raw) { ! m_WhiteLevel = 0xfc3; ! memset (m_CBlackLevel, 0, sizeof m_CBlackLevel); } } else if (!strcmp(m_CameraModel,"E-330")) { m_Width -= 30; if (m_LoadRawFunction == &CLASS unpacked_load_raw) ! m_WhiteLevel = 0xf79; } else if (!strcmp(m_CameraModel,"SP550UZ")) { ! m_ThumbLength = l_FLen - (m_ThumbOffset = 0xa39800); m_ThumbHeight = 480; m_ThumbWidth = 640; *************** *** 7818,7823 **** m_ByteOrder = 0x4d4d; } else if (!strcmp(m_CameraModel,"DSLR-A100")) { ! m_Height--; ! m_Width = ++m_RawWidth; m_Filters = 0x61616161; } else if (!strcmp(m_CameraModel,"DSLR-A350")) { --- 7875,7885 ---- m_ByteOrder = 0x4d4d; } else if (!strcmp(m_CameraModel,"DSLR-A100")) { ! if (m_Width == 3880) { ! m_Height--; ! m_Width = ++m_RawWidth; ! } else { ! m_ByteOrder = 0x4d4d; ! m_Load_Flags = 2; ! } m_Filters = 0x61616161; } else if (!strcmp(m_CameraModel,"DSLR-A350")) { *************** *** 7910,7914 **** if (!strncmp(m_CameraModel,"DC2",3)) { m_Height = 242; ! if (l_FileSize < 100000) { m_RawWidth = 256; m_Width = 249; m_PixelAspect = (4.0*m_Height) / (3.0*m_Width); --- 7972,7976 ---- if (!strncmp(m_CameraModel,"DC2",3)) { m_Height = 242; ! if (l_FLen < 100000) { m_RawWidth = 256; m_Width = 249; m_PixelAspect = (4.0*m_Height) / (3.0*m_Width); *************** *** 8070,8073 **** --- 8132,8140 ---- m_RawWidth = 4928; m_WhiteLevel = 0xfff; + } else if (!strcmp(m_CameraModel,"EX-Z1050")) { + m_Height = 2752; + m_Width = 3672; + m_RawWidth = 5632; + m_WhiteLevel = 0xffc; } else if (!strcmp(m_CameraModel,"EX-P505")) { m_Height = 1928; *************** *** 8112,8121 **** if (!m_RawWidth ) m_RawWidth = m_Width; if (m_Filters && m_Colors == 3) ! for (i=0; i < 32; i+=4) { ! if ((m_Filters >> i & 15) == 9) ! m_Filters |= 2 << i; ! if ((m_Filters >> i & 15) == 6) ! m_Filters |= 8 << i; ! } notraw: if (m_Flip == -1) m_Flip = m_Tiff_Flip; --- 8179,8185 ---- if (!m_RawWidth ) m_RawWidth = m_Width; if (m_Filters && m_Colors == 3) ! m_Filters |= ((m_Filters >> 2 & 0x22222222) | ! (m_Filters << 2 & 0x88888888)) & m_Filters << 1; ! notraw: if (m_Flip == -1) m_Flip = m_Tiff_Flip; *************** *** 8527,8530 **** --- 8591,8595 ---- TRACEKEYVALS("LeftMargin","%d",m_LeftMargin); TRACEKEYVALS("BlackLevel","%d",m_BlackLevel); + for (short c=0; c<4; c++) TRACEKEYVALS("CBlackLevel","%d",m_CBlackLevel[c]); // OK for second entry. *************** *** 8648,8651 **** --- 8713,8717 ---- m_Filters_AfterPhase1 = m_Filters; m_BlackLevel_AfterPhase1 = m_BlackLevel; + for (short c=0;c<4;c++) m_CBlackLevel_AfterPhase1[c] = m_CBlackLevel[c]; m_WhiteLevel_AfterPhase1 = m_WhiteLevel; m_Width_AfterPhase1 = m_Width; *************** *** 8685,8695 **** --- 8751,8779 ---- m_Filters = m_Filters_AfterPhase1; m_BlackLevel = m_BlackLevel_AfterPhase1; + for (short c=0;c<4;c++) m_CBlackLevel[c] = m_CBlackLevel_AfterPhase1[c]; m_WhiteLevel = m_WhiteLevel_AfterPhase1; } + // Split such that the common term of m_CBlackLevel (the minimum) + // is added to m_BlackLevel. m_CBlackLevel then contains the delta + // per channel, with one channel on zero (i.e. the minimum one) + // (not sure why, cause jdlScaleColors adds it again ...) + // (but at least m_BLackLevel has now always some meaning) + unsigned MinCBlackLevel = m_CBlackLevel[3]; + for (short c=0;c<3;c++) { + if (MinCBlackLevel > m_CBlackLevel[c]) { + MinCBlackLevel = m_CBlackLevel[c]; + } + } + for (short c=0;c<4;c++) { + m_CBlackLevel[c] -= MinCBlackLevel; + } + m_BlackLevel += MinCBlackLevel; + if (m_UserSetting_BlackPoint >= 0) m_BlackLevel = m_UserSetting_BlackPoint; if (m_UserSetting_Saturation > 0) m_WhiteLevel = m_UserSetting_Saturation; TRACEKEYVALS("BlackLevel","%d",m_BlackLevel); + for (short c=0; c<4; c++) TRACEKEYVALS("CBlackLevel","%d",m_CBlackLevel[c]); TRACEKEYVALS("WhiteLevel","%d",m_WhiteLevel); TRACEKEYVALS("Colors","%d",m_Colors); *************** *** 8850,8853 **** --- 8934,8938 ---- TRACEKEYVALS("BlackLevel","%d",m_BlackLevel); + for (short c=0; c<4; c++) TRACEKEYVALS("CBlackLevel","%d",m_CBlackLevel[c]); TRACEKEYVALS("WhiteLevel","%d",m_WhiteLevel); TRACEKEYVALS("Colors","%d",m_Colors); *************** *** 9036,9040 **** int Scale=1; ! int lev, hpass, lpass, wlast; TRACEKEYVALS("BlackLevel","%d",m_BlackLevel); --- 9121,9125 ---- int Scale=1; ! int lev, hpass, lpass, wlast, blk[2]; TRACEKEYVALS("BlackLevel","%d",m_BlackLevel); *************** *** 9044,9050 **** --- 9129,9137 ---- m_WhiteLevel <<= --Scale; m_BlackLevel <<= Scale; + for (short c=0; c<4; c++) m_CBlackLevel[c] <<= Scale; TRACEKEYVALS("Scale(denoise)","%d",Scale); TRACEKEYVALS("BlackLevel","%d",m_BlackLevel); + for (short c=0; c<4; c++) TRACEKEYVALS("CBlackLevel","%d",m_CBlackLevel[c]); TRACEKEYVALS("WhiteLevel","%d",m_WhiteLevel); *************** *** 9108,9111 **** --- 9195,9199 ---- VALUE(m_PreMultipliers[FC(Row+1,0) | 1]) / VALUE(m_PreMultipliers[FC(Row,0) | 1]); + blk[Row] = m_CBlackLevel[FC(Row,0) | 1]; } uint16_t* Window[4]; *************** *** 9135,9141 **** for (uint16_t Col = (FC(Row,0) & 1)+1; Col < m_Width-1; Col+=2) { Average = ( Window[0][Col-1] + Window[0][Col+1] + ! Window[2][Col-1] + Window[2][Col+1] - m_BlackLevel*4 ) * Multiplier[Row & 1] ! + (Window[1][Col] - m_BlackLevel) * 0.5 + m_BlackLevel; Average = Average < 0 ? 0 : sqrt(Average); Difference = sqrt(BAYER(Row,Col)) - Average; --- 9223,9229 ---- for (uint16_t Col = (FC(Row,0) & 1)+1; Col < m_Width-1; Col+=2) { Average = ( Window[0][Col-1] + Window[0][Col+1] + ! Window[2][Col-1] + Window[2][Col+1] - blk[~Row & 1]*4 ) * Multiplier[Row & 1] ! + (Window[1][Col] +blk[Row & 1]) * 0.5 ; Average = Average < 0 ? 0 : sqrt(Average); Difference = sqrt(BAYER(Row,Col)) - Average; Index: jdlExposure.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlExposure.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** jdlExposure.cpp 26 May 2010 19:08:46 -0000 1.3 --- jdlExposure.cpp 1 Jun 2010 20:38:57 -0000 1.4 *************** *** 48,55 **** // // // FindAlpha (helper for ExposureFunction) // ! ////////////////////////////////////////////////////////////////////////////// double FindAlpha(double Exposure,double L) { --- 48,56 ---- // + //////////////////////////////////////////////////////////////////////////////// // // FindAlpha (helper for ExposureFunction) // ! //////////////////////////////////////////////////////////////////////////////// double FindAlpha(double Exposure,double L) { *************** *** 97,99 **** } ! /////////////////////////////////////////////////////////////////////////////// --- 98,100 ---- } ! //////////////////////////////////////////////////////////////////////////////// |
|
From: Jos De L. <jd...@us...> - 2010-06-01 20:39:05
|
Update of /cvsroot/jdlraw/jdlRaw In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv6145 Modified Files: CHANGELOG Log Message: *) Synced with latest dcraw (V9.01) Index: CHANGELOG =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/CHANGELOG,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** CHANGELOG 26 May 2010 19:08:46 -0000 1.52 --- CHANGELOG 1 Jun 2010 20:38:57 -0000 1.53 *************** *** 1,5 **** ! Latest change : 20100526_2100 (manipulate me to force CVS log) $Log$ Revision 1.52 2010/05/26 19:08:46 jdla --- 1,9 ---- ! Latest change : 20100601_2230 (manipulate me to force CVS log) $Log$ + Revision 1.53 2010/06/01 20:38:57 jdla + + *) Synced with latest dcraw (V9.01) + Revision 1.52 2010/05/26 19:08:46 jdla |
|
From: Jos De L. <jd...@us...> - 2010-05-26 20:26:16
|
Update of /cvsroot/jdlraw/jdlRaw In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv27710 Modified Files: CHANGELOG TODO Log Message: *) Changed the RGB exposure function (film curve) such that one can define now till what level it is linear before falling of. This showed useful in some photographs with much hightones that become otherwise dull by simple filmcurve application. Now this can be resolved by using clipping modes or a filmcurve starting for instance at 90%. Index: TODO =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/TODO,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** TODO 27 Apr 2010 17:30:35 -0000 1.33 --- TODO 26 May 2010 19:08:46 -0000 1.34 *************** *** 10,13 **** --- 10,18 ---- with fourcolor (ppg,vnd). Reflect that in gui. + - Go once more through all OMP. I believe there are still cases + where a read-while-writing situation is possible ! + For instance during interpolation. Working on a copy is a possibility. + Besides locking that is. + - Further OpenMP stuff and loop-to-detail restriction Index: CHANGELOG =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/CHANGELOG,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** CHANGELOG 2 May 2010 10:14:01 -0000 1.51 --- CHANGELOG 26 May 2010 19:08:46 -0000 1.52 *************** *** 1,5 **** ! Latest change : 20100502_1200 (manipulate me to force CVS log) $Log$ Revision 1.51 2010/05/02 10:14:01 jdla --- 1,13 ---- ! Latest change : 20100526_2100 (manipulate me to force CVS log) $Log$ + Revision 1.52 2010/05/26 19:08:46 jdla + + *) Changed the RGB exposure function (film curve) such that one can define + now till what level it is linear before falling of. + This showed useful in some photographs with much hightones that become + otherwise dull by simple filmcurve application. Now this can be resolved + by using clipping modes or a filmcurve starting for instance at 90%. + Revision 1.51 2010/05/02 10:14:01 jdla |
|
From: Jos De L. <jd...@us...> - 2010-05-26 19:08:54
|
Update of /cvsroot/jdlraw/jdlRaw/Sources In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv27710/Sources Modified Files: jdlDcRaw.cpp jdlExposure.cpp jdlTool_RGB_Exposure.cpp jdlTool_RGB_Exposure.i Log Message: *) Changed the RGB exposure function (film curve) such that one can define now till what level it is linear before falling of. This showed useful in some photographs with much hightones that become otherwise dull by simple filmcurve application. Now this can be resolved by using clipping modes or a filmcurve starting for instance at 90%. Index: jdlTool_RGB_Exposure.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlTool_RGB_Exposure.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** jdlTool_RGB_Exposure.cpp 13 Apr 2010 19:49:11 -0000 1.16 --- jdlTool_RGB_Exposure.cpp 26 May 2010 19:08:46 -0000 1.17 *************** *** 195,198 **** --- 195,201 ---- jdlRaw->m_Settings->GetDouble(QString("RGB_Exposure")+Instance); + double RelativeL = + jdlRaw->m_Settings->GetDouble(QString("RGB_ExposureRelativeL")+Instance); + switch (ExposureMode) { case jdlExposureMode_Manual : *************** *** 268,272 **** m_ExposureCurve->SetCurveFromFunction(ExposureFunction, ExposureFactor, ! 0); WorkImage->ToRGB(WorkColor); WorkImage->ApplyCurve(m_ExposureCurve,7); --- 271,275 ---- m_ExposureCurve->SetCurveFromFunction(ExposureFunction, ExposureFactor, ! RelativeL/ExposureFactor); WorkImage->ToRGB(WorkColor); WorkImage->ApplyCurve(m_ExposureCurve,7); *************** *** 364,367 **** --- 367,376 ---- VLayout->addWidget(ExposureClipModeWidget); + QWidget* RelativeLWidget = new QWidget(m_ToolWidget); + RelativeLWidget->setObjectName( + QString("RGB_ExposureRelativeL_%1Widget").arg(m_Instance)); + + VLayout->addWidget(RelativeLWidget); + QWidget* WhiteFractionWidget = new QWidget(m_ToolWidget); WhiteFractionWidget->setObjectName( *************** *** 452,455 **** --- 461,470 ---- emit(RequestInput(jdlRequestMode_IfNeeded)); } else if (Sender->objectName() == + QString("RGB_ExposureRelativeL")+Instance) { + short ExposureClipMode = jdlRaw->m_Settings->GetInt(QString("RGB_ExposureClipMode")+Instance); + if (ExposureClipMode == jdlExposureClipMode_Curve) { + emit(RequestInput(jdlRequestMode_IfNeeded)); + } + } else if (Sender->objectName() == QString("RGB_ExposureClipMode")+Instance) { emit(RequestInput(jdlRequestMode_IfNeeded)); Index: jdlTool_RGB_Exposure.i =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlTool_RGB_Exposure.i,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** jdlTool_RGB_Exposure.i 27 Feb 2010 19:02:42 -0000 1.3 --- jdlTool_RGB_Exposure.i 26 May 2010 19:08:46 -0000 1.4 *************** *** 58,61 **** --- 58,75 ---- {"RGB_Exposure", + "RGB_ExposureRelativeL", + jdlGT_InputSlider, + 2, + 1, + 1, + 0.0, + 0.0, + 0.99, + 0.01, + 2, + _("FilmCurve Linearity"), + _("Till where filmcurve is linear (L/E,L)")}, + + {"RGB_Exposure", "RGB_ExposureWhiteFraction", jdlGT_InputSlider, Index: jdlDcRaw.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlDcRaw.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** jdlDcRaw.cpp 2 May 2010 10:14:02 -0000 1.18 --- jdlDcRaw.cpp 26 May 2010 19:08:46 -0000 1.19 *************** *** 3681,3684 **** --- 3681,3691 ---- } + if (m_UserSetting_CameraWb) { + TRACEKEYVALS("CamMult[0]","%f",VALUE(m_CameraMultipliers[0])); + TRACEKEYVALS("CamMult[1]","%f",VALUE(m_CameraMultipliers[1])); + TRACEKEYVALS("CamMult[2]","%f",VALUE(m_CameraMultipliers[2])); + TRACEKEYVALS("CamMult[3]","%f",VALUE(m_CameraMultipliers[3])); + } + if (m_UserSetting_CameraWb && VALUE(m_CameraMultipliers[0]) != -1) { memset (sum, 0, sizeof sum); *************** *** 4769,4774 **** homo = (char (*)[TS][TS]) (buffer + 24*TS*TS); ! const int chunk = m_Height/16; // XXX JDLA extension ! #pragma omp for schedule(dynamic,chunk) for (top=2; top < m_Height-5; top += TS-6) { --- 4776,4780 ---- homo = (char (*)[TS][TS]) (buffer + 24*TS*TS); ! #pragma omp for schedule(dynamic,m_Height/16) for (top=2; top < m_Height-5; top += TS-6) { Index: jdlExposure.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlExposure.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** jdlExposure.cpp 27 Feb 2010 19:02:42 -0000 1.2 --- jdlExposure.cpp 26 May 2010 19:08:46 -0000 1.3 *************** *** 26,50 **** #include <assert.h> #include <math.h> double Alpha; double ExposureForWhichAlphaIsCalculated = -1; - //////////////////////////////////////////////////////////////////////////////// // // FindAlpha (helper for ExposureFunction) - // such that f(x)=(1-exp(-Alpha*x)/(1-exp(-Alpha)) - // f(x) is then foto curve for which : - // f(0) = 0 - // f(1) = 1 - // f'(0)= Exposure // ! //////////////////////////////////////////////////////////////////////////////// ! double FindAlpha(double Exposure) { assert(Exposure > 1.0); double Alpha; ! double fDerivedAt0; if (Exposure<2) { Alpha=(Exposure-1)/2; --- 26,62 ---- #include <assert.h> #include <math.h> + #include <jdlDefines.h> double Alpha; double ExposureForWhichAlphaIsCalculated = -1; + double LForWhichAlphaIsCalculated = -1; + + // + // General + // + // The here used 'exposure function' is existing of + // an exponentional end on a linear beginning. + // + // E*r for r < L + // + // A+B*exp(-Alpha*(r-L)/(1-L)) for r > L + // with A = (1-L*E*exp(-Alpha))/(1-exp(-Alpha)) + // and B = ((L*E-1)/(1-exp(-Alpha)) + // (this makes the exposurefunction E*r at L, and 1 at 1 , thus continous) + // Alpha is chosen such that f'(r=L) = E (so also continous first derivative) + // Therefore Alpha is solution of Alpha/((1-L)*(1-exp(-Alpha)) = E + // // // FindAlpha (helper for ExposureFunction) // ! ////////////////////////////////////////////////////////////////////////////// ! double FindAlpha(double Exposure,double L) { assert(Exposure > 1.0); double Alpha; ! double fDerivedAtL; if (Exposure<2) { Alpha=(Exposure-1)/2; *************** *** 52,59 **** Alpha=Exposure; } ! fDerivedAt0 = Alpha/(1-exp(-Alpha)); ! while (fabs(fDerivedAt0-Exposure)>0.001) { ! Alpha = Alpha + (Exposure-fDerivedAt0); ! fDerivedAt0 = Alpha/(1-exp(-Alpha)); } return Alpha; --- 64,71 ---- Alpha=Exposure; } ! fDerivedAtL = (Alpha/(1-L))/(1-exp(-Alpha)); ! while (fabs(fDerivedAtL-Exposure)>0.001) { ! Alpha = Alpha + (Exposure-fDerivedAtL); ! fDerivedAtL = (Alpha/(1-L))/(1-exp(-Alpha)); } return Alpha; *************** *** 67,76 **** //////////////////////////////////////////////////////////////////////////////// ! ! double ExposureFunction(double r,double Exposure,double) { ! if (Exposure != ExposureForWhichAlphaIsCalculated) { ! Alpha = FindAlpha(Exposure); } ! return (1-exp(-Alpha*r))/(1-exp(-Alpha)); } --- 79,98 ---- //////////////////////////////////////////////////////////////////////////////// ! double ExposureFunction(double r,double Exposure,double L) { ! if (Exposure != ExposureForWhichAlphaIsCalculated || ! L != LForWhichAlphaIsCalculated) { ! Alpha = FindAlpha(Exposure,L); ! ExposureForWhichAlphaIsCalculated = Exposure; ! LForWhichAlphaIsCalculated = L; } ! double Tmp; ! if (r<L) { ! Tmp = MIN(r*Exposure,1.0); // Linear part. ! } else { ! Tmp = 1-L*Exposure*exp(-Alpha); ! Tmp += (L*Exposure-1)*exp(-Alpha*(r-L)/(1-L)); ! Tmp /= 1-exp(-Alpha); ! } ! return Tmp; } |
|
From: Jos De L. <jd...@us...> - 2010-05-02 10:14:10
|
Update of /cvsroot/jdlraw/jdlRaw In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28414 Modified Files: CHANGELOG Log Message: *) OMP on/off by user now on all of the interpolation algorithms. Some DCB code cleanup. Index: CHANGELOG =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/CHANGELOG,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** CHANGELOG 1 May 2010 07:38:21 -0000 1.50 --- CHANGELOG 2 May 2010 10:14:01 -0000 1.51 *************** *** 1,5 **** ! Latest change : 20100501_0900 (manipulate me to force CVS log) $Log$ Revision 1.50 2010/05/01 07:38:21 jdla --- 1,10 ---- ! Latest change : 20100502_1200 (manipulate me to force CVS log) $Log$ + Revision 1.51 2010/05/02 10:14:01 jdla + + *) OMP on/off by user now on all of the interpolation algorithms. + Some DCB code cleanup. + Revision 1.50 2010/05/01 07:38:21 jdla |
|
From: Jos De L. <jd...@us...> - 2010-05-02 10:14:10
|
Update of /cvsroot/jdlraw/jdlRaw/Sources In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28414/Sources Modified Files: jdlDcRaw.cpp jdlDcRaw.h jdlDcbDemosaicing.i Log Message: *) OMP on/off by user now on all of the interpolation algorithms. Some DCB code cleanup. Index: jdlDcRaw.h =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlDcRaw.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** jdlDcRaw.h 1 May 2010 07:38:25 -0000 1.11 --- jdlDcRaw.h 2 May 2010 10:14:02 -0000 1.12 *************** *** 699,703 **** void rgb_to_lch(double (*)[3]); void lch_to_rgb(double (*)[3]); - void fbdd_green2(); void fbdd_correction(); void fbdd_correction2(double (*)[3]); --- 699,702 ---- Index: jdlDcRaw.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlDcRaw.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** jdlDcRaw.cpp 1 May 2010 07:38:24 -0000 1.17 --- jdlDcRaw.cpp 2 May 2010 10:14:02 -0000 1.18 *************** *** 4467,4475 **** } - // OMP on/off via user - #ifdef _OPENMP - omp_set_num_threads(m_UserSetting_InterpolationOMP ? omp_get_max_threads():1); - #endif - // Some helping variables that are needed in OMP case. // But they are not sitting in the way for the non OMP case. --- 4467,4470 ---- *************** *** 8719,8725 **** TRACEKEYVALS("Colors","%d",m_Colors); PreInterpolate(); ! if (m_Stop) return 0; TRACEKEYVALS("Colors","%d",m_Colors); --- 8714,8731 ---- TRACEKEYVALS("Colors","%d",m_Colors); + // OMP on/off via user + #ifdef _OPENMP + omp_set_num_threads(m_UserSetting_InterpolationOMP ? omp_get_max_threads():1); + #endif + PreInterpolate(); ! if (m_Stop) { ! // 'Restore' OMP ! #ifdef _OPENMP ! omp_set_num_threads(omp_get_max_threads()); ! #endif ! return 0; ! } TRACEKEYVALS("Colors","%d",m_Colors); *************** *** 8749,8752 **** --- 8755,8763 ---- } + // 'Restore' OMP + #ifdef _OPENMP + omp_set_num_threads(omp_get_max_threads()); + #endif + if (m_Stop) return 0; Index: jdlDcbDemosaicing.i =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlDcbDemosaicing.i,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** jdlDcbDemosaicing.i 27 Apr 2010 17:30:35 -0000 1.2 --- jdlDcbDemosaicing.i 2 May 2010 10:14:02 -0000 1.3 *************** *** 1183,1280 **** } - // fast green interpolation - void CLASS fbdd_green2() { - - const uint16_t c_DetailBorder = 6; - - #ifdef DCB_WORK_ON_COPY - const uint32_t Size = m_Width*m_Height; - // We need to work on a copy to avoid processing order dependency. - uint16_t (*TmpImage)[4]; - TmpImage = (uint16_t (*)[4]) CALLOC(Size,sizeof *TmpImage); - merror(TmpImage, __PRETTY_FUNCTION__); - memcpy(TmpImage,m_Image,Size*sizeof *m_Image); - #endif - - // We allocate with dynamic schedule as the "Detail" view can - // stop very early many of the rows/cols. So the chunks are - // very inequal in workload. - // The chunk size is introduced as to avoid too small fractions. - #ifdef DCB_ENABLE_OMP - #pragma omp parallel for default(shared) schedule(dynamic,m_Height/16) - #endif - for (uint16_t Row=4; Row < m_Height-4; Row++) { - - if (m_Stop) { - // OpenMP cannot exit, but continue will go fast now :) - continue; - } - - if (m_UserSetting_Detail && - (Row + c_DetailBorder < m_UserSetting_DetailRowStart || - Row > m_UserSetting_DetailRowEnd + c_DetailBorder) ) { - continue; - } - - uint32_t Offset = Row * m_Width; - - for (uint16_t Col=4; Col < m_Width-4; Col++) { - - if (m_UserSetting_Detail && - (Col + c_DetailBorder < m_UserSetting_DetailColStart || - Col > m_UserSetting_DetailColEnd + c_DetailBorder) ) { - continue; - } - - uint32_t Idx = Offset + Col; - - short c = fc(Row,Col); - if(c != 1) { - int32_t current = m_Image[Idx][c] - (m_Image[Idx+2*m_Width][c] + - m_Image[Idx-2*m_Width][c] + - m_Image[Idx-2][c] + - m_Image[Idx+2][c])/4; - - int32_t g2 = (m_Image[Idx+m_Width][1] + - m_Image[Idx-m_Width][1] + - m_Image[Idx-1][1] + - m_Image[Idx+1][1])/4; - int32_t g1 = (m_Image[Idx+3*m_Width][1] + - m_Image[Idx-3*m_Width][1] + - m_Image[Idx-3][1] + - m_Image[Idx+3][1])/4; - - #ifdef DCB_WORK_ON_COPY - TmpImage[Idx][1] = CLIP((g2+g1)/2.0 + current); - #else - m_Image[Idx][1] = CLIP((g2+g1)/2.0 + current); - #endif - - uint16_t min = MIN(m_Image[Idx-1][1], - MIN(m_Image[Idx+1][1], - MIN(m_Image[Idx-m_Width][1], - m_Image[Idx+m_Width][1]))); - - uint16_t max = MAX(m_Image[Idx-1][1], - MAX(m_Image[Idx+1][1], - MAX(m_Image[Idx-m_Width][1], - m_Image[Idx+m_Width][1]))); - - #ifdef DCB_WORK_ON_COPY - TmpImage[Idx][1] = ULIM(m_Image[Idx][1], max, min); - #else - m_Image[Idx][1] = ULIM(m_Image[Idx][1], max, min); - #endif - - } - } - } - #ifdef DCB_WORK_ON_COPY - // Copy back TmpImage - memcpy(m_Image,TmpImage,Size*sizeof *m_Image); - FREE(TmpImage); - #endif - } - // denoising using interpolated neighbours void CLASS fbdd_correction() { --- 1183,1186 ---- *************** *** 1784,1787 **** --- 1690,1695 ---- fbdd_correction(); } + + FREE(fImage3); } |
|
From: Jos De L. <jd...@us...> - 2010-05-01 07:38:33
|
Update of /cvsroot/jdlraw/jdlRaw/WebPage In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv20264/WebPage Modified Files: GompPatch.shtml Log Message: *) Added OMP to the VNG demosaicing. The end result is mathematically not *exactly* equal to the non-OMP case. However, visually, I can't see any relevant deviation. (by the way : the reason is clear : the omp case is conceived as if the photo is divided in N photos on which VNG is applied, this gives differences on the boundaries versus one photo with VNG. But I believe it is correct) I added a user option to switch on/off OMP. Index: GompPatch.shtml =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/WebPage/GompPatch.shtml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GompPatch.shtml 22 Jan 2010 20:58:45 -0000 1.1 --- GompPatch.shtml 1 May 2010 07:38:25 -0000 1.2 *************** *** 17,23 **** <ul> <li> <a href="team.c">team.c</a> ! (<a href="team_c.diff">diff</a>) </li> <li> <a href="libgomp.h">libgomp.h</a> ! (<a href="libgomp_h.diff">diff</a>)</li> </ul> --- 17,23 ---- <ul> <li> <a href="team.c">team.c</a> ! (<a href="team_c.patch">patch</a>) </li> <li> <a href="libgomp.h">libgomp.h</a> ! (<a href="libgomp_h.patch">patch</a>)</li> </ul> |
|
From: Jos De L. <jd...@us...> - 2010-05-01 07:38:33
|
Update of /cvsroot/jdlraw/jdlRaw/UI In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv20264/UI Modified Files: jdlMainWindow.ui Log Message: *) Added OMP to the VNG demosaicing. The end result is mathematically not *exactly* equal to the non-OMP case. However, visually, I can't see any relevant deviation. (by the way : the reason is clear : the omp case is conceived as if the photo is divided in N photos on which VNG is applied, this gives differences on the boundaries versus one photo with VNG. But I believe it is correct) I added a user option to switch on/off OMP. Index: jdlMainWindow.ui =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/UI/jdlMainWindow.ui,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** jdlMainWindow.ui 24 Apr 2010 17:30:51 -0000 1.8 --- jdlMainWindow.ui 1 May 2010 07:38:25 -0000 1.9 *************** *** 625,628 **** --- 625,631 ---- <widget class="QWidget" name="FourColorRGBWidget" native="true"/> </item> + <item> + <widget class="QWidget" name="InterpolationOMPWidget" native="true"/> + </item> </layout> </item> |
|
From: Jos De L. <jd...@us...> - 2010-05-01 07:38:32
|
Update of /cvsroot/jdlraw/jdlRaw/Sources In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv20264/Sources Modified Files: jdlDcRaw.cpp jdlDcRaw.h jdlDcRaw.i jdlMain.cpp jdlMain.h jdlSettings.cpp Log Message: *) Added OMP to the VNG demosaicing. The end result is mathematically not *exactly* equal to the non-OMP case. However, visually, I can't see any relevant deviation. (by the way : the reason is clear : the omp case is conceived as if the photo is divided in N photos on which VNG is applied, this gives differences on the boundaries versus one photo with VNG. But I believe it is correct) I added a user option to switch on/off OMP. Index: jdlMain.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlMain.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** jdlMain.cpp 24 Apr 2010 17:30:51 -0000 1.25 --- jdlMain.cpp 1 May 2010 07:38:25 -0000 1.26 *************** *** 1764,1767 **** --- 1764,1773 ---- } + void jdlMain::CB_InterpolationOMP(const QVariant) { + m_TheProcessor->m_TriggerUpdateExifInfoAtEnd = 0; + m_TheProcessor->m_TriggerZoomFitAtEnd = 0; + m_TheProcessor->RunFixed(jdlProcessorPhase_Demosaic); + } + //////////////////////////////////////////////////////////////////////////////// // *************** *** 1859,1862 **** --- 1865,1869 ---- M_Dispatch(Interpolation) M_Dispatch(FourColorRGB) + M_Dispatch(InterpolationOMP) M_Dispatch(DCBIterations) M_Dispatch(DCBEnhance) Index: jdlDcRaw.i =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlDcRaw.i,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** jdlDcRaw.i 24 Apr 2010 17:30:51 -0000 1.4 --- jdlDcRaw.i 1 May 2010 07:38:25 -0000 1.5 *************** *** 334,337 **** --- 334,346 ---- _("Mix the 2 green channels")}, + {"Fixed_Interpolation", + "InterpolationOMP", + jdlGT_Check, + 2, + 1, + 1, + _("Interpolation OMP"), + _("OMP parallelization used on interpolation")}, + #endif Index: jdlDcRaw.h =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlDcRaw.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** jdlDcRaw.h 24 Apr 2010 17:30:51 -0000 1.10 --- jdlDcRaw.h 1 May 2010 07:38:25 -0000 1.11 *************** *** 176,179 **** --- 176,182 ---- short m_UserSetting_FourColorRGB; + // Whether or not to allow OMP on interpolation + short m_UserSetting_InterpolationOMP; + // Balance the greens before the interpolation short m_UserSetting_BalanceGreens; Index: jdlMain.h =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlMain.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** jdlMain.h 24 Apr 2010 17:30:51 -0000 1.10 --- jdlMain.h 1 May 2010 07:38:25 -0000 1.11 *************** *** 169,172 **** --- 169,173 ---- void CB_Interpolation(const QVariant); + void CB_InterpolationOMP(const QVariant); void CB_DCBIterations(const QVariant); void CB_DCBEnhance(const QVariant); Index: jdlSettings.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlSettings.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** jdlSettings.cpp 24 Apr 2010 17:30:51 -0000 1.15 --- jdlSettings.cpp 1 May 2010 07:38:25 -0000 1.16 *************** *** 1026,1029 **** --- 1026,1032 ---- TheDcRaw->m_UserSetting_FourColorRGB = GetInt("FourColorRGB"); + // Use OMP on interpolation + TheDcRaw->m_UserSetting_InterpolationOMP = GetInt("InterpolationOMP"); + // DCB settings TheDcRaw->m_UserSetting_DCBIterations = GetInt("DCBIterations"); Index: jdlDcRaw.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlDcRaw.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** jdlDcRaw.cpp 27 Apr 2010 17:30:35 -0000 1.16 --- jdlDcRaw.cpp 1 May 2010 07:38:24 -0000 1.17 *************** *** 37,40 **** --- 37,41 ---- #include "jdlConstants.h" + #include <omp.h> // Macro fix for explicit fread returnvalue check. #define jdlfread(ptr,size,n,stream) \ *************** *** 59,62 **** --- 60,66 ---- } + // To assess impact on speed and correctness we make an extra + #define DCRAW_ENABLE_OMP + // The class. #define CLASS DcRaw:: *************** *** 3771,3776 **** // very inequal in workload. // The chunk size is introduced as to avoid too small fractions. ! const int Chunk = m_OutHeight/16; ! #pragma omp parallel for default(shared) schedule(dynamic,Chunk) for (uint16_t Row=0; Row < m_OutHeight; Row++) { --- 3775,3781 ---- // very inequal in workload. // The chunk size is introduced as to avoid too small fractions. ! #ifdef DCRAW_ENABLE_OMP ! #pragma omp parallel for default(shared) schedule(dynamic,m_OutHeight/16) ! #endif for (uint16_t Row=0; Row < m_OutHeight; Row++) { *************** *** 3845,3850 **** // The chunk size is introduced as to avoid too small fractions. const int c_DetailBorder = 2; ! const int Chunk = m_OutHeight/16; ! #pragma omp parallel for default(shared) schedule(dynamic,Chunk) for (uint16_t Row = 0; Row < m_OutHeight; Row++) { --- 3850,3856 ---- // The chunk size is introduced as to avoid too small fractions. const int c_DetailBorder = 2; ! #ifdef DCRAW_ENABLE_OMP ! #pragma omp parallel for default(shared) schedule(dynamic,m_OutHeight/16) ! #endif for (uint16_t Row = 0; Row < m_OutHeight; Row++) { *************** *** 3912,3916 **** // And now we correct it back for the increased exposure. // (but clipped stays clipped !) ! ClippedPixel[Color] = (uint16_t)(ClippedPixel[Color]* m_MinPreMulti); } --- 3918,3922 ---- // And now we correct it back for the increased exposure. // (but clipped stays clipped !) ! ClippedPixel[Color]= (uint16_t)(ClippedPixel[Color]* m_MinPreMulti); } *************** *** 3996,4000 **** } else { ClippedSaturation = ! 1.0 - (double)ClippedPixel[MinChannel] / ClippedPixel[MaxChannel]; } double ClippedHue; --- 4002,4006 ---- } else { ClippedSaturation = ! 1.0-(double)ClippedPixel[MinChannel] / ClippedPixel[MaxChannel]; } double ClippedHue; *************** *** 4066,4071 **** // The chunk size is introduced as to avoid too small fractions. const int c_DetailBorder = 2; ! const int Chunk = m_Height/16; ! #pragma omp parallel for default(shared) schedule(dynamic,Chunk) for (uint16_t Row=1; Row<m_Height-1; Row++) { --- 4072,4078 ---- // The chunk size is introduced as to avoid too small fractions. const int c_DetailBorder = 2; ! #ifdef DCRAW_ENABLE_OMP ! #pragma omp parallel for default(shared) schedule(dynamic,m_Height/16) ! #endif for (uint16_t Row=1; Row<m_Height-1; Row++) { *************** *** 4110,4115 **** // very inequal in workload. // The chunk size is introduced as to avoid too small fractions. ! // Have it from previous loop : const int Chunk = m_Height/16; ! #pragma omp parallel for default(shared) schedule(dynamic,Chunk) for (uint16_t Row=1; Row<m_Height-1; Row++) { --- 4117,4123 ---- // very inequal in workload. // The chunk size is introduced as to avoid too small fractions. ! #ifdef DCRAW_ENABLE_OMP ! #pragma omp parallel for default(shared) schedule(dynamic,m_Height/16) ! #endif for (uint16_t Row=1; Row<m_Height-1; Row++) { *************** *** 4179,4184 **** // The chunk size is introduced as to avoid too small fractions. const int c_DetailBorder = 2; ! const int Chunk = m_Height/16; ! #pragma omp parallel for default(shared) schedule(dynamic,Chunk) for (uint16_t Row = FC(1,0) >> 1; Row < m_Height; Row+=2) { --- 4187,4193 ---- // The chunk size is introduced as to avoid too small fractions. const int c_DetailBorder = 2; ! #ifdef DCRAW_ENABLE_OMP ! #pragma omp parallel for default(shared) schedule(dynamic,m_Height/16) ! #endif for (uint16_t Row = FC(1,0) >> 1; Row < m_Height; Row+=2) { *************** *** 4231,4265 **** void CLASS BorderInterpolate (uint16_t Border) { - const uint16_t c_DetailBorder = Border+2; // Probably more than enough margin. - - // We allocate with dynamic schedule as the "Detail" view can - // stop very early many of the rows/cols. So the chunks are - // very inequal in workload. - // The chunk size is introduced as to avoid too small fractions. - const int Chunk = m_Height/16; - #pragma omp parallel for default(shared) schedule(dynamic,Chunk) for (uint16_t Row=0; Row < m_Height; Row++) { - - if (m_Stop) { - // OpenMP cannot exit, but continue will go fast now :) - continue; - } - - if (m_UserSetting_Detail && - (Row + c_DetailBorder < m_UserSetting_DetailRowStart || - Row > m_UserSetting_DetailRowEnd + c_DetailBorder) ) { - continue; - } - uint32_t Offset = Row * m_Width; - for (uint16_t Col=0; Col < m_Width; Col++) { - - if (m_UserSetting_Detail && - (Col + c_DetailBorder < m_UserSetting_DetailColStart || - Col > m_UserSetting_DetailColEnd + c_DetailBorder) ) { - continue; - } - if (Col==Border && Row >= Border && Row < (m_Height-Border)) { // Jump to the right. --- 4240,4246 ---- *************** *** 4344,4355 **** // Real start of the linear interpolate. ! // XXX JDLA Check once more OPENMP !!! ! // I believe the last assignment Pix[ip[0]] is OK, but check once more. // We allocate with dynamic schedule as the "Detail" view can // stop very early many of the rows/cols. So the chunks are // very inequal in workload. // The chunk size is introduced as to avoid too small fractions. ! const int Chunk = m_Height/16; ! #pragma omp parallel for default(shared) schedule(dynamic,Chunk) for (uint16_t Row=1; Row < m_Height-1; Row++) { --- 4325,4339 ---- // Real start of the linear interpolate. ! // I believe a simple OPENMP loop is fine. ! // I had some concern about the last assignment Pix[ip[0]] ! // But I believe it is ok as the for (Row=1 ..) loop should ! // be runnable the other way around as well and hence parallelization is OK. // We allocate with dynamic schedule as the "Detail" view can // stop very early many of the rows/cols. So the chunks are // very inequal in workload. // The chunk size is introduced as to avoid too small fractions. ! #ifdef DCRAW_ENABLE_OMP ! #pragma omp parallel for default(shared) schedule(dynamic,m_Height/16) ! #endif for (uint16_t Row=1; Row < m_Height-1; Row++) { *************** *** 4436,4443 **** }, chood[] = { -1,-1, -1,0, -1,+1, 0,+1, +1,+1, +1,0, +1,-1, 0,-1 }; ! uint16_t (*brow[5])[4], *pix; ! int prow=7, pcol=1, *ip, *code[16][16], gval[8], gmin, gmax, sum[4]; int row, col, x, y, x1, x2, y1, y2, t, weight, grads, color, diag; ! int g, diff, thold, num, c; LinearInterpolate(); --- 4420,4426 ---- }, chood[] = { -1,-1, -1,0, -1,+1, 0,+1, +1,+1, +1,0, +1,-1, 0,-1 }; ! int prow=7, pcol=1, *ip, *code[16][16]; int row, col, x, y, x1, x2, y1, y2, t, weight, grads, color, diag; ! int g; LinearInterpolate(); *************** *** 4483,4565 **** } } - brow[4] = (uint16_t (*)[4]) CALLOC (m_Width*3, sizeof **brow); - merror (brow[4], "VNGInterpolate()"); - for (row=0; row < 3; row++) - brow[row] = brow[4] + row*m_Width; ! // Here starts the real interpolation. ! // XXX JDLA TODO Investigate if OpenMP parallelization is possible. ! for (row=2; row < m_Height-2; row++) { /* Do VNG interpolation */ ! ! if (m_Stop) { ! FREE (brow[4]); ! FREE (code[0][0]); ! return; ! } ! if (m_UserSetting_Detail && ! (row +c_DetailBorder < m_UserSetting_DetailRowStart || ! row > m_UserSetting_DetailRowEnd + c_DetailBorder) ) { ! continue; } ! for (col=2; col < m_Width-2; col++) { ! if (m_UserSetting_Detail && ! (col + c_DetailBorder < m_UserSetting_DetailColStart || ! col > m_UserSetting_DetailColEnd + c_DetailBorder) ) { ! continue; } ! pix = m_Image[row*m_Width+col]; ! ip = code[row & prow][col & pcol]; ! memset (gval, 0, sizeof gval); ! while ((g = ip[0]) != INT_MAX) { /* Calculate gradients */ ! diff = ABS(pix[g] - pix[ip[1]]) << ip[2]; ! gval[ip[3]] += diff; ! ip += 5; ! if ((g = ip[-1]) == -1) continue; ! gval[g] += diff; ! while ((g = *ip++) != -1) ! gval[g] += diff; ! } ! ip++; ! gmin = gmax = gval[0]; /* Choose a threshold */ ! for (g=1; g < 8; g++) { ! if (gmin > gval[g]) gmin = gval[g]; ! if (gmax < gval[g]) gmax = gval[g]; } ! if (gmax == 0) { ! memcpy (brow[2][col], pix, sizeof *m_Image); ! continue; } ! thold = gmin + (gmax >> 1); ! memset (sum, 0, sizeof sum); ! color = fc(row,col); ! for (num=g=0; g < 8; g++,ip+=2) { /* Average the neighbors */ ! if (gval[g] <= thold) { ! for (c=0; c < m_Colors; c++) ! if (c == color && ip[1]) ! sum[c] += (pix[c] + pix[ip[1]]) >> 1; ! else ! sum[c] += pix[ip[0] + c]; ! num++; ! } } ! for (c=0; c < m_Colors; c++) { /* Save to buffer */ ! t = pix[color]; ! if (c != color) ! t += (sum[c] - sum[color]) / num; ! brow[2][col][c] = CLIP(t); } } ! if (row > 3) /* Write buffer to image */ ! memcpy (m_Image[(row-2)*m_Width+2], brow[0]+2, (m_Width-4)*sizeof *m_Image); ! for (g=0; g < 4; g++) ! brow[(g-1) & 3] = brow[g]; ! } ! memcpy (m_Image[(row-2)*m_Width+2], brow[0]+2, (m_Width-4)*sizeof *m_Image); ! memcpy (m_Image[(row-1)*m_Width+2], brow[1]+2, (m_Width-4)*sizeof *m_Image); ! FREE (brow[4]); FREE (code[0][0]); } --- 4466,4611 ---- } } ! // OMP on/off via user ! #ifdef _OPENMP ! omp_set_num_threads(m_UserSetting_InterpolationOMP ? omp_get_max_threads():1); ! #endif ! // Some helping variables that are needed in OMP case. ! // But they are not sitting in the way for the non OMP case. ! int PreviousRow = -1; ! int RowInChunk = -1; ! ! #ifdef DCRAW_ENABLE_OMP ! #pragma omp parallel default(shared) ! #endif ! { ! uint16_t (*brow[5])[4]; ! brow[4] = (uint16_t (*)[4]) CALLOC (m_Width*3, sizeof **brow); ! merror (brow[4], "VNGInterpolate()"); ! for (short TmpRow=0; TmpRow < 3; TmpRow++) { ! brow[TmpRow] = brow[4] + TmpRow*m_Width; } ! // Here starts the real interpolation. ! // XXX JDLA I'm not fully sure the parallelization is theoretically OK. ! // It should be if the outer loop is direction independent, ! // which seems like a fair assumption ? ! // Remark the lastprivate on row as loopvariable used at the end. ! #ifdef DCRAW_ENABLE_OMP ! #pragma omp for lastprivate(row) firstprivate(PreviousRow,RowInChunk) \ ! schedule(dynamic,m_Height/16) ! #endif ! for (row=2; row < m_Height-2; row++) { /* Do VNG interpolation */ ! if (abs(row-PreviousRow)>1) { ! // This is the beginning of a new chunk. ! if (PreviousRow != -1) { ! // Still to finalize the previous chunk ! memcpy (m_Image[(PreviousRow-1)*m_Width+2], ! brow[0]+2, ! (m_Width-4)*sizeof *m_Image); ! memcpy (m_Image[PreviousRow*m_Width+2], ! brow[1]+2, ! (m_Width-4)*sizeof *m_Image); ! } ! RowInChunk = 0; } ! PreviousRow = row; ! RowInChunk++; ! ! if (m_Stop) { ! // We avoid stopping (OpenMP) but do a real quick loop ... ! continue; } ! ! if (m_UserSetting_Detail && ! (row +c_DetailBorder < m_UserSetting_DetailRowStart || ! row > m_UserSetting_DetailRowEnd + c_DetailBorder) ) { ! continue; } ! ! for (uint16_t col=2; col < m_Width-2; col++) { ! ! if (m_UserSetting_Detail && ! (col + c_DetailBorder < m_UserSetting_DetailColStart || ! col > m_UserSetting_DetailColEnd + c_DetailBorder) ) { ! continue; ! } ! ! uint16_t *pix = m_Image[row*m_Width+col]; ! int *ip = code[row & prow][col & pcol]; ! int gval[8]; ! memset (gval, 0, sizeof gval); ! int g; ! while ((g = ip[0]) != INT_MAX) { /* Calculate gradients */ ! int diff = ABS(pix[g] - pix[ip[1]]) << ip[2]; ! gval[ip[3]] += diff; ! ip += 5; ! if ((g = ip[-1]) == -1) continue; ! gval[g] += diff; ! while ((g = *ip++) != -1) ! gval[g] += diff; ! } ! ip++; ! int gmin = gval[0]; /* Choose a threshold */ ! int gmax = gval[0]; /* Choose a threshold */ ! for (g=1; g < 8; g++) { ! if (gmin > gval[g]) gmin = gval[g]; ! if (gmax < gval[g]) gmax = gval[g]; ! } ! if (gmax == 0) { ! memcpy (brow[2][col], pix, sizeof *m_Image); ! continue; ! } ! int thold = gmin + (gmax >> 1); ! int sum[4]; ! memset (sum, 0, sizeof sum); ! int color = fc(row,col); ! int num; ! for (num=g=0; g < 8; g++,ip+=2) { /* Average the neighbors */ ! if (gval[g] <= thold) { ! for (short c=0; c < m_Colors; c++) ! if (c == color && ip[1]) ! sum[c] += (pix[c] + pix[ip[1]]) >> 1; ! else ! sum[c] += pix[ip[0] + c]; ! num++; ! } ! } ! for (short c=0; c < m_Colors; c++) { /* Save to buffer */ ! int t = pix[color]; ! if (c != color) ! t += (sum[c] - sum[color]) / num; ! brow[2][col][c] = CLIP(t); ! } } ! // WAS if (row > 3) { /* Write buffer to image */ ! if (RowInChunk>2) { ! memcpy(m_Image[(row-2)*m_Width+2], ! brow[0]+2, ! (m_Width-4)*sizeof *m_Image); } + // Visually : shift brow one row. + for (int g=0; g < 4; g++) brow[(g-1) & 3] = brow[g]; } ! ! #ifdef _OPENMP ! int Tid = omp_get_thread_num(); ! #else ! int Tid = 0; ! #endif ! if (Tid == 0) { ! memcpy (m_Image[(row-2)*m_Width+2], ! brow[0]+2, ! (m_Width-4)*sizeof *m_Image); ! memcpy (m_Image[(row-1)*m_Width+2], ! brow[1]+2, ! (m_Width-4)*sizeof *m_Image); ! } ! ! FREE (brow[4]); ! } // End OMP parallel section FREE (code[0][0]); } |
|
From: Jos De L. <jd...@us...> - 2010-05-01 07:38:32
|
Update of /cvsroot/jdlraw/jdlRaw In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv20264 Modified Files: CHANGELOG Log Message: *) Added OMP to the VNG demosaicing. The end result is mathematically not *exactly* equal to the non-OMP case. However, visually, I can't see any relevant deviation. (by the way : the reason is clear : the omp case is conceived as if the photo is divided in N photos on which VNG is applied, this gives differences on the boundaries versus one photo with VNG. But I believe it is correct) I added a user option to switch on/off OMP. Index: CHANGELOG =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/CHANGELOG,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** CHANGELOG 27 Apr 2010 17:30:35 -0000 1.49 --- CHANGELOG 1 May 2010 07:38:21 -0000 1.50 *************** *** 1,5 **** ! Latest change : 20100427_1930 (manipulate me to force CVS log) $Log$ Revision 1.49 2010/04/27 17:30:35 jdla --- 1,16 ---- ! Latest change : 20100501_0900 (manipulate me to force CVS log) $Log$ + Revision 1.50 2010/05/01 07:38:21 jdla + + *) Added OMP to the VNG demosaicing. + The end result is mathematically not *exactly* equal to the non-OMP case. + However, visually, I can't see any relevant deviation. + (by the way : the reason is clear : the omp case is conceived as if + the photo is divided in N photos on which VNG is applied, this gives + differences on the boundaries versus one photo with VNG. But I believe + it is correct) + I added a user option to switch on/off OMP. + Revision 1.49 2010/04/27 17:30:35 jdla |
|
From: Jos De L. <jd...@us...> - 2010-04-27 17:30:43
|
Update of /cvsroot/jdlraw/jdlRaw In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv23631 Modified Files: CHANGELOG TODO Log Message: *) OMP and detail restriction on DCB algorithms. Index: TODO =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/TODO,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** TODO 24 Apr 2010 17:30:51 -0000 1.32 --- TODO 27 Apr 2010 17:30:35 -0000 1.33 *************** *** 10,13 **** --- 10,15 ---- with fourcolor (ppg,vnd). Reflect that in gui. + - Further OpenMP stuff and loop-to-detail restriction + I.b. Low Priority Index: CHANGELOG =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/CHANGELOG,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** CHANGELOG 24 Apr 2010 17:30:51 -0000 1.48 --- CHANGELOG 27 Apr 2010 17:30:35 -0000 1.49 *************** *** 1,5 **** ! Latest change : 20100424_1930 (manipulate me to force CVS log) $Log$ Revision 1.48 2010/04/24 17:30:51 jdla --- 1,9 ---- ! Latest change : 20100427_1930 (manipulate me to force CVS log) $Log$ + Revision 1.49 2010/04/27 17:30:35 jdla + + *) OMP and detail restriction on DCB algorithms. + Revision 1.48 2010/04/24 17:30:51 jdla |
|
From: Jos De L. <jd...@us...> - 2010-04-24 17:31:00
|
Update of /cvsroot/jdlraw/jdlRaw/Sources In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv20320/Sources Modified Files: jdlConstants.h jdlDcRaw.cpp jdlDcRaw.h jdlDcRaw.i jdlGuiOptions.cpp jdlMain.cpp jdlMain.h jdlSettings.cpp jdlThumbnailer.cpp Added Files: jdlDcbDemosaicing.i Log Message: *) Rough addition of Jacek Gozdz' DCB demosaicing. Index: jdlMain.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlMain.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** jdlMain.cpp 18 Apr 2010 14:26:26 -0000 1.24 --- jdlMain.cpp 24 Apr 2010 17:30:51 -0000 1.25 *************** *** 1734,1737 **** --- 1734,1761 ---- } + void jdlMain::CB_DCBIterations(const QVariant) { + m_TheProcessor->m_TriggerUpdateExifInfoAtEnd = 0; + m_TheProcessor->m_TriggerZoomFitAtEnd = 0; + m_TheProcessor->RunFixed(jdlProcessorPhase_Demosaic); + } + + void jdlMain::CB_DCBEnhance(const QVariant) { + m_TheProcessor->m_TriggerUpdateExifInfoAtEnd = 0; + m_TheProcessor->m_TriggerZoomFitAtEnd = 0; + m_TheProcessor->RunFixed(jdlProcessorPhase_Demosaic); + } + + void jdlMain::CB_FBDD(const QVariant) { + m_TheProcessor->m_TriggerUpdateExifInfoAtEnd = 0; + m_TheProcessor->m_TriggerZoomFitAtEnd = 0; + m_TheProcessor->RunFixed(jdlProcessorPhase_Demosaic); + } + + void jdlMain::CB_BalanceGreens(const QVariant) { + m_TheProcessor->m_TriggerUpdateExifInfoAtEnd = 0; + m_TheProcessor->m_TriggerZoomFitAtEnd = 0; + m_TheProcessor->RunFixed(jdlProcessorPhase_Demosaic); + } + void jdlMain::CB_FourColorRGB(const QVariant) { m_TheProcessor->m_TriggerUpdateExifInfoAtEnd = 0; *************** *** 1835,1838 **** --- 1859,1866 ---- M_Dispatch(Interpolation) M_Dispatch(FourColorRGB) + M_Dispatch(DCBIterations) + M_Dispatch(DCBEnhance) + M_Dispatch(FBDD) + M_Dispatch(BalanceGreens) M_Dispatch(MedianPasses) M_Dispatch(ClipMode) Index: jdlGuiOptions.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlGuiOptions.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** jdlGuiOptions.cpp 13 Apr 2010 19:49:11 -0000 1.8 --- jdlGuiOptions.cpp 24 Apr 2010 17:30:51 -0000 1.9 *************** *** 121,124 **** --- 121,125 ---- {jdlInterpolation_PPG, QObject::tr("PPG") }, {jdlInterpolation_AHD, QObject::tr("AHD") }, + {jdlInterpolation_DCB, QObject::tr("DCB") }, {-1,NULL}}; Index: jdlDcRaw.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlDcRaw.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** jdlDcRaw.cpp 18 Apr 2010 14:26:26 -0000 1.14 --- jdlDcRaw.cpp 24 Apr 2010 17:30:51 -0000 1.15 *************** *** 61,64 **** --- 61,65 ---- // The class. #define CLASS DcRaw:: + CLASS DcRaw() { // This were the original global variables initialized. *************** *** 73,76 **** --- 74,81 ---- m_UserSetting_HalfSize=0; m_UserSetting_FourColorRGB=0; + m_UserSetting_BalanceGreens=0; + m_UserSetting_DCBIterations=0; + m_UserSetting_DCBEnhance=0; + m_UserSetting_FBDD = 0; m_UserSetting_AutoWb=0; m_UserSetting_CameraWb=0; *************** *** 82,86 **** m_UserSetting_jdlRaw_ClipMode = jdlClipMode_Clip; m_UserSetting_jdlRaw_ClipParameter = 0; ! m_UserSetting_Quality = 3; m_UserSetting_BlackPoint = -1; m_UserSetting_Saturation = -1; --- 87,91 ---- m_UserSetting_jdlRaw_ClipMode = jdlClipMode_Clip; m_UserSetting_jdlRaw_ClipParameter = 0; ! m_UserSetting_Interpolation = 3; m_UserSetting_BlackPoint = -1; m_UserSetting_Saturation = -1; *************** *** 182,186 **** m_Kodak_cbpp = zero_after_ff = m_DNG_Version = m_Load_Flags = 0; m_TimeStamp = m_ShotOrder = m_Tiff_Samples = m_BlackLevel = m_IsFoveon = 0; ! m_MixGreen = m_ProfileLength = data_error = m_ZeroIsBad = 0; m_PixelAspect = m_IsRaw = m_RawColor = 1; m_TileWidth = m_TileLength = INT_MAX; --- 187,191 ---- m_Kodak_cbpp = zero_after_ff = m_DNG_Version = m_Load_Flags = 0; m_TimeStamp = m_ShotOrder = m_Tiff_Samples = m_BlackLevel = m_IsFoveon = 0; ! m_FourColorRGB = m_ProfileLength = data_error = m_ZeroIsBad = 0; m_PixelAspect = m_IsRaw = m_RawColor = 1; m_TileWidth = m_TileLength = INT_MAX; *************** *** 243,252 **** --- 248,284 ---- */ + // + // In the 2X8 assumption, FC returns the color 0..3 on a position(row,col) + // The shift argument for m_Filters is probably better readable as : + // 4*(row & 0b111)+2*(col & 1) : + // 0 2 + // 4 6 + // 8 10 + // 12 14 + // 16 18 + // 20 22 + // 24 26 + // 28 30 + // + // The 32 bit Filter word represents the 8X2=16 times 2 bit color + // representation. + // + #define FC(row,col) \ (m_Filters >> ((((row) << 1 & 14) + ((col) & 1)) << 1) & 3) + // + // This is then obviously the bayern pattern in the m_Image + // Remark the m_Shrink which is active in half size and + // basically makes interpolation unnecessary. + // + #define BAYER(row,col) \ m_Image[((row) >> m_Shrink)*m_OutWidth + ((col) >> m_Shrink)][FC(row,col)] + // + // Idem for 16X16 patterns, that use then fc function rather than FC above. + // + #define BAYER2(row,col) \ m_Image[((row) >> m_Shrink)*m_OutWidth + ((col) >> m_Shrink)][fc(row,col)] *************** *** 3864,3868 **** // Or restore via HSV, as in ufraw. } else if (jdlClipMode_HSV == ClipMode) { ! // FIXME / TODO : can this not break in some 4 colour modes ? short MaxChannel,MidChannel,MinChannel; if (m_Image[Pos][0] > m_Image[Pos][1] && --- 3896,3900 ---- // Or restore via HSV, as in ufraw. } else if (jdlClipMode_HSV == ClipMode) { ! // FIXME / TODO : can this not break in some 4 color modes ? short MaxChannel,MidChannel,MinChannel; if (m_Image[Pos][0] > m_Image[Pos][1] && *************** *** 3954,3962 **** } ! void CLASS pre_interpolate() ! { ! int row, col; ! TRACEKEYVALS("pre_interpolate","%s",""); if (m_Shrink) { --- 3986,4051 ---- } ! //////////////////////////////////////////////////////////////////////////////// ! // ! // BalanceGreens() ! // This does some bilinear interpolations on the Greens before ! // the actual demosaicing. ! // ! // Niels Kristian Bech Jensen patch ! // ! //////////////////////////////////////////////////////////////////////////////// ! void CLASS BalanceGreens() { ! ! if (m_UserSetting_HalfSize && !m_UserSetting_Detail) return; ! ! TRACEKEYVALS("BalanceGreens","%s",""); ! ! uint16_t* Img = (uint16_t *) CALLOC(m_Width*m_Height, sizeof *Img); ! merror(Img,"BalanceGreens()"); ! ! // Bilinear interpolate G1 and G2 channels at green locations (diagonal only) ! for (uint16_t Row=1; Row<m_Height-1; Row++) { ! uint16_t Col; ! uint16_t Offset; ! short c; ! for (Col=1+(FC(Row,0) & 1), c=FC(Row+1,Col+1), Offset=Row*m_Width+Col; ! Col<m_Width-1; ! Col+=2, Offset+=2) { ! uint16_t Offset1 = Offset - m_Width - 1; ! uint16_t Offset2 = Offset - m_Width + 1; ! uint16_t Offset3 = Offset + m_Width - 1; ! uint16_t Offset4 = Offset + m_Width + 1; ! Img[Offset] = ((m_Image[Offset1][c] + ! m_Image[Offset2][c] + ! m_Image[Offset3][c] + ! m_Image[Offset4][c]) >> 2); ! } ! } ! ! // Mix green channels ! for (uint16_t Row=1; Row<m_Height-1; Row++) { ! uint16_t Col; ! uint16_t Offset; ! short c; ! for (Col=1+(FC(Row,0) & 1), c=FC(Row,Col), Offset=Row*m_Width+Col; ! Col<m_Width-1; ! Col+=2, Offset+=2) { ! m_Image[Offset][c] = ((m_Image[Offset][c] + Img[Offset]) >> 1); ! } ! } ! ! FREE(Img); ! } ! ! //////////////////////////////////////////////////////////////////////////////// ! // ! // PreInterpolate ! // ! //////////////////////////////////////////////////////////////////////////////// ! ! void CLASS PreInterpolate() { ! ! TRACEKEYVALS("PreInterpolate","%s",""); if (m_Shrink) { *************** *** 3973,3985 **** } if (m_Filters && m_Colors == 3) { ! if (m_MixGreen) { m_Colors++; ! } ! else { ! // Seems like making the G1 equal to G2 ! // (and adapting the filter from fi BG1G2R to BGGR) ! for (row = FC(1,0) >> 1; row < m_Height; row+=2) ! for (col = FC(row,1) & 1; col < m_Width; col+=2) m_Image[row*m_Width+col][1] = m_Image[row*m_Width+col][3]; m_Filters &= ~((m_Filters & 0x55555555) << 1); } --- 4062,4077 ---- } if (m_Filters && m_Colors == 3) { ! if (m_FourColorRGB) { ! // Even if this is not a four color camera ! // (as in RGBE) we are going to treat it as a four color one. m_Colors++; ! } else { ! // Make G1 equal to G2. ! for (int row = FC(1,0) >> 1; row < m_Height; row+=2) ! for (int col = FC(row,1) & 1; col < m_Width; col+=2) m_Image[row*m_Width+col][1] = m_Image[row*m_Width+col][3]; + // Complex one, probably done via Karnaugh tables, but + // the result is that in a filter, per 2 bits following occurs : + // 00(R)->00(R) 01(G)->01(G) 10(B)->10(B) 11(G2)->01(G) m_Filters &= ~((m_Filters & 0x55555555) << 1); } *************** *** 4040,4051 **** const uint16_t c_DetailBorder = 2; ! int Code[16][16][32], Sum[4]; TRACEKEYVALS("Bilinear interpolation","%s",""); BorderInterpolate(1); ! // On the 16X16 corner precalculate 'Code'. ! // XXX JDLA : not fully clear : ! // precalculation as where to fetch the neighbours. for (uint16_t Row=0; Row < 16; Row++) { for (uint16_t Col=0; Col < 16; Col++) { --- 4132,4155 ---- const uint16_t c_DetailBorder = 2; ! // 16X16 is a maximum recurrent pattern in the bayer arrays. ! // 32 is an ad hoc coding for each of those positions of : ! // 0 : Where to fetch the neighboring same color for this position. ! // 1 : Shift (Weight) : ! // 0 1 0 ! // 1 X 1 ! // 0 1 0 ! // 2 : Color ! // Above 8 times repeated for the eight neighbours. ! // ! // 25..31 ??? XXX JDLA c,256/Sum[c] , 4 times repeated for the four colours. ! // ! ! int Code[16][16][32]; ! int Sum[4]; TRACEKEYVALS("Bilinear interpolation","%s",""); BorderInterpolate(1); ! // Precalculate Code in the 16x16 array. for (uint16_t Row=0; Row < 16; Row++) { for (uint16_t Col=0; Col < 16; Col++) { *************** *** 4063,4066 **** --- 4167,4171 ---- } } + // XXX JDLA , not fully clear. for (short c=0; c < m_Colors; c++) { if (c != fc(Row,Col)) { *************** *** 4094,4100 **** --- 4199,4208 ---- int *ip = Code[Row & 15][Col & 15]; memset(Sum, 0, sizeof Sum); + // Summing over the 8 neighbours using elements of Code + // i.e. position and weight. for (short i=8; i--; ip+=3) { Sum[ip[2]] += Pix[ip[0]] << ip[1]; } + // Normalization of weight (? XXX JDLA) for (short i=m_Colors; --i; ip+=2) { Pix[ip[0]] = Sum[ip[0]] * ip[1] >> 8; *************** *** 8365,8371 **** // Copied from earlier to here also. // Enables Phase3 to reenter with a different FourColorRGB setting. ! m_MixGreen = m_UserSetting_HalfSize && !m_UserSetting_Detail ? 0 : m_UserSetting_FourColorRGB; assert (!m_IsFoveon); // if (m_IsFoveon ) foveon_interpolate(); --- 8473,8484 ---- // Copied from earlier to here also. // Enables Phase3 to reenter with a different FourColorRGB setting. ! m_FourColorRGB = m_UserSetting_HalfSize && !m_UserSetting_Detail ? 0 : m_UserSetting_FourColorRGB; + // Add on : Balance greens before interpolation. + if (m_UserSetting_BalanceGreens && m_Colors < 4 && !m_IsFoveon) { + BalanceGreens(); + } + assert (!m_IsFoveon); // if (m_IsFoveon ) foveon_interpolate(); *************** *** 8378,8382 **** TRACEKEYVALS("Colors","%d",m_Colors); ! pre_interpolate(); if (m_Stop) return 0; --- 8491,8495 ---- TRACEKEYVALS("Colors","%d",m_Colors); ! PreInterpolate(); if (m_Stop) return 0; *************** *** 8386,8396 **** // Interpolation/demosaicing according to one of the algorithms. if (m_Filters) { ! if (m_UserSetting_Quality == 0) ! LinearInterpolate(); ! else if (m_UserSetting_Quality == 1 || m_Colors > 3) ! VNGInterpolate(); ! else if (m_UserSetting_Quality == 2) ! PPGInterpolate(); ! else AHDInterpolate(); } --- 8499,8522 ---- // Interpolation/demosaicing according to one of the algorithms. if (m_Filters) { ! if (m_UserSetting_FBDD) fbdd(m_UserSetting_FBDD); ! switch (m_UserSetting_Interpolation) { ! case jdlInterpolation_Linear : ! LinearInterpolate(); ! break; ! case jdlInterpolation_VNG : ! VNGInterpolate(); ! break; ! case jdlInterpolation_PPG : ! PPGInterpolate(); ! break; ! case jdlInterpolation_AHD : ! AHDInterpolate(); ! break; ! case jdlInterpolation_DCB : ! DCBInterpolate(m_UserSetting_DCBIterations,m_UserSetting_DCBEnhance); ! break; ! default : ! assert(0); ! } } *************** *** 8425,8429 **** // Green mixing (==m_UserSetting_FourColorRGB); ! if (m_MixGreen) { for (uint32_t i=0; i < (uint32_t) m_Height*m_Width; i++) m_Image[i][1] = ((uint32_t) m_Image[i][1] + m_Image[i][3]) >> 1; --- 8551,8555 ---- // Green mixing (==m_UserSetting_FourColorRGB); ! if (m_FourColorRGB) { for (uint32_t i=0; i < (uint32_t) m_Height*m_Width; i++) m_Image[i][1] = ((uint32_t) m_Image[i][1] + m_Image[i][3]) >> 1; *************** *** 9020,9022 **** --- 9146,9156 ---- //////////////////////////////////////////////////////////////////////////////// + // + // Custom addition dcb_demosaic + // + //////////////////////////////////////////////////////////////////////////////// + + #include "jdlDcbDemosaicing.i" + + //////////////////////////////////////////////////////////////////////////////// Index: jdlConstants.h =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlConstants.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** jdlConstants.h 14 Apr 2010 20:09:12 -0000 1.14 --- jdlConstants.h 24 Apr 2010 17:30:51 -0000 1.15 *************** *** 191,194 **** --- 191,195 ---- const short jdlInterpolation_PPG = 2; const short jdlInterpolation_AHD = 3; + const short jdlInterpolation_DCB = 4; // Clip modes; Index: jdlDcRaw.i =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlDcRaw.i,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** jdlDcRaw.i 27 Feb 2010 19:02:41 -0000 1.3 --- jdlDcRaw.i 24 Apr 2010 17:30:51 -0000 1.4 *************** *** 183,186 **** --- 183,214 ---- _("White point in raw")}, + {"Fixed_Interpolation", + "DCBIterations", + jdlGT_Input, + 2, + 1, + 1, + 0, + 0, + 5, + 1, + 0, + _("DCB Iterations"), + _("DCB Iterations")}, + + {"Fixed_Interpolation", + "FBDD", + jdlGT_Input, + 2, + 1, + 1, + 0, + 0, + 2, + 1, + 0, + _("FBDD Denoising"), + _("FBDD Denoising")}, + #endif *************** *** 280,283 **** --- 308,329 ---- {"Fixed_Interpolation", + "DCBEnhance", + jdlGT_Check, + 2, + 1, + 0, + _("Enhance DCB"), + _("Enable DCB Enhancement algorithm")}, + + {"Fixed_Interpolation", + "BalanceGreens", + jdlGT_Check, + 2, + 1, + 0, + _("Balance Greens"), + _("Balance Greens before interpolation")}, + + {"Fixed_Interpolation", "FourColorRGB", jdlGT_Check, Index: jdlDcRaw.h =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlDcRaw.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** jdlDcRaw.h 10 Apr 2010 11:52:46 -0000 1.9 --- jdlDcRaw.h 24 Apr 2010 17:30:51 -0000 1.10 *************** *** 152,156 **** // Each of them corresponds roughly to a command line parameter of dcraw. ! // Quality. // Please remark that most probably dcraw implementation and // manual/documentation differ here. --- 152,156 ---- // Each of them corresponds roughly to a command line parameter of dcraw. ! // Interpolation. // Please remark that most probably dcraw implementation and // manual/documentation differ here. *************** *** 164,168 **** // 2 : Use Patterned Pixel Grouping (PPG) interpolation. // 3 : Use Adaptive Homogeneity-Directed (AHD) interpolation. ! short m_UserSetting_Quality; // Output half-size color image. Doubles speed (no interpolation needed) --- 164,168 ---- // 2 : Use Patterned Pixel Grouping (PPG) interpolation. // 3 : Use Adaptive Homogeneity-Directed (AHD) interpolation. ! short m_UserSetting_Interpolation; // Output half-size color image. Doubles speed (no interpolation needed) *************** *** 176,179 **** --- 176,188 ---- short m_UserSetting_FourColorRGB; + // Balance the greens before the interpolation + short m_UserSetting_BalanceGreens; + + // DCB Interpolation paramters + short m_UserSetting_DCBIterations; + short m_UserSetting_DCBEnhance; + // FBDD denoise + short m_UserSetting_FBDD; + // Automatic white balance. The default is to use a fixed color // balance based on a white card photographed in sunlight *************** *** 430,434 **** unsigned m_WhiteLevel; unsigned m_WhiteLevel_AfterPhase1; ! unsigned m_MixGreen; unsigned m_RawColor; unsigned m_ZeroIsBad; --- 439,443 ---- unsigned m_WhiteLevel; unsigned m_WhiteLevel_AfterPhase1; ! unsigned m_FourColorRGB; unsigned m_RawColor; unsigned m_ZeroIsBad; *************** *** 554,558 **** void LinearInterpolate(); void BorderInterpolate(uint16_t border); ! void pre_interpolate(); void hat_transform(float *temp,float *base,int st,int size,int sc); void cam_xyz_coeff(double cam_xyz[4][3]); --- 563,568 ---- void LinearInterpolate(); void BorderInterpolate(uint16_t border); ! void BalanceGreens(); ! void PreInterpolate(); void hat_transform(float *temp,float *base,int st,int size,int sc); void cam_xyz_coeff(double cam_xyz[4][3]); *************** *** 671,674 **** --- 681,707 ---- #endif int fc(int row,int col); + + // Additional stuff for jdlDcbDemosaicing + void dcb_pp(); + void copy_to_buffer(float (*)[3]); + void restore_from_buffer(float (*)[3]); + void hid(); + void hid2(); + void dcb_color(); + void dcb_color_full(); + void dcb_map(); + void dcb_correction(); + void dcb_correction2(); + void dcb_refinement(); + void rgb_to_lch(double (*)[3]); + void lch_to_rgb(double (*)[3]); + void fbdd_green2(); + void fbdd_correction(); + void fbdd_correction2(double (*)[3]); + void fbdd_green(); + void fbdd_color(); + void fbdd(const short FBDD); + void DCBInterpolate(const short Iterations, const short Enhance); + }; Index: jdlMain.h =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlMain.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** jdlMain.h 18 Apr 2010 14:26:26 -0000 1.9 --- jdlMain.h 24 Apr 2010 17:30:51 -0000 1.10 *************** *** 169,173 **** --- 169,177 ---- void CB_Interpolation(const QVariant); + void CB_DCBIterations(const QVariant); + void CB_DCBEnhance(const QVariant); + void CB_FBDD(const QVariant); void CB_FourColorRGB(const QVariant); + void CB_BalanceGreens(const QVariant); void CB_MedianPasses(const QVariant); Index: jdlThumbnailer.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlThumbnailer.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** jdlThumbnailer.cpp 18 Apr 2010 14:26:26 -0000 1.9 --- jdlThumbnailer.cpp 24 Apr 2010 17:30:51 -0000 1.10 *************** *** 280,284 **** // Interpolation ! TheDcRaw->m_UserSetting_Quality = jdlInterpolation_Linear; // Speed ! // White balance settings. : Just from Camera. --- 280,284 ---- // Interpolation ! TheDcRaw->m_UserSetting_Interpolation = jdlInterpolation_Linear; // Speed ! // White balance settings. : Just from Camera. Index: jdlSettings.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlSettings.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** jdlSettings.cpp 27 Feb 2010 19:02:42 -0000 1.14 --- jdlSettings.cpp 24 Apr 2010 17:30:51 -0000 1.15 *************** *** 1021,1029 **** // Interpolation ! TheDcRaw->m_UserSetting_Quality = GetInt("Interpolation"); // Four Color RGB TheDcRaw->m_UserSetting_FourColorRGB = GetInt("FourColorRGB"); // White balance settings. switch (GetInt("WhiteBalance")) { --- 1021,1039 ---- // Interpolation ! TheDcRaw->m_UserSetting_Interpolation = GetInt("Interpolation"); // Four Color RGB TheDcRaw->m_UserSetting_FourColorRGB = GetInt("FourColorRGB"); + // DCB settings + TheDcRaw->m_UserSetting_DCBIterations = GetInt("DCBIterations"); + TheDcRaw->m_UserSetting_DCBEnhance = GetInt("DCBEnhance"); + + // FBDD Settings + TheDcRaw->m_UserSetting_FBDD = GetInt("FBDD"); + + // BalanceGreens + TheDcRaw->m_UserSetting_BalanceGreens = GetInt("BalanceGreens"); + // White balance settings. switch (GetInt("WhiteBalance")) { --- NEW FILE: jdlDcbDemosaicing.i --- /* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of the author nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // If you want to use the code, you need to display name of the original authors in // your software! /* DCB demosaicing by Jacek Gozdz (cu...@kf...) * the implementation is not speed optimised * the code is open source (BSD licence) */ /* FBDD denoising by Jacek Gozdz (cu...@kf...) and Luis Sanz RodrÃguez (lui...@gm...) * the implementation is not speed optimised * the code is open source (BSD licence) */ // R and B smoothing using green contrast, all pixels except 2 pixel wide border void CLASS dcb_pp() { int g1, r1, b1, u=m_Width, indx, row, col; for (row=2; row < m_Height-2; row++) for (col=2, indx=row*u+col; col < m_Width-2; col++, indx++) { r1 = ( m_Image[indx-1][0] + m_Image[indx+1][0] + m_Image[indx-u][0] + m_Image[indx+u][0] + m_Image[indx-u-1][0] + m_Image[indx+u+1][0] + m_Image[indx-u+1][0] + m_Image[indx+u-1][0])/8.0; g1 = ( m_Image[indx-1][1] + m_Image[indx+1][1] + m_Image[indx-u][1] + m_Image[indx+u][1] + m_Image[indx-u-1][1] + m_Image[indx+u+1][1] + m_Image[indx-u+1][1] + m_Image[indx+u-1][1])/8.0; b1 = ( m_Image[indx-1][2] + m_Image[indx+1][2] + m_Image[indx-u][2] + m_Image[indx+u][2] + m_Image[indx-u-1][2] + m_Image[indx+u+1][2] + m_Image[indx-u+1][2] + m_Image[indx+u-1][2])/8.0; m_Image[indx][0] = CLIP(r1 + ( m_Image[indx][1] - g1 )); m_Image[indx][2] = CLIP(b1 + ( m_Image[indx][1] - g1 )); } } // saves red and blue void CLASS copy_to_buffer(float (*m_Image2)[3]) { int indx; for (indx=0; indx < m_Height*m_Width; indx++) { m_Image2[indx][0]=m_Image[indx][0]; //R m_Image2[indx][2]=m_Image[indx][2]; //B } } // restores red and blue void CLASS restore_from_buffer(float (*m_Image2)[3]) { int indx; for (indx=0; indx < m_Height*m_Width; indx++) { m_Image[indx][0]=m_Image2[indx][0]; //R m_Image[indx][2]=m_Image2[indx][2]; //B } } // fast green interpolation void CLASS hid() { int row, col, c, u=m_Width, v=2*u, indx; for (row=2; row < m_Height-2; row++) { for (col=2, indx=row*m_Width+col; col < m_Width-2; col++, indx++) { c = fc(row,col); if(c != 1) { m_Image[indx][1] = CLIP((m_Image[indx+u][1] + m_Image[indx-u][1] + m_Image[indx-1][1] + m_Image[indx+1][1])/4.0 + (m_Image[indx][c] - ( m_Image[indx+v][c] + m_Image[indx-v][c] + m_Image[indx-2][c] + m_Image[indx+2][c])/4.0)/2.0); } } } } // green correction void CLASS hid2() { int row, col, c, u=m_Width, v=2*u, indx; for (row=4; row < m_Height-4; row++) { for (col=4, indx=row*m_Width+col; col < m_Width-4; col++, indx++) { c = fc(row,col); if (c != 1) { m_Image[indx][1] = CLIP((m_Image[indx+v][1] + m_Image[indx-v][1] + m_Image[indx-2][1] + m_Image[indx+2][1])/4.0 + m_Image[indx][c] - ( m_Image[indx+v][c] + m_Image[indx-v][c] + m_Image[indx-2][c] + m_Image[indx+2][c])/4.0); } } } } // missing colors are interpolated void CLASS dcb_color() { int row, col, c, d, u=m_Width, indx; for (row=1; row < m_Height-1; row++) for (col=1+(FC(row,1) & 1), indx=row*m_Width+col, c=2-FC(row,col); col < u-1; col+=2, indx+=2) { m_Image[indx][c] = CLIP(( 4*m_Image[indx][1] - m_Image[indx+u+1][1] - m_Image[indx+u-1][1] - m_Image[indx-u+1][1] - m_Image[indx-u-1][1] + m_Image[indx+u+1][c] + m_Image[indx+u-1][c] + m_Image[indx-u+1][c] + m_Image[indx-u-1][c] )/4.0); } for (row=1; row<m_Height-1; row++) for (col=1+(FC(row,2)&1), indx=row*m_Width+col,c=FC(row,col+1),d=2-c; col<m_Width-1; col+=2, indx+=2) { m_Image[indx][c] = CLIP((2*m_Image[indx][1] - m_Image[indx+1][1] - m_Image[indx-1][1] + m_Image[indx+1][c] + m_Image[indx-1][c])/2.0); m_Image[indx][d] = CLIP((2*m_Image[indx][1] - m_Image[indx+u][1] - m_Image[indx-u][1] + m_Image[indx+u][d] + m_Image[indx-u][d])/2.0); } } // missing colors are interpolated using high quality algorithm by Luis Sanz RodrÃguez void CLASS dcb_color_full() { int row,col,c,d,u=m_Width,w=3*u,indx; float f[4],g[4],(*chroma)[2]; chroma = (float (*)[2]) calloc(m_Width*m_Height,sizeof *chroma); merror (chroma, "dcb_color_full()"); for (row=1; row < m_Height-1; row++) for (col=1+(FC(row,1)&1),indx=row*m_Width+col,c=FC(row,col),d=c/2; col < u-1; col+=2,indx+=2) chroma[indx][d]=m_Image[indx][c]-m_Image[indx][1]; for (row=3; row<m_Height-3; row++) for (col=3+(FC(row,1)&1),indx=row*m_Width+col,c=1-FC(row,col)/2,d=1-c; col<u-3; col+=2,indx+=2) { f[0]=1.0/(float)(1.0+fabs(chroma[indx-u-1][c]-chroma[indx+u+1][c])+fabs(chroma[indx-u-1][c]-chroma[indx-w-3][c])+fabs(chroma[indx+u+1][c]-chroma[indx-w-3][c])); f[1]=1.0/(float)(1.0+fabs(chroma[indx-u+1][c]-chroma[indx+u-1][c])+fabs(chroma[indx-u+1][c]-chroma[indx-w+3][c])+fabs(chroma[indx+u-1][c]-chroma[indx-w+3][c])); f[2]=1.0/(float)(1.0+fabs(chroma[indx+u-1][c]-chroma[indx-u+1][c])+fabs(chroma[indx+u-1][c]-chroma[indx+w+3][c])+fabs(chroma[indx-u+1][c]-chroma[indx+w-3][c])); f[3]=1.0/(float)(1.0+fabs(chroma[indx+u+1][c]-chroma[indx-u-1][c])+fabs(chroma[indx+u+1][c]-chroma[indx+w-3][c])+fabs(chroma[indx-u-1][c]-chroma[indx+w+3][c])); g[0]=1.325*chroma[indx-u-1][c]-0.175*chroma[indx-w-3][c]-0.075*chroma[indx-w-1][c]-0.075*chroma[indx-u-3][c]; g[1]=1.325*chroma[indx-u+1][c]-0.175*chroma[indx-w+3][c]-0.075*chroma[indx-w+1][c]-0.075*chroma[indx-u+3][c]; g[2]=1.325*chroma[indx+u-1][c]-0.175*chroma[indx+w-3][c]-0.075*chroma[indx+w-1][c]-0.075*chroma[indx+u-3][c]; g[3]=1.325*chroma[indx+u+1][c]-0.175*chroma[indx+w+3][c]-0.075*chroma[indx+w+1][c]-0.075*chroma[indx+u+3][c]; chroma[indx][c]=(f[0]*g[0]+f[1]*g[1]+f[2]*g[2]+f[3]*g[3])/(f[0]+f[1]+f[2]+f[3]); } for (row=3; row<m_Height-3; row++) for (col=3+(FC(row,2)&1),indx=row*m_Width+col,c=FC(row,col+1)/2; col<u-3; col+=2,indx+=2) for(d=0;d<=1;c=1-c,d++){ f[0]=1.0/(float)(1.0+fabs(chroma[indx-u][c]-chroma[indx+u][c])+fabs(chroma[indx-u][c]-chroma[indx-w][c])+fabs(chroma[indx+u][c]-chroma[indx-w][c])); f[1]=1.0/(float)(1.0+fabs(chroma[indx+1][c]-chroma[indx-1][c])+fabs(chroma[indx+1][c]-chroma[indx+3][c])+fabs(chroma[indx-1][c]-chroma[indx+3][c])); f[2]=1.0/(float)(1.0+fabs(chroma[indx-1][c]-chroma[indx+1][c])+fabs(chroma[indx-1][c]-chroma[indx-3][c])+fabs(chroma[indx+1][c]-chroma[indx-3][c])); f[3]=1.0/(float)(1.0+fabs(chroma[indx+u][c]-chroma[indx-u][c])+fabs(chroma[indx+u][c]-chroma[indx+w][c])+fabs(chroma[indx-u][c]-chroma[indx+w][c])); g[0]=0.875*chroma[indx-u][c]+0.125*chroma[indx-w][c]; g[1]=0.875*chroma[indx+1][c]+0.125*chroma[indx+3][c]; g[2]=0.875*chroma[indx-1][c]+0.125*chroma[indx-3][c]; g[3]=0.875*chroma[indx+u][c]+0.125*chroma[indx+w][c]; chroma[indx][c]=(f[0]*g[0]+f[1]*g[1]+f[2]*g[2]+f[3]*g[3])/(f[0]+f[1]+f[2]+f[3]); } for(row=3; row<m_Height-3; row++) for(col=3,indx=row*m_Width+col; col<m_Width-3; col++,indx++){ m_Image[indx][0]=CLIP(chroma[indx][0]+m_Image[indx][1]); m_Image[indx][2]=CLIP(chroma[indx][1]+m_Image[indx][1]); } free(chroma); } // green is used to create // an interpolation direction map // 1 = vertical // 0 = horizontal // saved in m_Image[][3] void CLASS dcb_map() { int row, col, u=m_Width, indx; for (row=2; row < m_Height-2; row++) { for (col=2, indx=row*m_Width+col; col < m_Width-2; col++, indx++) { if (m_Image[indx][1] > ( m_Image[indx-1][1] + m_Image[indx+1][1] + m_Image[indx-u][1] + m_Image[indx+u][1])/4.0) m_Image[indx][3] = ((MIN( m_Image[indx-1][1], m_Image[indx+1][1]) + m_Image[indx-1][1] + m_Image[indx+1][1] ) < (MIN( m_Image[indx-u][1], m_Image[indx+u][1]) + m_Image[indx-u][1] + m_Image[indx+u][1])); else m_Image[indx][3] = ((MAX( m_Image[indx-1][1], m_Image[indx+1][1]) + m_Image[indx-1][1] + m_Image[indx+1][1] ) > (MAX( m_Image[indx-u][1], m_Image[indx+u][1]) + m_Image[indx-u][1] + m_Image[indx+u][1])) ; } } } // interpolated green pixels are corrected using the map void CLASS dcb_correction() { int current, row, col, c, u=m_Width, v=2*u, indx; for (row=4; row < m_Height-4; row++) { for (col=4, indx=row*m_Width+col; col < m_Width-4; col++, indx++) { c = FC(row,col); if (c != 1) { current = 4*m_Image[indx][3] + 2*(m_Image[indx+u][3] + m_Image[indx-u][3] + m_Image[indx+1][3] + m_Image[indx-1][3]) + m_Image[indx+v][3] + m_Image[indx-v][3] + m_Image[indx+2][3] + m_Image[indx-2][3]; m_Image[indx][1] = ((16-current)*(m_Image[indx-1][1] + m_Image[indx+1][1])/2.0 + current*(m_Image[indx-u][1] + m_Image[indx+u][1])/2.0)/16.0; } } } } // interpolated green pixels are corrected using the map // with correction void CLASS dcb_correction2() { int current, row, col, c, u=m_Width, v=2*u, indx; for (row=4; row < m_Height-4; row++) { for (col=4, indx=row*m_Width+col; col < m_Width-4; col++, indx++) { c = FC(row,col); if (c != 1) { current = 4*m_Image[indx][3] + 2*(m_Image[indx+u][3] + m_Image[indx-u][3] + m_Image[indx+1][3] + m_Image[indx-1][3]) + m_Image[indx+v][3] + m_Image[indx-v][3] + m_Image[indx+2][3] + m_Image[indx-2][3]; m_Image[indx][1] = CLIP(((16-current)*((m_Image[indx-1][1] + m_Image[indx+1][1])/2.0 + m_Image[indx][c] - (m_Image[indx+2][c] + m_Image[indx-2][c])/2.0) + current*((m_Image[indx-u][1] + m_Image[indx+u][1])/2.0 + m_Image[indx][c] - (m_Image[indx+v][c] + m_Image[indx-v][c])/2.0))/16.0); } } } } // m_Image refinement void CLASS dcb_refinement() { int row, col, c, u=m_Width, v=2*u,indx, max, min; float f[4], g[4]; for (row=5; row < m_Height-5; row++) for (col=5+(FC(row,1)&1),indx=row*m_Width+col,c=FC(row,col); col < u-5; col+=2,indx+=2) { // Cubic Spline Interpolation by Li and Randhawa, modified by Jacek Gozdz and Luis Sanz RodrÃguez f[0]=1.0/(1.0+abs(m_Image[indx-u][c]-m_Image[indx][c])+abs(m_Image[indx-u][1]-m_Image[indx][1])); f[1]=1.0/(1.0+abs(m_Image[indx+1][c]-m_Image[indx][c])+abs(m_Image[indx+1][1]-m_Image[indx][1])); f[2]=1.0/(1.0+abs(m_Image[indx-1][c]-m_Image[indx][c])+abs(m_Image[indx-1][1]-m_Image[indx][1])); f[3]=1.0/(1.0+abs(m_Image[indx+u][c]-m_Image[indx][c])+abs(m_Image[indx+u][1]-m_Image[indx][1])); g[0]=CLIP(m_Image[indx-u][1]+0.5*(m_Image[indx][c]-m_Image[indx-u][c]) + 0.25*(m_Image[indx][c]-m_Image[indx-v][c])); g[1]=CLIP(m_Image[indx+1][1]+0.5*(m_Image[indx][c]-m_Image[indx+1][c]) + 0.25*(m_Image[indx][c]-m_Image[indx+2][c])); g[2]=CLIP(m_Image[indx-1][1]+0.5*(m_Image[indx][c]-m_Image[indx-1][c]) + 0.25*(m_Image[indx][c]-m_Image[indx-2][c])); g[3]=CLIP(m_Image[indx+u][1]+0.5*(m_Image[indx][c]-m_Image[indx+u][c]) + 0.25*(m_Image[indx][c]-m_Image[indx+v][c])); m_Image[indx][1]=CLIP(((f[0]*g[0]+f[1]*g[1]+f[2]*g[2]+f[3]*g[3])/(f[0]+f[1]+f[2]+f[3]) )); // get rid of the overshooted pixels min = MIN(m_Image[indx+1+u][1], MIN(m_Image[indx+1-u][1], MIN(m_Image[indx-1+u][1], MIN(m_Image[indx-1-u][1], MIN(m_Image[indx-1][1], MIN(m_Image[indx+1][1], MIN(m_Image[indx-u][1], m_Image[indx+u][1]))))))); max = MAX(m_Image[indx+1+u][1], MAX(m_Image[indx+1-u][1], MAX(m_Image[indx-1+u][1], MAX(m_Image[indx-1-u][1], MAX(m_Image[indx-1][1], MAX(m_Image[indx+1][1], MAX(m_Image[indx-u][1], m_Image[indx+u][1]))))))); m_Image[indx][1] = ULIM(m_Image[indx][1], max, min); } } /* m_Image[indx][0] = CLIP(65536.0*(1.0 - (1.0-m_Image[indx][0]/65536.0)*(1.0-m_Image[indx][0]/65536.0))); m_Image[indx][1] = CLIP(65536.0*(1.0 - (1.0-m_Image[indx][1]/65536.0)*(1.0-m_Image[indx][1]/65536.0))); m_Image[indx][2] = CLIP(65536.0*(1.0 - (1.0-m_Image[indx][2]/65536.0)*(1.0-m_Image[indx][2]/65536.0))); */ // converts RGB to LCH colorspace and saves it to m_Image3 void CLASS rgb_to_lch(double (*m_Image3)[3]) { int indx; for (indx=0; indx < m_Height*m_Width; indx++) { m_Image3[indx][0] = m_Image[indx][0] + m_Image[indx][1] + m_Image[indx][2]; // L m_Image3[indx][1] = 1.732050808 *(m_Image[indx][0] - m_Image[indx][1]); // C m_Image3[indx][2] = 2.0*m_Image[indx][2] - m_Image[indx][0] - m_Image[indx][1]; // H } } // converts LCH to RGB colorspace and saves it back to m_Image void CLASS lch_to_rgb(double (*m_Image3)[3]) { int indx; for (indx=0; indx < m_Height*m_Width; indx++) { m_Image[indx][0] = CLIP(m_Image3[indx][0] / 3.0 - m_Image3[indx][2] / 6.0 + m_Image3[indx][1] / 3.464101615); m_Image[indx][1] = CLIP(m_Image3[indx][0] / 3.0 - m_Image3[indx][2] / 6.0 - m_Image3[indx][1] / 3.464101615); m_Image[indx][2] = CLIP(m_Image3[indx][0] / 3.0 + m_Image3[indx][2] / 3.0); } } // fast green interpolation void CLASS fbdd_green2() { int row, col, c, u=m_Width, v=2*u, w=3*u, indx, current, min, max, g1, g2; for (row=4; row < m_Height-4; row++) { for (col=4, indx=row*m_Width+col; col < m_Width-4; col++, indx++) { c = fc(row,col); if(c != 1) { current = m_Image[indx][c] - (m_Image[indx+v][c] + m_Image[indx-v][c] + m_Image[indx-2][c] + m_Image[indx+2][c])/4.0; g2 = (m_Image[indx+u][1] + m_Image[indx-u][1] + m_Image[indx-1][1] + m_Image[indx+1][1])/4.0; g1 = (m_Image[indx+w][1] + m_Image[indx-w][1] + m_Image[indx-3][1] + m_Image[indx+3][1])/4.0; m_Image[indx][1] = CLIP((g2+g1)/2.0 + current); min = MIN(m_Image[indx-1][1], MIN(m_Image[indx+1][1], MIN(m_Image[indx-u][1], m_Image[indx+u][1]))); max = MAX(m_Image[indx-1][1], MAX(m_Image[indx+1][1], MAX(m_Image[indx-u][1], m_Image[indx+u][1]))); m_Image[indx][1] = ULIM(m_Image[indx][1], max, min); } } } } // denoising using interpolated neighbours void CLASS fbdd_correction() { int row, col, c, u=m_Width, indx; for (row=2; row < m_Height-2; row++) { for (col=2, indx=row*m_Width+col; col < m_Width-2; col++, indx++) { c = fc(row,col); m_Image[indx][c] = ULIM(m_Image[indx][c], MAX(m_Image[indx-1][c], MAX(m_Image[indx+1][c], MAX(m_Image[indx-u][c], m_Image[indx+u][c]))), MIN(m_Image[indx-1][c], MIN(m_Image[indx+1][c], MIN(m_Image[indx-u][c], m_Image[indx+u][c])))); } } } // corrects chroma noise void CLASS fbdd_correction2(double (*m_Image3)[3]) { int indx, v=2*m_Width; double Co, Ho, ratio; for (indx=2+v; indx < m_Height*m_Width-(2+v); indx++) { if ( m_Image3[indx][1]*m_Image3[indx][2] != 0 ) { Co = (m_Image3[indx+v][1] + m_Image3[indx-v][1] + m_Image3[indx-2][1] + m_Image3[indx+2][1] - MAX(m_Image3[indx-2][1], MAX(m_Image3[indx+2][1], MAX(m_Image3[indx-v][1], m_Image3[indx+v][1]))) - MIN(m_Image3[indx-2][1], MIN(m_Image3[indx+2][1], MIN(m_Image3[indx-v][1], m_Image3[indx+v][1]))))/2.0; Ho = (m_Image3[indx+v][2] + m_Image3[indx-v][2] + m_Image3[indx-2][2] + m_Image3[indx+2][2] - MAX(m_Image3[indx-2][2], MAX(m_Image3[indx+2][2], MAX(m_Image3[indx-v][2], m_Image3[indx+v][2]))) - MIN(m_Image3[indx-2][2], MIN(m_Image3[indx+2][2], MIN(m_Image3[indx-v][2], m_Image3[indx+v][2]))))/2.0; ratio = sqrt ((Co*Co+Ho*Ho) / (m_Image3[indx][1]*m_Image3[indx][1] + m_Image3[indx][2]*m_Image3[indx][2])); if (ratio < 0.85){ m_Image3[indx][1] = Co; m_Image3[indx][2] = Ho; } } } } // Cubic Spline Interpolation by Li and Randhawa, modified by Jacek Gozdz and Luis Sanz RodrÃguez void CLASS fbdd_green() { int row, col, c, u=m_Width, v=2*u, w=3*u, x=4*u, y=5*u, indx, min, max; float f[4], g[4]; for (row=5; row < m_Height-5; row++) for (col=5+(FC(row,1)&1),indx=row*m_Width+col,c=FC(row,col); col < u-5; col+=2,indx+=2) { f[0]=1.0/(1.0+abs(m_Image[indx-u][1]-m_Image[indx-w][1])+abs(m_Image[indx-w][1]-m_Image[indx+y][1])); f[1]=1.0/(1.0+abs(m_Image[indx+1][1]-m_Image[indx+3][1])+abs(m_Image[indx+3][1]-m_Image[indx-5][1])); f[2]=1.0/(1.0+abs(m_Image[indx-1][1]-m_Image[indx-3][1])+abs(m_Image[indx-3][1]-m_Image[indx+5][1])); f[3]=1.0/(1.0+abs(m_Image[indx+u][1]-m_Image[indx+w][1])+abs(m_Image[indx+w][1]-m_Image[indx-y][1])); g[0]=CLIP((23*m_Image[indx-u][1]+23*m_Image[indx-w][1]+2*m_Image[indx-y][1]+8*(m_Image[indx-v][c]-m_Image[indx-x][c])+40*(m_Image[indx][c]-m_Image[indx-v][c]))/48.0); g[1]=CLIP((23*m_Image[indx+1][1]+23*m_Image[indx+3][1]+2*m_Image[indx+5][1]+8*(m_Image[indx+2][c]-m_Image[indx+4][c])+40*(m_Image[indx][c]-m_Image[indx+2][c]))/48.0); g[2]=CLIP((23*m_Image[indx-1][1]+23*m_Image[indx-3][1]+2*m_Image[indx-5][1]+8*(m_Image[indx-2][c]-m_Image[indx-4][c])+40*(m_Image[indx][c]-m_Image[indx-2][c]))/48.0); g[3]=CLIP((23*m_Image[indx+u][1]+23*m_Image[indx+w][1]+2*m_Image[indx+y][1]+8*(m_Image[indx+v][c]-m_Image[indx+x][c])+40*(m_Image[indx][c]-m_Image[indx+v][c]))/48.0); m_Image[indx][1]=CLIP((f[0]*g[0]+f[1]*g[1]+f[2]*g[2]+f[3]*g[3])/(f[0]+f[1]+f[2]+f[3])); min = MIN(m_Image[indx+1+u][1], MIN(m_Image[indx+1-u][1], MIN(m_Image[indx-1+u][1], MIN(m_Image[indx-1-u][1], MIN(m_Image[indx-1][1], MIN(m_Image[indx+1][1], MIN(m_Image[indx-u][1], m_Image[indx+u][1]))))))); max = MAX(m_Image[indx+1+u][1], MAX(m_Image[indx+1-u][1], MAX(m_Image[indx-1+u][1], MAX(m_Image[indx-1-u][1], MAX(m_Image[indx-1][1], MAX(m_Image[indx+1][1], MAX(m_Image[indx-u][1], m_Image[indx+u][1]))))))); m_Image[indx][1] = ULIM(m_Image[indx][1], max, min); } } // red and blue interpolation by Luis Sanz RodrÃguez void CLASS fbdd_color() { int row,col,c,d,u=m_Width,w=3*u,indx,(*chroma)[2]; float f[4]; chroma = (int (*)[2]) calloc(m_Width*m_Height,sizeof *chroma); merror (chroma, "fbdd_color2()"); for (row=2; row < m_Height-2; row++) for (col=2+(FC(row,2)&1),indx=row*m_Width+col,c=FC(row,col),d=c/2; col<u-2; col+=2,indx+=2) chroma[indx][d]=m_Image[indx][c]-m_Image[indx][1]; for (row=3; row<m_Height-3; row++) for (col=3+(FC(row,1)&1),indx=row*m_Width+col,d=1-FC(row,col)/2,c=2*d; col<u-3; col+=2,indx+=2) { f[0]=1.0/(1.0+abs(chroma[indx-u-1][d]-chroma[indx+u+1][d])+abs(chroma[indx-u-1][d]-chroma[indx-w-3][d])+abs(chroma[indx+u+1][d]-chroma[indx-w-3][d])); f[1]=1.0/(1.0+abs(chroma[indx-u+1][d]-chroma[indx+u-1][d])+abs(chroma[indx-u+1][d]-chroma[indx-w+3][d])+abs(chroma[indx+u-1][d]-chroma[indx-w+3][d])); f[2]=1.0/(1.0+abs(chroma[indx+u-1][d]-chroma[indx-u+1][d])+abs(chroma[indx+u-1][d]-chroma[indx+w+3][d])+abs(chroma[indx-u+1][d]-chroma[indx+w-3][d])); f[3]=1.0/(1.0+abs(chroma[indx+u+1][d]-chroma[indx-u-1][d])+abs(chroma[indx+u+1][d]-chroma[indx+w-3][d])+abs(chroma[indx-u-1][d]-chroma[indx+w+3][d])); chroma[indx][d]=(f[0]*chroma[indx-u-1][d]+f[1]*chroma[indx-u+1][d]+f[2]*chroma[indx+u-1][d]+f[3]*chroma[indx+u+1][d])/(f[0]+f[1]+f[2]+f[3]); m_Image[indx][c]=CLIP(chroma[indx][d]+m_Image[indx][1]); } for (row=3; row<m_Height-3; row++) for (col=3+(FC(row,2)&1),indx=row*m_Width+col; col<u-3; col+=2,indx+=2) for(c=d=0;d<=1;c+=2,d++){ f[0]=1.0/(1.0+abs(chroma[indx-u][d]-chroma[indx+u][d])+abs(chroma[indx-u][d]-chroma[indx-w][d])+abs(chroma[indx+u][d]-chroma[indx-w][d])); f[1]=1.0/(1.0+abs(chroma[indx+1][d]-chroma[indx-1][d])+abs(chroma[indx+1][d]-chroma[indx+3][d])+abs(chroma[indx-1][d]-chroma[indx+3][d])); f[2]=1.0/(1.0+abs(chroma[indx-1][d]-chroma[indx+1][d])+abs(chroma[indx-1][d]-chroma[indx-3][d])+abs(chroma[indx+1][d]-chroma[indx-3][d])); f[3]=1.0/(1.0+abs(chroma[indx+u][d]-chroma[indx-u][d])+abs(chroma[indx+u][d]-chroma[indx+w][d])+abs(chroma[indx-u][d]-chroma[indx+w][d])); m_Image[indx][c]=CLIP((f[0]*chroma[indx-u][d]+f[1]*chroma[indx+1][d]+f[2]*chroma[indx-1][d]+f[3]*chroma[indx+u][d])/(f[0]+f[1]+f[2]+f[3])+m_Image[indx][1]); } free(chroma); } // FBDD (Fake Before Demosaicing Denoising) void CLASS fbdd(const short noiserd) { double (*m_Image3)[3]; m_Image3 = (double (*)[3]) calloc(m_Width*m_Height, sizeof *m_Image3); BorderInterpolate(4); if (noiserd>1) { TRACEKEYVALS("FBDD full noise rduction","%s",""); fbdd_green(); fbdd_color(); fbdd_correction(); dcb_color(); rgb_to_lch(m_Image3); fbdd_correction2(m_Image3); fbdd_correction2(m_Image3); lch_to_rgb(m_Image3); fbdd_green(); fbdd_color(); fbdd_correction(); } else { TRACEKEYVALS("FBDD noise reduction","%s",""); fbdd_green(); fbdd_color(); fbdd_correction(); } } // DCB demosaicing main routine (sharp version) void CLASS DCBInterpolate(const short Iterations, const short dcb_enhance) { float (*m_Image2)[3]; m_Image2 = (float (*)[3]) calloc(m_Width*m_Height, sizeof *m_Image2); TRACEKEYVALS("DCB demosaicing","%s",""); BorderInterpolate(2); copy_to_buffer(m_Image2); hid(); dcb_color(); for (short i=0; i<Iterations; i++) { TRACEKEYVALS("DCB correction pass","%d",i); hid2(); hid2(); hid2(); dcb_map(); dcb_correction(); } dcb_color(); dcb_pp(); hid2(); hid2(); hid2(); TRACEKEYVALS("Finishing DCB","%s",""); dcb_map(); dcb_correction2(); restore_from_buffer(m_Image2); dcb_map(); dcb_correction(); dcb_color(); dcb_pp(); dcb_map(); dcb_correction(); dcb_map(); dcb_correction(); restore_from_buffer(m_Image2); dcb_color(); if (dcb_enhance) { TRACEKEYVALS("Optional DCB refinement","%s",""); dcb_refinement(); dcb_color_full(); } free(m_Image2); } |