From feacd2164600d4bd6ead25b407523474c76e929a Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sat, 31 Jul 2021 22:33:15 +0300 Subject: [PATCH 1/3] kimgio: handle RAW format via magick plugin Signed-off-by: Ivailo Monev --- kimgio/CMakeLists.txt | 1 + kimgio/README | 1 + kimgio/x-dcraw.desktop | 7 +++++++ kio/kio/kimageio.h | 1 + 4 files changed, 10 insertions(+) create mode 100644 kimgio/x-dcraw.desktop diff --git a/kimgio/CMakeLists.txt b/kimgio/CMakeLists.txt index ccb5571a..c645cba7 100644 --- a/kimgio/CMakeLists.txt +++ b/kimgio/CMakeLists.txt @@ -29,6 +29,7 @@ if(IMAGEMAGICK_FOUND) pcx.desktop psd.desktop xcf.desktop + x-dcraw.desktop DESTINATION ${KDE4_SERVICES_INSTALL_DIR}/qimageioplugins ) endif(IMAGEMAGICK_FOUND) diff --git a/kimgio/README b/kimgio/README index 30e92aeb..60576698 100644 --- a/kimgio/README +++ b/kimgio/README @@ -16,3 +16,4 @@ JP2 PCX PSD XCF +RAW diff --git a/kimgio/x-dcraw.desktop b/kimgio/x-dcraw.desktop new file mode 100644 index 00000000..d0d12c65 --- /dev/null +++ b/kimgio/x-dcraw.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Service +X-KDE-ServiceTypes=QImageIOPlugins +X-KDE-ImageFormat=magick +X-KDE-MimeType=image/x-dcraw +X-KDE-Read=true +X-KDE-Write=false diff --git a/kio/kio/kimageio.h b/kio/kio/kimageio.h index da26786f..55d57521 100644 --- a/kio/kio/kimageio.h +++ b/kio/kio/kimageio.h @@ -31,6 +31,7 @@ * @li PSD \ * @li WEBP \ \ * @li XCF \ + * @li RAW \ * */ namespace KImageIO From 39d1fc86c47ce8580309cddb76e0d27c8b1285a0 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sat, 31 Jul 2021 22:56:10 +0300 Subject: [PATCH 2/3] kdcraw: now unused, removing it Signed-off-by: Ivailo Monev --- CMakeLists.txt | 12 - appveyor.yml | 2 +- cmake/modules/CMakeLists.txt | 1 - cmake/modules/FindKDE4Internal.cmake | 2 - cmake/modules/FindLibRaw.cmake | 42 - kdcraw/.gitignore | 2 - kdcraw/.krazy | 2 - kdcraw/AUTHORS | 15 - kdcraw/CMakeLists.txt | 64 - kdcraw/Messages.sh | 2 - kdcraw/TODO | 14 - kdcraw/icons/CMakeLists.txt | 25 - kdcraw/icons/hi128-app-kdcraw.png | Bin 14961 -> 0 bytes kdcraw/icons/hi32-app-kdcraw.png | Bin 1319 -> 0 bytes kdcraw/icons/hi48-app-kdcraw.png | Bin 3119 -> 0 bytes kdcraw/icons/hi64-app-kdcraw.png | Bin 4584 -> 0 bytes kdcraw/libkdcraw/CMakeLists.txt | 83 - kdcraw/libkdcraw/Mainpage.dox | 7 - kdcraw/libkdcraw/dcrawinfocontainer.cpp | 173 --- kdcraw/libkdcraw/dcrawinfocontainer.h | 158 -- kdcraw/libkdcraw/dcrawsettingswidget.cpp | 1332 ----------------- kdcraw/libkdcraw/dcrawsettingswidget.h | 127 -- kdcraw/libkdcraw/kdcraw.cpp | 593 -------- kdcraw/libkdcraw/kdcraw.h | 267 ---- kdcraw/libkdcraw/kdcraw_p.cpp | 692 --------- kdcraw/libkdcraw/kdcraw_p.h | 94 -- kdcraw/libkdcraw/rawdecodingsettings.cpp | 396 ----- kdcraw/libkdcraw/rawdecodingsettings.h | 375 ----- kdcraw/libkdcraw/rawfiles.h | 99 -- kdcraw/libkdcraw/rcombobox.cpp | 149 -- kdcraw/libkdcraw/rcombobox.h | 86 -- kdcraw/libkdcraw/rexpanderbox.cpp | 827 ---------- kdcraw/libkdcraw/rexpanderbox.h | 299 ---- kdcraw/libkdcraw/rnuminput.cpp | 239 --- kdcraw/libkdcraw/rnuminput.h | 125 -- kdcraw/libkdcraw/squeezedcombobox.cpp | 200 --- kdcraw/libkdcraw/squeezedcombobox.h | 165 -- kdcraw/libkdcraw/version.h.cmake | 33 - kdcraw/profiles/CMakeLists.txt | 31 - .../profiles/compatibleWithAdobeRGB1998.icc | Bin 580 -> 0 bytes kdcraw/profiles/prophoto.icm | Bin 1132 -> 0 bytes kdcraw/profiles/srgb-d65.icm | Bin 6924 -> 0 bytes kdcraw/profiles/widegamut.icm | Bin 2044 -> 0 bytes kdcraw/tests/CMakeLists.txt | 31 - kdcraw/tests/libinfo.cpp | 49 - kdcraw/tests/raw2png.cpp | 138 -- kdecore/kdebug.areas | 3 - kdecore/tests/kstandarddirstest.cpp | 10 +- 48 files changed, 6 insertions(+), 6958 deletions(-) delete mode 100644 cmake/modules/FindLibRaw.cmake delete mode 100644 kdcraw/.gitignore delete mode 100644 kdcraw/.krazy delete mode 100644 kdcraw/AUTHORS delete mode 100644 kdcraw/CMakeLists.txt delete mode 100644 kdcraw/Messages.sh delete mode 100644 kdcraw/TODO delete mode 100644 kdcraw/icons/CMakeLists.txt delete mode 100644 kdcraw/icons/hi128-app-kdcraw.png delete mode 100644 kdcraw/icons/hi32-app-kdcraw.png delete mode 100644 kdcraw/icons/hi48-app-kdcraw.png delete mode 100644 kdcraw/icons/hi64-app-kdcraw.png delete mode 100644 kdcraw/libkdcraw/CMakeLists.txt delete mode 100644 kdcraw/libkdcraw/Mainpage.dox delete mode 100644 kdcraw/libkdcraw/dcrawinfocontainer.cpp delete mode 100644 kdcraw/libkdcraw/dcrawinfocontainer.h delete mode 100644 kdcraw/libkdcraw/dcrawsettingswidget.cpp delete mode 100644 kdcraw/libkdcraw/dcrawsettingswidget.h delete mode 100644 kdcraw/libkdcraw/kdcraw.cpp delete mode 100644 kdcraw/libkdcraw/kdcraw.h delete mode 100644 kdcraw/libkdcraw/kdcraw_p.cpp delete mode 100644 kdcraw/libkdcraw/kdcraw_p.h delete mode 100644 kdcraw/libkdcraw/rawdecodingsettings.cpp delete mode 100644 kdcraw/libkdcraw/rawdecodingsettings.h delete mode 100644 kdcraw/libkdcraw/rawfiles.h delete mode 100644 kdcraw/libkdcraw/rcombobox.cpp delete mode 100644 kdcraw/libkdcraw/rcombobox.h delete mode 100644 kdcraw/libkdcraw/rexpanderbox.cpp delete mode 100644 kdcraw/libkdcraw/rexpanderbox.h delete mode 100644 kdcraw/libkdcraw/rnuminput.cpp delete mode 100644 kdcraw/libkdcraw/rnuminput.h delete mode 100644 kdcraw/libkdcraw/squeezedcombobox.cpp delete mode 100644 kdcraw/libkdcraw/squeezedcombobox.h delete mode 100644 kdcraw/libkdcraw/version.h.cmake delete mode 100644 kdcraw/profiles/CMakeLists.txt delete mode 100644 kdcraw/profiles/compatibleWithAdobeRGB1998.icc delete mode 100644 kdcraw/profiles/prophoto.icm delete mode 100644 kdcraw/profiles/srgb-d65.icm delete mode 100644 kdcraw/profiles/widegamut.icm delete mode 100644 kdcraw/tests/CMakeLists.txt delete mode 100644 kdcraw/tests/libinfo.cpp delete mode 100644 kdcraw/tests/raw2png.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e49209b..aa620be7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,17 +77,6 @@ set_package_properties(Exiv2 PROPERTIES PURPOSE "Required to build libkexiv2" ) -# NOTE: Libraw 0.16.x is prefered version to use because it's ported to Cmake -# with full features supported. Until libraw 0.16.0 is release (ends of 2013), -# we will support previous version (with limited support) -find_package(LibRaw 0.15) -set_package_properties(LibRaw PROPERTIES - DESCRIPTION "library that provides image Raw file demosaicing" - URL "http://www.libraw.org" - TYPE REQUIRED - PURPOSE "Required to build libkdcraw" -) - # optional features if(X11_FOUND) macro_bool_to_01(X11_XTest_FOUND HAVE_XTEST) @@ -341,7 +330,6 @@ add_subdirectory( cmake ) add_subdirectory( dnssd ) add_subdirectory( includes ) add_subdirectory( interfaces ) -add_subdirectory( kdcraw ) add_subdirectory( kdeclarative ) add_subdirectory( kdecore ) add_subdirectory( kded ) diff --git a/appveyor.yml b/appveyor.yml index 9a56eadd..8af10f4f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,7 +19,7 @@ build_script: sudo apt-get update -qq sudo apt-get install -qq cmake katie-dev libenchant-dev \ - libmagick++-dev libmpv-dev libraw-dev xorg-dev mesa-common-dev \ + libmagick++-dev libmpv-dev xorg-dev mesa-common-dev \ libavahi-common-dev krb5-multidev libwebp-dev \ libudev-dev liblzma-dev libexiv2-dev libilmbase-dev libjpeg-dev \ libbz2-dev libattr1-dev libacl1-dev libxcb-render-util0-dev \ diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt index b2972003..7473a154 100644 --- a/cmake/modules/CMakeLists.txt +++ b/cmake/modules/CMakeLists.txt @@ -7,7 +7,6 @@ set(module_install_dir ${KDE4_DATA_INSTALL_DIR}/cmake/modules) # to have it around, so there is a place where the modules which are not installed # are listed explicitly: set(cmakeFilesDontInstall - FindLibRaw.cmake FindMPV.cmake FindUDev.cmake FindAvahi.cmake diff --git a/cmake/modules/FindKDE4Internal.cmake b/cmake/modules/FindKDE4Internal.cmake index f0d9dcd3..2f4aa5f3 100644 --- a/cmake/modules/FindKDE4Internal.cmake +++ b/cmake/modules/FindKDE4Internal.cmake @@ -60,7 +60,6 @@ # KDE4_KNOTIFYCONFIG_LIBS - the knotify config library and all depending libraries # KDE4_KTEXTEDITOR_LIBS - the ktexteditor library and all depending libraries # KDE4_PLASMA_LIBS - the plasma library and all depending librairies -# KDE4_KDCRAW_LIBS - the kdcraw library and all depending libraries # KDE4_KEXIV2_LIBS - the kexiv2 library and all depending libraries # KDE4_KMEDIAPLAYER_LIBS - the kmediaplayer library and all depending libraries # @@ -284,7 +283,6 @@ endif(_kdeBootStrapping) set(_kde_libraries kmediaplayer kcmutils - kdcraw kdeclarative kdecore kdeui diff --git a/cmake/modules/FindLibRaw.cmake b/cmake/modules/FindLibRaw.cmake deleted file mode 100644 index c1b2e9fc..00000000 --- a/cmake/modules/FindLibRaw.cmake +++ /dev/null @@ -1,42 +0,0 @@ -# Try to find LibRaw library, once done this will define: -# -# LIBRAW_FOUND - system has LibRaw -# LIBRAW_INCLUDE_DIR - the LibRaw include directory -# LIBRAW_LIBRARIES - the libraries needed to use LibRaw -# LIBRAW_DEFINITIONS - compiler switches required for using LibRaw -# -# Copyright (c) 2021 Ivailo Monev -# -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. - -if(NOT WIN32) - include(FindPkgConfig) - pkg_check_modules(PC_LIBRAW QUIET libraw_r) - - set(LIBRAW_INCLUDE_DIR ${PC_LIBRAW_INCLUDE_DIRS}) - set(LIBRAW_LIBRARIES ${PC_LIBRAW_LIBRARIES}) -endif() - -set(LIBRAW_VERSION ${PC_LIBRAW_VERSION}) -set(LIBRAW_DEFINITIONS ${PC_LIBRAW_CFLAGS_OTHER}) - -if(NOT LIBRAW_INCLUDE_DIR OR NOT LIBRAW_LIBRARIES) - find_path(LIBRAW_INCLUDE_DIR - NAMES libraw.h - HINTS $ENV{LIBRAWDIR}/include - ) - - find_library(LIBRAW_LIBRARIES - NAMES raw_r - HINTS $ENV{LIBRAWDIR}/lib - ) -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(LibRaw - VERSION_VAR LIBRAW_VERSION - REQUIRED_VARS LIBRAW_LIBRARIES LIBRAW_INCLUDE_DIR -) - -mark_as_advanced(LIBRAW_INCLUDE_DIR LIBRAW_LIBRARIES) diff --git a/kdcraw/.gitignore b/kdcraw/.gitignore deleted file mode 100644 index 41554037..00000000 --- a/kdcraw/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.kate-swp -tests/databases/*/*.db diff --git a/kdcraw/.krazy b/kdcraw/.krazy deleted file mode 100644 index 70047a58..00000000 --- a/kdcraw/.krazy +++ /dev/null @@ -1,2 +0,0 @@ -SKIP /libraw/ - diff --git a/kdcraw/AUTHORS b/kdcraw/AUTHORS deleted file mode 100644 index 4ece2f5b..00000000 --- a/kdcraw/AUTHORS +++ /dev/null @@ -1,15 +0,0 @@ -AUTHORS AND MAINTAINERS : - -Caulier Gilles -Marcel Wiesweg - -CONTRIBUTORS: - -Angelo Naselli -Gerhard Kulzer -Achim Bohnet -Guillaume Castagnino - -THANKS: - -Alex Tutubalin from LibRaw project (http://www.libraw.org) \ No newline at end of file diff --git a/kdcraw/CMakeLists.txt b/kdcraw/CMakeLists.txt deleted file mode 100644 index e042dc71..00000000 --- a/kdcraw/CMakeLists.txt +++ /dev/null @@ -1,64 +0,0 @@ -# =========================================================== -# -# This file is a part of digiKam project -# http://www.digikam.org -# -# @date 2006-12-09 -# @brief a tread-safe libraw C++ program interface for KDE -# -# @author Copyright (C) 2006-2014 by Gilles Caulier -# caulier dot gilles at gmail dot com -# -# This program 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 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# ============================================================ - -PROJECT(libkdcraw) - -IF(EXISTS "${LIBRAW_INCLUDE_DIR}/libraw_config.h") - ADD_DEFINITIONS(-DLIBRAW_HAS_CONFIG) - MESSAGE(STATUS "LibRaw config file exists: yes") -ELSE() - MESSAGE(STATUS "LibRaw config file exists: no") -ENDIF() - -ADD_DEFINITIONS( - ${QT_QTDBUS_DEFINITIONS} - ${LIBRAW_DEFINITIONS} - -DKDE_DEFAULT_DEBUG_AREA=51002 -) - -INCLUDE_DIRECTORIES( - # for the export header - ${CMAKE_CURRENT_BINARY_DIR}/libkdcraw - ${QDBUS_INCLUDE_DIRS} - ${KDE4_KDECORE_INCLUDES} - ${KDE4_KIO_INCLUDES} - ${LIBRAW_INCLUDE_DIR} -) - -# ================================================================================================== -# Set env. variables accordinly. - -SET(DCRAW_LIB_VERSION_STRING "${KDE_VERSION_MAJOR}.${KDE_VERSION_MINOR}.${KDE_VERSION_RELEASE}") -SET(DCRAW_LIB_VERSION_ID "0x0${KDE_VERSION_MAJOR}0${KDE_VERSION_MINOR}0${KDE_VERSION_RELEASE}") -SET(DCRAW_LIB_SO_VERSION_STRING "${DCRAW_LIB_VERSION_STRING}") - -# ================================================================================================== - -ADD_SUBDIRECTORY(libkdcraw) -ADD_SUBDIRECTORY(icons) -ADD_SUBDIRECTORY(profiles) - -IF(ENABLE_TESTING) - ADD_SUBDIRECTORY(tests) -ENDIF() diff --git a/kdcraw/Messages.sh b/kdcraw/Messages.sh deleted file mode 100644 index 67c0af4b..00000000 --- a/kdcraw/Messages.sh +++ /dev/null @@ -1,2 +0,0 @@ -#! /bin/sh -$XGETTEXT libkdcraw/*.cpp -o $podir/libkdcraw.pot diff --git a/kdcraw/TODO b/kdcraw/TODO deleted file mode 100644 index 9d92a09c..00000000 --- a/kdcraw/TODO +++ /dev/null @@ -1,14 +0,0 @@ -- Add DNG writting mode support using Adobe DNG sdk - -- Libraw 0.13.0 features to support : - -1) Green channel local averaging. All interpolation methods, but may conflict with green_matching option, so it is safer to use only one green averaging. - - int cfa_green; Boolean, default is 0 (off) - float green_threshold; - Sensitivity of method (green is averaged if difference less than this value in percent). Usable range between 0.01 and 0.1, commonly 0.03 - -This filtering is applied *before* demosaic. - -The problem is simple: on some cameras (for example, Olympus E-xxx) two green channels are different (in sensitivity and, may be, in spectral response). -As a result, it produces 'maze artifacts' on flat surfaces (like sky). -The solution is simple: if two channels are *slightly* different in some local area, it is better to equalize it. diff --git a/kdcraw/icons/CMakeLists.txt b/kdcraw/icons/CMakeLists.txt deleted file mode 100644 index 1a620f37..00000000 --- a/kdcraw/icons/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -# =========================================================== -# -# This file is a part of digiKam project -# http://www.digikam.org -# -# @date 2006-12-09 -# @brief a tread-safe libraw C++ program interface for KDE -# -# @author Copyright (C) 2006-2012 by Gilles Caulier -# caulier dot gilles at gmail dot com -# -# This program 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 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# ============================================================ - -kde4_install_icons(${KDE4_ICON_INSTALL_DIR}) diff --git a/kdcraw/icons/hi128-app-kdcraw.png b/kdcraw/icons/hi128-app-kdcraw.png deleted file mode 100644 index fccf56277f95768fc16fb309d9eaae412a482de3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14961 zcmaKTQ*b3r7j1ZA+qP{^II(R{>=S!p+mneWwr$(CZJpfjuex;~??bPy+O@l@yZ2hv zj#O5ZMuNwO2Ll5`l9iEA{VxyvUxEevhXcYU6JTKcys{Ev>cI8Ob(j>5BfOfslbo|u zI@XX!hGbTKXvbtTIkCWtBQo{KzO%blmyVfA_v75ImzI+R8S+TVr2jA6_u%z?iLJE;7=5SZ zC(4+Dq01tQl1GBS9^K`y;&x(ek`UrZtbSL*#c-til}hUG@Q86n%+wsb3mflb;;ndU zn1cBWf)KEwZ9d)Bp|1zh{^+CT7wvYmZc~f-rU8b_(Fae4TJtC{AZx!NZ#8bcZryi< z^?Q|0JcC5`IiGW-58j6duax3)6JuP(^^Fv3Ian<{l{0VyzeoZtQ%W>%#Wz7qpASWV z3y6S0wMzk=xi`wYP49GLvf6tE<$i77W1-LuI z)*cRb{-A*xu0)LSVynKX?_~!i;079TgH?fsz%y`GM3^&(w6X~YX*gEVRaGRJ$7J#;j4f=5+##brt6w67bgj0JjePQL7bHrhMx~QnchdM z#e*5db$KbPfx1#e=x;iZ3HXgWBQ6e5B6$l3-uZM7x;ukcwgiJGEzUwb!{<#Ci`&sl z%q(gj?xL4mOb4#$Z)2}48BZ895P7i|BuX~NgI66UBG)9EBj-QH7q4TMywl5th$|Ej z84tkG-+I`=IzkZMPRelt46zVu>=hBu}3IT0!40Vz8>k`n_Kg;ClC)-oYVj41hMfzr`6HP{O8MJ z1kD(+(L*g0cX5XP%3&9cq`QU~f3b#-`=G3U19#_V@ySK{-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Ap=^lpG8YK@tpry@t%)5&}^!lOuRF1Va8l@n7)s;EIg588-j`002ov JPDHLkV1hD$@<0Fp diff --git a/kdcraw/icons/hi64-app-kdcraw.png b/kdcraw/icons/hi64-app-kdcraw.png deleted file mode 100644 index 6165c988b06d85df4b722030b9a92e51fa409404..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4584 zcmVP)&}0uqJ$y|V6Is|e|id95pwEdN^n+W*;g&RJdioPEx|xA_j= z;X8bX@9-UVf6SiEHwW20VTSHX0Ic;xP)q;Y4uivPt7FXWieNVjfID$Ba5oV9ioSP| zLC?td5gA+<`Q9RfD)@Z)^?fbA&9(TpNA0qCyJGE$QJ+yMEX@SSQ+^y?KDTz$PNdxcbzx&hu6lszw}SFx~HFBP2c%_ zYaR2?!diG0e~T57|CBm{G&X9#2pkn@BD)+oBhvQ(9CA~*YPAul;|ptZr+<9)>CT6aO+x57)2{{ljs_7!tI z4^U?c1m9!;g3#`^2q2=nGV0*p)7txo0jPb> zzrg?m-&z17+d_WM!@To$)x{4SeVg#=u}}PZ!`!!Sxn(XVKQ-4N7a}cXHaoD08 zMbHJHkk;$Lv9)()>~({E1tH`Q$mnB1dWHHYAlHYw?z|1Yy#SnmkmeN9P}(g#kMd(? z(LoB1?bok2FlF-N^XAud-gC)=w@a@_D8Aycb(T&-7%U*YJBOBTG8Lh9*d9_I+Wg#I zetgI`*Zy=zRLXuk0hrE=v<)sDyeCV?eA28%8~+H>qGfs&Z^~~WVC;ZAuK|JN{Q(At zeI_8UVHXJXS=fiXv@Sof-2EbdDOkwPS5`(Z3n~TwwE^&m4eSN@2Py798ajS51rpBe z(b-O%BAsen`ph*JQYIrV@TXG?gkdrSzj)&lizt*94>+?N;RgavMh{8 zG?z;eiampv{3RhIJ^xGn=}hD7VX!QafY|V(0~q`ny>oUD1pwTInE>pmA`Sr`N9f)Hu&dtG9#{vzf>H?2Mmh|y#<05g`1g^z&X zp9z5fT;=xElN}C@>9q4%y7{v}d3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$XZlR*6WZ3`W%)=J z7Ns~Hn$k7 zigz{%3Hja@xxGMm++tcv^;Ds;(D6>71<)Hhr^pm;-g`pYa_JNTj)WyC&7_!#4gfF%+kqss`fEHo{FOP+^Sz`I}abNCG~ivy`> zBxxK*c(QCD18dX$M)1v}0^kTjhttp://www.digikam.org -# -# @date 2006-12-09 -# @brief a tread-safe libraw C++ program interface for KDE -# -# @author Copyright (C) 2006-2013 by Gilles Caulier -# caulier dot gilles at gmail dot com -# -# This program 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 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# ============================================================ - -add_definitions(${KDE4_ENABLE_EXCEPTIONS}) - -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/version.h.cmake - ${CMAKE_CURRENT_BINARY_DIR}/version.h -) - -set(kdcraw_LIB_SRCS - kdcraw.cpp - kdcraw_p.cpp - dcrawsettingswidget.cpp - dcrawinfocontainer.cpp - rawdecodingsettings.cpp - rcombobox.cpp - rnuminput.cpp - rexpanderbox.cpp - squeezedcombobox.cpp -) - -add_library(kdcraw ${LIBRARY_TYPE} ${kdcraw_LIB_SRCS}) - -target_link_libraries(kdcraw PRIVATE - ${LIBRAW_LIBRARIES} -) - -target_link_libraries(kdcraw PUBLIC - ${KDE4_KDEUI_LIBS} - ${KDE4_KIO_LIBS} -) - -set_target_properties(kdcraw PROPERTIES - VERSION ${GENERIC_LIB_VERSION} - SOVERSION ${GENERIC_LIB_SOVERSION} -) - -install( - TARGETS kdcraw - EXPORT kdelibsLibraryTargets - ${INSTALL_TARGETS_DEFAULT_ARGS} -) - -generate_export_header(kdcraw) - -install( - FILES - rawdecodingsettings.h - kdcraw.h - dcrawsettingswidget.h - rnuminput.h - rcombobox.h - rexpanderbox.h - squeezedcombobox.h - dcrawinfocontainer.h - rawfiles.h - ${CMAKE_CURRENT_BINARY_DIR}/kdcraw_export.h - ${CMAKE_CURRENT_BINARY_DIR}/version.h - DESTINATION ${KDE4_INCLUDE_INSTALL_DIR}/libkdcraw - COMPONENT Devel -) diff --git a/kdcraw/libkdcraw/Mainpage.dox b/kdcraw/libkdcraw/Mainpage.dox deleted file mode 100644 index 7b96e9e5..00000000 --- a/kdcraw/libkdcraw/Mainpage.dox +++ /dev/null @@ -1,7 +0,0 @@ -/** @mainpage libKDcraw - -libKDcraw is a thread-safe wrapper around libraw. Have a look at KDcrawIface::KDcraw to get started. - -@see KDcrawIface::KDcraw - - */ diff --git a/kdcraw/libkdcraw/dcrawinfocontainer.cpp b/kdcraw/libkdcraw/dcrawinfocontainer.cpp deleted file mode 100644 index c2e2d8a7..00000000 --- a/kdcraw/libkdcraw/dcrawinfocontainer.cpp +++ /dev/null @@ -1,173 +0,0 @@ -/** =========================================================== - * @file - * - * This file is a part of digiKam project - * http://www.digikam.org - * - * @date 2007-05-02 - * @brief RAW file identification information container - * - * @author Copyright (C) 2007-2013 by Gilles Caulier - * caulier dot gilles at gmail dot com - * - * This program 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 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * ============================================================ */ - -// Local includes - -#include "dcrawinfocontainer.h" - -namespace KDcrawIface -{ - -DcrawInfoContainer::DcrawInfoContainer() -{ - sensitivity = -1.0; - exposureTime = -1.0; - aperture = -1.0; - focalLength = -1.0; - pixelAspectRatio = 1.0; // Default value. This can be unavailable (depending of camera model). - rawColors = -1; - rawImages = -1; - hasIccProfile = false; - isDecodable = false; - daylightMult[0] = 0.0; - daylightMult[1] = 0.0; - daylightMult[2] = 0.0; - cameraMult[0] = 0.0; - cameraMult[1] = 0.0; - cameraMult[2] = 0.0; - cameraMult[3] = 0.0; - blackPoint = 0; - - for (int ch=0; ch<4; ch++) - { - blackPointCh[ch] = 0; - } - - whitePoint = 0; - topMargin = 0; - leftMargin = 0; - orientation = ORIENTATION_NONE; - - for (int x=0 ; x<3 ; x++) - { - for (int y=0 ; y<4 ; y++) - { - cameraColorMatrix1[x][y] = 0.0; - cameraColorMatrix2[x][y] = 0.0; - cameraXYZMatrix[y][x] = 0.0; // NOTE: see B.K.O # 253911 : [y][x] not [x][y] - } - } -} - -DcrawInfoContainer::~DcrawInfoContainer() -{ -} - -bool DcrawInfoContainer::isEmpty() -{ - if (make.isEmpty() && - model.isEmpty() && - filterPattern.isEmpty() && - colorKeys.isEmpty() && - DNGVersion.isEmpty() && - exposureTime == -1.0 && - aperture == -1.0 && - focalLength == -1.0 && - pixelAspectRatio == 1.0 && - sensitivity == -1.0 && - rawColors == -1 && - rawImages == -1 && - blackPoint == 0 && - blackPointCh[0] == 0 && - blackPointCh[1] == 0 && - blackPointCh[2] == 0 && - blackPointCh[3] == 0 && - whitePoint == 0 && - topMargin == 0 && - leftMargin == 0 && - !dateTime.isValid() && - !imageSize.isValid() && - !fullSize.isValid() && - !outputSize.isValid() && - !thumbSize.isValid() && - cameraColorMatrix1[0][0] == 0.0 && - cameraColorMatrix1[0][1] == 0.0 && - cameraColorMatrix1[0][2] == 0.0 && - cameraColorMatrix1[0][3] == 0.0 && - cameraColorMatrix1[1][0] == 0.0 && - cameraColorMatrix1[1][1] == 0.0 && - cameraColorMatrix1[1][2] == 0.0 && - cameraColorMatrix1[1][3] == 0.0 && - cameraColorMatrix1[2][0] == 0.0 && - cameraColorMatrix1[2][1] == 0.0 && - cameraColorMatrix1[2][2] == 0.0 && - cameraColorMatrix1[2][3] == 0.0 && - cameraColorMatrix2[0][0] == 0.0 && - cameraColorMatrix2[0][1] == 0.0 && - cameraColorMatrix2[0][2] == 0.0 && - cameraColorMatrix2[0][3] == 0.0 && - cameraColorMatrix2[1][0] == 0.0 && - cameraColorMatrix2[1][1] == 0.0 && - cameraColorMatrix2[1][2] == 0.0 && - cameraColorMatrix2[1][3] == 0.0 && - cameraColorMatrix2[2][0] == 0.0 && - cameraColorMatrix2[2][1] == 0.0 && - cameraColorMatrix2[2][2] == 0.0 && - cameraColorMatrix2[2][3] == 0.0 && - cameraXYZMatrix[0][0] == 0.0 && - cameraXYZMatrix[0][1] == 0.0 && - cameraXYZMatrix[0][2] == 0.0 && - cameraXYZMatrix[1][0] == 0.0 && - cameraXYZMatrix[1][1] == 0.0 && - cameraXYZMatrix[1][2] == 0.0 && - cameraXYZMatrix[2][0] == 0.0 && - cameraXYZMatrix[2][1] == 0.0 && - cameraXYZMatrix[2][2] == 0.0 && - cameraXYZMatrix[3][0] == 0.0 && - cameraXYZMatrix[3][1] == 0.0 && - cameraXYZMatrix[3][2] == 0.0 && - orientation == ORIENTATION_NONE - ) - { - return true; - } - else - { - return false; - } -} - -QDebug operator<<(QDebug dbg, const DcrawInfoContainer& c) -{ - dbg.nospace() << "DcrawInfoContainer::sensitivity: " << c.sensitivity << ", "; - dbg.nospace() << "DcrawInfoContainer::exposureTime: " << c.exposureTime << ", "; - dbg.nospace() << "DcrawInfoContainer::aperture: " << c.aperture << ", "; - dbg.nospace() << "DcrawInfoContainer::focalLength: " << c.focalLength << ", "; - dbg.nospace() << "DcrawInfoContainer::pixelAspectRatio: " << c.pixelAspectRatio << ", "; - dbg.nospace() << "DcrawInfoContainer::rawColors: " << c.rawColors << ", "; - dbg.nospace() << "DcrawInfoContainer::rawImages: " << c.rawImages << ", "; - dbg.nospace() << "DcrawInfoContainer::hasIccProfile: " << c.hasIccProfile << ", "; - dbg.nospace() << "DcrawInfoContainer::isDecodable: " << c.isDecodable << ", "; - dbg.nospace() << "DcrawInfoContainer::daylightMult: " << c.daylightMult << ", "; - dbg.nospace() << "DcrawInfoContainer::cameraMult: " << c.cameraMult << ", "; - dbg.nospace() << "DcrawInfoContainer::blackPoint: " << c.blackPoint << ", "; - dbg.nospace() << "DcrawInfoContainer::whitePoint: " << c.whitePoint << ", "; - dbg.nospace() << "DcrawInfoContainer::topMargin: " << c.topMargin << ", "; - dbg.nospace() << "DcrawInfoContainer::leftMargin: " << c.leftMargin << ", "; - dbg.nospace() << "DcrawInfoContainer::orientation: " << c.orientation; - return dbg.space(); -} - -} // namespace KDcrawIface diff --git a/kdcraw/libkdcraw/dcrawinfocontainer.h b/kdcraw/libkdcraw/dcrawinfocontainer.h deleted file mode 100644 index 4629777f..00000000 --- a/kdcraw/libkdcraw/dcrawinfocontainer.h +++ /dev/null @@ -1,158 +0,0 @@ -/** =========================================================== - * @file - * - * This file is a part of digiKam project - * http://www.digikam.org - * - * @date 2007-05-02 - * @brief RAW file identification information container - * - * @author Copyright (C) 2007-2013 by Gilles Caulier - * caulier dot gilles at gmail dot com - * - * This program 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 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * ============================================================ */ - -#ifndef DCRAW_INFO_CONTAINER_H -#define DCRAW_INFO_CONTAINER_H - -// Qt includes - -#include -#include -#include -#include - -// Local includes - -#include "kdcraw_export.h" - -namespace KDcrawIface -{ - -class KDCRAW_EXPORT DcrawInfoContainer -{ - -public: - - /** The RAW image orientation values - */ - enum ImageOrientation - { - ORIENTATION_NONE = 0, - ORIENTATION_180 = 3, - ORIENTATION_Mirror90CCW = 4, - ORIENTATION_90CCW = 5, - ORIENTATION_90CW = 6 - }; - -public: - - /** Standard constructor */ - DcrawInfoContainer(); - - /** Standard destructor */ - virtual ~DcrawInfoContainer(); - - /** Return 'true' if container is empty, else 'false' */ - bool isEmpty(); - -public: - - /** True if RAW file include an ICC color profile. */ - bool hasIccProfile; - /** True is RAW file is decodable by dcraw. */ - bool isDecodable; - - /** The number of RAW colors. */ - int rawColors; - - /** The number of RAW images. */ - int rawImages; - - /** Black level from Raw histogram. */ - unsigned int blackPoint; - - /** Channel black levels from Raw histogram. */ - unsigned int blackPointCh[4]; - - /** White level from Raw histogram. */ - unsigned int whitePoint; - - /** Top margin of raw image. */ - unsigned int topMargin; - - /** Left margin of raw image. */ - unsigned int leftMargin; - - /** The raw image orientation */ - ImageOrientation orientation; - - /** The sensitivity in ISO used by camera to take the picture. */ - float sensitivity; - - /** ==> 1/exposureTime = exposure time in seconds. */ - float exposureTime; - /** ==> Aperture value in APEX. */ - float aperture; - /** ==> Focal Length value in mm. */ - float focalLength; - /** The pixel Aspect Ratio if != 1.0. NOTE: if == 1.0, dcraw do not show this value. */ - float pixelAspectRatio; - - /** White color balance settings. */ - double daylightMult[3]; - /** Camera multipliers used for White Balance adjustments */ - double cameraMult[4]; - - /** Camera Color Matrix */ - float cameraColorMatrix1[3][4]; - float cameraColorMatrix2[3][4]; - float cameraXYZMatrix[4][3]; - - /** The used Color Keys */ - QString colorKeys; - - /** The camera maker. */ - QString make; - /** The camera model. */ - QString model; - /** The artist name who have picture owner. */ - QString owner; - /** The demosaising filter pattern. */ - QString filterPattern; - /** The DNG version. NOTE: it is only shown with DNG RAW files. */ - QString DNGVersion; - - /** Date & time when the picture has been taken. */ - QDateTime dateTime; - - /** The image dimensions in pixels. */ - QSize imageSize; - - /** The thumb dimensions in pixels. */ - QSize thumbSize; - - /** The full RAW image dimensions in pixels. */ - QSize fullSize; - - /** The output dimensions in pixels. */ - QSize outputSize; -}; - -//! kDebug() stream operator. Writes container @a c to the debug output in a nicely formatted way. -KDCRAW_EXPORT QDebug operator<<(QDebug dbg, const DcrawInfoContainer& c); - -} // namespace KDcrawIface - -#endif /* DCRAW_INFO_CONTAINER_H */ diff --git a/kdcraw/libkdcraw/dcrawsettingswidget.cpp b/kdcraw/libkdcraw/dcrawsettingswidget.cpp deleted file mode 100644 index 790f6865..00000000 --- a/kdcraw/libkdcraw/dcrawsettingswidget.cpp +++ /dev/null @@ -1,1332 +0,0 @@ -/** =========================================================== - * @file - * - * This file is a part of digiKam project - * http://www.digikam.org - * - * @date 2006-09-13 - * @brief LibRaw settings widgets - * - * @author Copyright (C) 2006-2013 by Gilles Caulier - * caulier dot gilles at gmail dot com - * @author Copyright (C) 2006-2011 by Marcel Wiesweg - * marcel dot wiesweg at gmx dot de - * @author Copyright (C) 2007-2008 by Guillaume Castagnino - * casta at xwing dot info - * - * This program 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 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * ============================================================ */ - -#include "moc_dcrawsettingswidget.cpp" - -// C++ includes - -#include - -// Qt includes - -#include -#include -#include -#include -#include - -// KDE includes - -#include -#include -#include -#include -#include -#include - -// Local includes - -#include "kdcraw.h" -#include "rnuminput.h" -#include "rcombobox.h" -#include "rexpanderbox.h" - -namespace KDcrawIface -{ - -class DcrawSettingsWidget::Private -{ -public: - - Private() - { - autoBrightnessBox = 0; - sixteenBitsImage = 0; - fourColorCheckBox = 0; - brightnessLabel = 0; - brightnessSpinBox = 0; - blackPointCheckBox = 0; - blackPointSpinBox = 0; - whitePointCheckBox = 0; - whitePointSpinBox = 0; - whiteBalanceComboBox = 0; - whiteBalanceLabel = 0; - customWhiteBalanceSpinBox = 0; - customWhiteBalanceLabel = 0; - customWhiteBalanceGreenSpinBox = 0; - customWhiteBalanceGreenLabel = 0; - unclipColorLabel = 0; - dontStretchPixelsCheckBox = 0; - RAWQualityComboBox = 0; - RAWQualityLabel = 0; - noiseReductionComboBox = 0; - NRSpinBox1 = 0; - NRSpinBox2 = 0; - NRLabel1 = 0; - NRLabel2 = 0; - enableCACorrectionBox = 0; - autoCACorrectionBox = 0; - caRedMultSpinBox = 0; - caBlueMultSpinBox = 0; - caRedMultLabel = 0; - caBlueMultLabel = 0; - unclipColorComboBox = 0; - reconstructLabel = 0; - reconstructSpinBox = 0; - outputColorSpaceLabel = 0; - outputColorSpaceComboBox = 0; - demosaicingSettings = 0; - whiteBalanceSettings = 0; - correctionsSettings = 0; - colormanSettings = 0; - medianFilterPassesSpinBox = 0; - medianFilterPassesLabel = 0; - inIccUrlEdit = 0; - outIccUrlEdit = 0; - inputColorSpaceLabel = 0; - inputColorSpaceComboBox = 0; - fixColorsHighlightsBox = 0; - refineInterpolationBox = 0; - noiseReductionLabel = 0; - expoCorrectionBox = 0; - expoCorrectionShiftSpinBox = 0; - expoCorrectionHighlightSpinBox = 0; - expoCorrectionShiftLabel = 0; - expoCorrectionHighlightLabel = 0; - } - - /** Convert Exposure correction shift E.V value from GUI to Linear value needs by libraw decoder. - */ - double shiftExpoFromEvToLinear(double ev) const - { - // From GUI : -2.0EV => 0.25 - // +3.0EV => 8.00 - return (1.55*ev + 3.35); - } - - /** Convert Exposure correction shift Linear value from liraw decoder to E.V value needs by GUI. - */ - double shiftExpoFromLinearToEv(double lin) const - { - // From GUI : 0.25 => -2.0EV - // 8.00 => +3.0EV - return ((lin-3.35) / 1.55); - } - -public: - - QWidget* demosaicingSettings; - QWidget* whiteBalanceSettings; - QWidget* correctionsSettings; - QWidget* colormanSettings; - - QLabel* whiteBalanceLabel; - QLabel* customWhiteBalanceLabel; - QLabel* customWhiteBalanceGreenLabel; - QLabel* brightnessLabel; - QLabel* RAWQualityLabel; - QLabel* NRLabel1; - QLabel* NRLabel2; - QLabel* caRedMultLabel; - QLabel* caBlueMultLabel; - QLabel* unclipColorLabel; - QLabel* reconstructLabel; - QLabel* inputColorSpaceLabel; - QLabel* outputColorSpaceLabel; - QLabel* medianFilterPassesLabel; - QLabel* noiseReductionLabel; - QLabel* expoCorrectionShiftLabel; - QLabel* expoCorrectionHighlightLabel; - - QCheckBox* blackPointCheckBox; - QCheckBox* whitePointCheckBox; - QCheckBox* sixteenBitsImage; - QCheckBox* autoBrightnessBox; - QCheckBox* fourColorCheckBox; - QCheckBox* dontStretchPixelsCheckBox; - QCheckBox* enableCACorrectionBox; - QCheckBox* autoCACorrectionBox; - QCheckBox* fixColorsHighlightsBox; - QCheckBox* refineInterpolationBox; - QCheckBox* expoCorrectionBox; - - KUrlRequester* inIccUrlEdit; - KUrlRequester* outIccUrlEdit; - - RComboBox* noiseReductionComboBox; - RComboBox* whiteBalanceComboBox; - RComboBox* RAWQualityComboBox; - RComboBox* unclipColorComboBox; - RComboBox* inputColorSpaceComboBox; - RComboBox* outputColorSpaceComboBox; - - RIntNumInput* customWhiteBalanceSpinBox; - RIntNumInput* reconstructSpinBox; - RIntNumInput* blackPointSpinBox; - RIntNumInput* whitePointSpinBox; - RIntNumInput* NRSpinBox1; - RIntNumInput* NRSpinBox2; - RIntNumInput* medianFilterPassesSpinBox; - - RDoubleNumInput* customWhiteBalanceGreenSpinBox; - RDoubleNumInput* caRedMultSpinBox; - RDoubleNumInput* caBlueMultSpinBox; - RDoubleNumInput* brightnessSpinBox; - RDoubleNumInput* expoCorrectionShiftSpinBox; - RDoubleNumInput* expoCorrectionHighlightSpinBox; -}; - -DcrawSettingsWidget::DcrawSettingsWidget(QWidget* const parent, int advSettings) - : RExpanderBox(parent), d(new Private) -{ - setup(advSettings); -} - -void DcrawSettingsWidget::setup(int advSettings) -{ - setObjectName( QLatin1String("DCRawSettings Expander" )); - - // --------------------------------------------------------------- - // DEMOSAICING Settings panel - - d->demosaicingSettings = new QWidget(this); - QGridLayout* const demosaicingLayout = new QGridLayout(d->demosaicingSettings); - - int line = 0; - - d->sixteenBitsImage = new QCheckBox(i18nc("@option:check", "16 bits color depth"), d->demosaicingSettings); - d->sixteenBitsImage->setWhatsThis(i18nc("@info:whatsthis", "If enabled, all RAW files will " - "be decoded in 16-bit color depth using a linear gamma curve. To " - "prevent dark picture rendering in the editor, it is recommended to " - "use Color Management in this mode." - "If disabled, all RAW files will be decoded in 8-bit color " - "depth with a BT.709 gamma curve and a 99th-percentile white point. " - "This mode is faster than 16-bit decoding.")); - demosaicingLayout->addWidget(d->sixteenBitsImage, 0, 0, 1, 2); - - if (advSettings & SIXTEENBITS) - { - d->sixteenBitsImage->show(); - line = 1; - } - else - { - d->sixteenBitsImage->hide(); - } - - d->fourColorCheckBox = new QCheckBox(i18nc("@option:check", "Interpolate RGB as four colors"), d->demosaicingSettings); - d->fourColorCheckBox->setWhatsThis(i18nc("@info:whatsthis", "Interpolate RGB as four " - "colors" - "The default is to assume that all green pixels are the same. " - "If even-row green pixels are more sensitive to ultraviolet light " - "than odd-row this difference causes a mesh pattern in the output; " - "using this option solves this problem with minimal loss of detail." - "To resume, this option blurs the image a little, but it " - "eliminates false 2x2 mesh patterns with VNG quality method or " - "mazes with AHD quality method.")); - demosaicingLayout->addWidget(d->fourColorCheckBox, line, 0, 1, line == 0 ? 2 : 3); - line++; - - KUrlLabel* const dcrawVersion = new KUrlLabel("http://www.libraw.org", QString("libraw %1") - .arg(KDcraw::librawVersion()), d->demosaicingSettings); - dcrawVersion->setAlignment(Qt::AlignRight); - dcrawVersion->setToolTip(i18nc("@info:tooltip", "Visit LibRaw project website")); - demosaicingLayout->addWidget(dcrawVersion, 0, 2, 1, 1); - - d->dontStretchPixelsCheckBox = new QCheckBox(i18nc("@option:check", "Do not stretch or rotate pixels"), d->demosaicingSettings); - d->dontStretchPixelsCheckBox->setWhatsThis(i18nc("@info:whatsthis", - "Do not stretch or rotate pixels" - "For Fuji Super CCD cameras, show the image tilted 45 degrees. " - "For cameras with non-square pixels, do not stretch the image to " - "its correct aspect ratio. In any case, this option guarantees that " - "each output pixel corresponds to one RAW pixel.")); - demosaicingLayout->addWidget(d->dontStretchPixelsCheckBox, line, 0, 1, 3); - line++; - - d->RAWQualityLabel = new QLabel(i18nc("@label:listbox", "Quality:"), d->demosaicingSettings); - d->RAWQualityComboBox = new RComboBox(d->demosaicingSettings); - - // Original dcraw demosaicing methods - d->RAWQualityComboBox->insertItem(RawDecodingSettings::BILINEAR, i18nc("@item:inlistbox Quality", "Bilinear")); - d->RAWQualityComboBox->insertItem(RawDecodingSettings::VNG, i18nc("@item:inlistbox Quality", "VNG")); - d->RAWQualityComboBox->insertItem(RawDecodingSettings::PPG, i18nc("@item:inlistbox Quality", "PPG")); - d->RAWQualityComboBox->insertItem(RawDecodingSettings::AHD, i18nc("@item:inlistbox Quality", "AHD")); - - // Extended demosaicing method from GPL2 pack - d->RAWQualityComboBox->insertItem(RawDecodingSettings::DCB, i18nc("@item:inlistbox Quality", "DCB")); - d->RAWQualityComboBox->insertItem(RawDecodingSettings::PL_AHD, i18nc("@item:inlistbox Quality", "AHD v2")); - d->RAWQualityComboBox->insertItem(RawDecodingSettings::AFD, i18nc("@item:inlistbox Quality", "AFD")); - d->RAWQualityComboBox->insertItem(RawDecodingSettings::VCD, i18nc("@item:inlistbox Quality", "VCD")); - d->RAWQualityComboBox->insertItem(RawDecodingSettings::VCD_AHD, i18nc("@item:inlistbox Quality", "VCD & AHD")); - d->RAWQualityComboBox->insertItem(RawDecodingSettings::LMMSE, i18nc("@item:inlistbox Quality", "LMMSE")); - // Extended demosaicing method from GPL3 pack - d->RAWQualityComboBox->insertItem(RawDecodingSettings::AMAZE, i18nc("@item:inlistbox Quality", "AMaZE")); - - // If Libraw do not support GPL2 pack, disable entries relevant. - if (!KDcraw::librawUseGPL2DemosaicPack()) - { - for (int i=RawDecodingSettings::DCB ; i <=RawDecodingSettings::LMMSE ; ++i) - d->RAWQualityComboBox->combo()->setItemData(i, false, Qt::UserRole-1); - } - - // If Libraw do not support GPL3 pack, disable entries relevant. - if (!KDcraw::librawUseGPL3DemosaicPack()) - { - d->RAWQualityComboBox->combo()->setItemData(RawDecodingSettings::AMAZE, false, Qt::UserRole-1); - } - - d->RAWQualityComboBox->setDefaultIndex(RawDecodingSettings::BILINEAR); - d->RAWQualityComboBox->setCurrentIndex(RawDecodingSettings::BILINEAR); - d->RAWQualityComboBox->setWhatsThis(i18nc("@info:whatsthis", "Quality (interpolation)" - "Select here the demosaicing method to use when decoding RAW " - "images. A demosaicing algorithm is a digital image process used to " - "interpolate a complete image from the partial raw data received " - "from the color-filtered image sensor, internal to many digital " - "cameras, in form of a matrix of colored pixels. Also known as CFA " - "interpolation or color reconstruction, another common spelling is " - "demosaicing. The following methods are available for demosaicing " - "RAW images:" - - // Original dcraw demosaicing methods - - "Bilinear: use " - "high-speed but low-quality bilinear interpolation (default - for " - "slow computers). In this method, the red value of a non-red pixel " - "is computed as the average of the adjacent red pixels, and similarly " - "for blue and green." - - "VNG: use Variable Number " - "of Gradients interpolation. This method computes gradients near " - "the pixel of interest and uses the lower gradients (representing " - "smoother and more similar parts of the image) to make an estimate." - - "PPG: use Patterned-Pixel-" - "Grouping interpolation. Pixel Grouping uses assumptions about " - "natural scenery in making estimates. It has fewer color artifacts " - "on natural images than the Variable Number of Gradients method." - - "AHD: use Adaptive " - "Homogeneity-Directed interpolation. This method selects the " - "direction of interpolation so as to maximize a homogeneity metric, " - "thus typically minimizing color artifacts." - - // Extended demosaicing method - - "DCB: DCB interpolation from " - "linuxphoto.org project." - - "AHD v2: modified AHD " - "interpolation using Variance of Color Differences method." - - "AFD: Adaptive Filtered " - "Demosaicing interpolation through 5 pass median filter from PerfectRaw " - "project." - - "VCD: Variance of Color " - "Differences interpolation." - - "VCD & AHD: Mixed demosaicing " - "between VCD and AHD." - - "LMMSE: color demosaicing via " - "directional linear minimum mean-square error estimation interpolation " - "from PerfectRaw." - - "AMaZE: Aliasing Minimization " - "interpolation and Zipper Elimination to apply color aberration removal " - "from RawTherapee project." - - "Note: some methods can be unavailable if RAW decoder have been built " - "without extension packs.")); - - demosaicingLayout->addWidget(d->RAWQualityLabel, line, 0, 1, 1); - demosaicingLayout->addWidget(d->RAWQualityComboBox, line, 1, 1, 2); - line++; - - d->medianFilterPassesSpinBox = new RIntNumInput(d->demosaicingSettings); - d->medianFilterPassesSpinBox->setRange(0, 10, 1); - d->medianFilterPassesSpinBox->setDefaultValue(0); - d->medianFilterPassesSpinBox->setSliderEnabled(true); - d->medianFilterPassesLabel = new QLabel(i18nc("@label:slider", "Pass:"), d->whiteBalanceSettings); - d->medianFilterPassesSpinBox->setWhatsThis( i18nc("@info:whatsthis", "Pass" - "Set here the passes used by the median filter applied after " - "interpolation to Red-Green and Blue-Green channels." - "This setting is only available for specific Quality options: " - "Bilinear, " - "VNG, PPG, " - "AHD, " - "DCB, and VCD & AHD.")); - demosaicingLayout->addWidget(d->medianFilterPassesLabel, line, 0, 1, 1); - demosaicingLayout->addWidget(d->medianFilterPassesSpinBox, line, 1, 1, 2); - line++; - - d->refineInterpolationBox = new QCheckBox(i18nc("@option:check", "Refine interpolation"), d->demosaicingSettings); - d->refineInterpolationBox->setWhatsThis(i18nc("@info:whatsthis", "Refine interpolation" - "This setting is available only for few Quality options:" - "DCB: turn on " - "the enhance interpolated colors filter." - "VCD & AHD: turn on the " - "enhanced effective color interpolation (EECI) refine to improve " - "sharpness.")); - demosaicingLayout->addWidget(d->refineInterpolationBox, line, 0, 1, 2); - - // If Libraw do not support GPL2 pack, disable options relevant. - if (!KDcraw::librawUseGPL2DemosaicPack()) - { - d->medianFilterPassesLabel->setEnabled(false); - d->medianFilterPassesSpinBox->setEnabled(false); - d->refineInterpolationBox->setEnabled(false); - } - - addItem(d->demosaicingSettings, SmallIcon("kdcraw"), i18nc("@label", "Demosaicing"), QString("demosaicing"), true); - - // --------------------------------------------------------------- - // WHITE BALANCE Settings Panel - - d->whiteBalanceSettings = new QWidget(this); - QGridLayout* const whiteBalanceLayout = new QGridLayout(d->whiteBalanceSettings); - - d->whiteBalanceLabel = new QLabel(i18nc("@label:listbox", "Method:"), d->whiteBalanceSettings); - d->whiteBalanceComboBox = new RComboBox(d->whiteBalanceSettings); - d->whiteBalanceComboBox->insertItem(RawDecodingSettings::NONE, i18nc("@item:inlistbox", "Default D65")); - d->whiteBalanceComboBox->insertItem(RawDecodingSettings::CAMERA, i18nc("@item:inlistbox", "Camera")); - d->whiteBalanceComboBox->insertItem(RawDecodingSettings::AUTO, i18nc("@item:inlistbox set while balance automatically", "Automatic")); - d->whiteBalanceComboBox->insertItem(RawDecodingSettings::CUSTOM, i18nc("@item:inlistbox set white balance manually", "Manual")); - d->whiteBalanceComboBox->setDefaultIndex(RawDecodingSettings::CAMERA); - d->whiteBalanceComboBox->setWhatsThis(i18nc("@info:whatsthis", "White Balance" - "Configure the raw white balance:" - "Default D65: " - "Use a standard daylight D65 white balance." - "Camera: Use the white " - "balance specified by the camera. If not available, reverts to " - "default neutral white balance." - "Automatic: Calculates an " - "automatic white balance averaging the entire image." - "Manual: Set a custom " - "temperature and green level values.")); - - d->customWhiteBalanceSpinBox = new RIntNumInput(d->whiteBalanceSettings); - d->customWhiteBalanceSpinBox->setRange(2000, 12000, 10); - d->customWhiteBalanceSpinBox->setDefaultValue(6500); - d->customWhiteBalanceSpinBox->setSliderEnabled(true); - d->customWhiteBalanceLabel = new QLabel(i18nc("@label:slider", "T(K):"), d->whiteBalanceSettings); - d->customWhiteBalanceSpinBox->setWhatsThis( i18nc("@info:whatsthis", "Temperature" - "Set here the color temperature in Kelvin.")); - - d->customWhiteBalanceGreenSpinBox = new RDoubleNumInput(d->whiteBalanceSettings); - d->customWhiteBalanceGreenSpinBox->setDecimals(2); - d->customWhiteBalanceGreenSpinBox->setRange(0.2, 2.5, 0.01); - d->customWhiteBalanceGreenSpinBox->setDefaultValue(1.0); - d->customWhiteBalanceGreenLabel = new QLabel(i18nc("@label:slider Green component", "Green:"), d->whiteBalanceSettings); - d->customWhiteBalanceGreenSpinBox->setWhatsThis(i18nc("@info:whatsthis", "Set here the " - "green component to set magenta color cast removal level.")); - - d->unclipColorLabel = new QLabel(i18nc("@label:listbox", "Highlights:"), d->whiteBalanceSettings); - d->unclipColorComboBox = new RComboBox(d->whiteBalanceSettings); - d->unclipColorComboBox->insertItem(0, i18nc("@item:inlistbox", "Solid white")); - d->unclipColorComboBox->insertItem(1, i18nc("@item:inlistbox", "Unclip")); - d->unclipColorComboBox->insertItem(2, i18nc("@item:inlistbox", "Blend")); - d->unclipColorComboBox->insertItem(3, i18nc("@item:inlistbox", "Rebuild")); - d->unclipColorComboBox->setDefaultIndex(0); - d->unclipColorComboBox->setWhatsThis(i18nc("@info:whatsthis", "Highlights" - "Select here the highlight clipping method:" - "Solid white: " - "clip all highlights to solid white" - "Unclip: leave highlights " - "unclipped in various shades of pink" - "Blend:Blend clipped and " - "unclipped values together for a gradual fade to white" - "Rebuild: reconstruct " - "highlights using a level value")); - - d->reconstructLabel = new QLabel(i18nc("@label:slider Highlight reconstruct level", "Level:"), d->whiteBalanceSettings); - d->reconstructSpinBox = new RIntNumInput(d->whiteBalanceSettings); - d->reconstructSpinBox->setRange(0, 6, 1); - d->reconstructSpinBox->setDefaultValue(0); - d->reconstructSpinBox->setSliderEnabled(true); - d->reconstructSpinBox->setWhatsThis(i18nc("@info:whatsthis", "Level" - "Specify the reconstruct highlight level. Low values favor " - "whites and high values favor colors.")); - - d->expoCorrectionBox = new QCheckBox(i18nc("@option:check", "Exposure Correction (E.V)"), d->whiteBalanceSettings); - d->expoCorrectionBox->setWhatsThis(i18nc("@info:whatsthis", "Turn on the exposure " - "correction before interpolation.")); - - d->expoCorrectionShiftLabel = new QLabel(i18nc("@label:slider", "Linear Shift:"), d->whiteBalanceSettings); - d->expoCorrectionShiftSpinBox = new RDoubleNumInput(d->whiteBalanceSettings); - d->expoCorrectionShiftSpinBox->setDecimals(2); - d->expoCorrectionShiftSpinBox->setRange(-2.0, 3.0, 0.01); - d->expoCorrectionShiftSpinBox->setDefaultValue(0.0); - d->expoCorrectionShiftSpinBox->setWhatsThis(i18nc("@info:whatsthis", "Shift" - "Linear Shift of exposure correction before interpolation in E.V")); - - d->expoCorrectionHighlightLabel = new QLabel(i18nc("@label:slider", "Highlight:"), d->whiteBalanceSettings); - d->expoCorrectionHighlightSpinBox = new RDoubleNumInput(d->whiteBalanceSettings); - d->expoCorrectionHighlightSpinBox->setDecimals(2); - d->expoCorrectionHighlightSpinBox->setRange(0.0, 1.0, 0.01); - d->expoCorrectionHighlightSpinBox->setDefaultValue(0.0); - d->expoCorrectionHighlightSpinBox->setWhatsThis(i18nc("@info:whatsthis", "Highlight" - "Amount of highlight preservation for exposure correction " - "before interpolation in E.V. Only take effect if Shift Correction is > 1.0 E.V")); - - d->fixColorsHighlightsBox = new QCheckBox(i18nc("@option:check", "Correct false colors in highlights"), d->whiteBalanceSettings); - d->fixColorsHighlightsBox->setWhatsThis(i18nc("@info:whatsthis", "If enabled, images with " - "overblown channels are processed much more accurately, without " - "'pink clouds' (and blue highlights under tungsten lamps).")); - - d->autoBrightnessBox = new QCheckBox(i18nc("@option:check", "Auto Brightness"), d->whiteBalanceSettings); - d->autoBrightnessBox->setWhatsThis(i18nc("@info:whatsthis", "If disable, use a fixed white level " - "and ignore the image histogram to adjust brightness.")); - - d->brightnessLabel = new QLabel(i18nc("@label:slider", "Brightness:"), d->whiteBalanceSettings); - d->brightnessSpinBox = new RDoubleNumInput(d->whiteBalanceSettings); - d->brightnessSpinBox->setDecimals(2); - d->brightnessSpinBox->setRange(0.0, 10.0, 0.01); - d->brightnessSpinBox->setDefaultValue(1.0); - d->brightnessSpinBox->setWhatsThis(i18nc("@info:whatsthis", "Brightness" - "Specify the brightness level of output image. The default " - "value is 1.0 (works in 8-bit mode only).")); - - if (! (advSettings & POSTPROCESSING)) - { - d->brightnessLabel->hide(); - d->brightnessSpinBox->hide(); - } - - d->blackPointCheckBox = new QCheckBox(i18nc("@option:check Black point", "Black:"), d->whiteBalanceSettings); - d->blackPointCheckBox->setWhatsThis(i18nc("@info:whatsthis", "Black point" - "Use a specific black point value to decode RAW pictures. If " - "you set this option to off, the Black Point value will be " - "automatically computed.")); - d->blackPointSpinBox = new RIntNumInput(d->whiteBalanceSettings); - d->blackPointSpinBox->setRange(0, 1000, 1); - d->blackPointSpinBox->setDefaultValue(0); - d->blackPointSpinBox->setSliderEnabled(true); - d->blackPointSpinBox->setWhatsThis(i18nc("@info:whatsthis", "Black point value" - "Specify specific black point value of the output image.")); - - d->whitePointCheckBox = new QCheckBox(i18nc("@option:check White point", "White:"), d->whiteBalanceSettings); - d->whitePointCheckBox->setWhatsThis(i18nc("@info:whatsthis", "White point" - "Use a specific white point value to decode RAW pictures. If " - "you set this option to off, the White Point value will be " - "automatically computed.")); - d->whitePointSpinBox = new RIntNumInput(d->whiteBalanceSettings); - d->whitePointSpinBox->setRange(0, 20000, 1); - d->whitePointSpinBox->setDefaultValue(0); - d->whitePointSpinBox->setSliderEnabled(true); - d->whitePointSpinBox->setWhatsThis(i18nc("@info:whatsthis", "White point value" - "Specify specific white point value of the output image.")); - - if (! (advSettings & BLACKWHITEPOINTS)) - { - d->blackPointCheckBox->hide(); - d->blackPointSpinBox->hide(); - d->whitePointCheckBox->hide(); - d->whitePointSpinBox->hide(); - } - - whiteBalanceLayout->addWidget(d->whiteBalanceLabel, 0, 0, 1, 1); - whiteBalanceLayout->addWidget(d->whiteBalanceComboBox, 0, 1, 1, 2); - whiteBalanceLayout->addWidget(d->customWhiteBalanceLabel, 1, 0, 1, 1); - whiteBalanceLayout->addWidget(d->customWhiteBalanceSpinBox, 1, 1, 1, 2); - whiteBalanceLayout->addWidget(d->customWhiteBalanceGreenLabel, 2, 0, 1, 1); - whiteBalanceLayout->addWidget(d->customWhiteBalanceGreenSpinBox, 2, 1, 1, 2); - whiteBalanceLayout->addWidget(d->unclipColorLabel, 3, 0, 1, 1); - whiteBalanceLayout->addWidget(d->unclipColorComboBox, 3, 1, 1, 2); - whiteBalanceLayout->addWidget(d->reconstructLabel, 4, 0, 1, 1); - whiteBalanceLayout->addWidget(d->reconstructSpinBox, 4, 1, 1, 2); - whiteBalanceLayout->addWidget(d->expoCorrectionBox, 5, 0, 1, 2); - whiteBalanceLayout->addWidget(d->expoCorrectionShiftLabel, 6, 0, 1, 1); - whiteBalanceLayout->addWidget(d->expoCorrectionShiftSpinBox, 6, 1, 1, 2); - whiteBalanceLayout->addWidget(d->expoCorrectionHighlightLabel, 7, 0, 1, 1); - whiteBalanceLayout->addWidget(d->expoCorrectionHighlightSpinBox, 7, 1, 1, 2); - whiteBalanceLayout->addWidget(d->fixColorsHighlightsBox, 8, 0, 1, 3); - whiteBalanceLayout->addWidget(d->autoBrightnessBox, 9, 0, 1, 3); - whiteBalanceLayout->addWidget(d->brightnessLabel, 10, 0, 1, 1); - whiteBalanceLayout->addWidget(d->brightnessSpinBox, 10, 1, 1, 2); - whiteBalanceLayout->addWidget(d->blackPointCheckBox, 11, 0, 1, 1); - whiteBalanceLayout->addWidget(d->blackPointSpinBox, 11, 1, 1, 2); - whiteBalanceLayout->addWidget(d->whitePointCheckBox, 12, 0, 1, 1); - whiteBalanceLayout->addWidget(d->whitePointSpinBox, 12, 1, 1, 2); - whiteBalanceLayout->setSpacing(KDialog::spacingHint()); - whiteBalanceLayout->setMargin(KDialog::spacingHint()); - - addItem(d->whiteBalanceSettings, SmallIcon("kdcraw"), i18nc("@label", "White Balance"), QString("whitebalance"), true); - - // --------------------------------------------------------------- - // CORRECTIONS Settings panel - - d->correctionsSettings = new QWidget(this); - QGridLayout* const correctionsLayout = new QGridLayout(d->correctionsSettings); - - d->noiseReductionLabel = new QLabel(i18nc("@label:listbox", "Noise reduction:"), d->correctionsSettings); - d->noiseReductionComboBox = new RComboBox(d->colormanSettings); - d->noiseReductionComboBox->insertItem(RawDecodingSettings::NONR, i18nc("@item:inlistbox Noise Reduction", "None")); - d->noiseReductionComboBox->insertItem(RawDecodingSettings::WAVELETSNR, i18nc("@item:inlistbox Noise Reduction", "Wavelets")); - d->noiseReductionComboBox->insertItem(RawDecodingSettings::FBDDNR, i18nc("@item:inlistbox Noise Reduction", "FBDD")); - d->noiseReductionComboBox->insertItem(RawDecodingSettings::LINENR, i18nc("@item:inlistbox Noise Reduction", "CFA Line Denoise")); - d->noiseReductionComboBox->insertItem(RawDecodingSettings::IMPULSENR, i18nc("@item:inlistbox Noise Reduction", "Impulse Denoise")); - d->noiseReductionComboBox->setDefaultIndex(RawDecodingSettings::NONR); - d->noiseReductionComboBox->setWhatsThis(i18nc("@info:whatsthis", "Noise Reduction" - "Select here the noise reduction method to apply during RAW " - "decoding." - "None: no " - "noise reduction." - "Wavelets: wavelets " - "correction to erase noise while preserving real detail. It's " - "applied after interpolation." - "FBDD: Fake Before " - "Demosaicing Denoising noise reduction. It's applied before " - "interpolation." - "CFA Line Denoise: Banding " - "noise suppression. It's applied after interpolation." - "Impulse Denoise: Impulse " - "noise suppression. It's applied after interpolation.")); - - d->NRSpinBox1 = new RIntNumInput(d->correctionsSettings); - d->NRSpinBox1->setRange(100, 1000, 1); - d->NRSpinBox1->setDefaultValue(100); - d->NRSpinBox1->setSliderEnabled(true); - d->NRLabel1 = new QLabel(d->correctionsSettings); - - d->NRSpinBox2 = new RIntNumInput(d->correctionsSettings); - d->NRSpinBox2->setRange(100, 1000, 1); - d->NRSpinBox2->setDefaultValue(100); - d->NRSpinBox2->setSliderEnabled(true); - d->NRLabel2 = new QLabel(d->correctionsSettings); - - d->enableCACorrectionBox = new QCheckBox(i18nc("@option:check", "Enable Chromatic Aberration correction"), d->correctionsSettings); - d->enableCACorrectionBox->setWhatsThis(i18nc("@info:whatsthis", "Enable Chromatic " - "Aberration correction" - "Enlarge the raw red-green and blue-yellow axis by the given " - "factors (automatic by default).")); - - d->autoCACorrectionBox = new QCheckBox(i18nc("@option:check", "Automatic color axis adjustments"), d->correctionsSettings); - d->autoCACorrectionBox->setWhatsThis(i18nc("@info:whatsthis", "Automatic Chromatic " - "Aberration correction" - "If this option is turned on, it will try to shift image " - "channels slightly and evaluate Chromatic Aberration change. Note " - "that if you shot blue-red pattern, the method may fail. In this " - "case, disable this option and tune manually color factors.")); - - d->caRedMultLabel = new QLabel(i18nc("@label:slider", "Red-Green:"), d->correctionsSettings); - d->caRedMultSpinBox = new RDoubleNumInput(d->correctionsSettings); - d->caRedMultSpinBox->setDecimals(1); - d->caRedMultSpinBox->setRange(-4.0, 4.0, 0.1); - d->caRedMultSpinBox->setDefaultValue(0.0); - d->caRedMultSpinBox->setWhatsThis(i18nc("@info:whatsthis", "Red-Green multiplier" - "Set here the amount of correction on red-green axis")); - - d->caBlueMultLabel = new QLabel(i18nc("@label:slider", "Blue-Yellow:"), d->correctionsSettings); - d->caBlueMultSpinBox = new RDoubleNumInput(d->correctionsSettings); - d->caBlueMultSpinBox->setDecimals(1); - d->caBlueMultSpinBox->setRange(-4.0, 4.0, 0.1); - d->caBlueMultSpinBox->setDefaultValue(0.0); - d->caBlueMultSpinBox->setWhatsThis(i18nc("@info:whatsthis", "Blue-Yellow multiplier" - "Set here the amount of correction on blue-yellow axis")); - - correctionsLayout->addWidget(d->noiseReductionLabel, 0, 0, 1, 1); - correctionsLayout->addWidget(d->noiseReductionComboBox, 0, 1, 1, 2); - correctionsLayout->addWidget(d->NRLabel1, 1, 0, 1, 1); - correctionsLayout->addWidget(d->NRSpinBox1, 1, 1, 1, 2); - correctionsLayout->addWidget(d->NRLabel2, 2, 0, 1, 1); - correctionsLayout->addWidget(d->NRSpinBox2, 2, 1, 1, 2); - correctionsLayout->addWidget(d->enableCACorrectionBox, 3, 0, 1, 3); - correctionsLayout->addWidget(d->autoCACorrectionBox, 4, 0, 1, 3); - correctionsLayout->addWidget(d->caRedMultLabel, 5, 0, 1, 1); - correctionsLayout->addWidget(d->caRedMultSpinBox, 5, 1, 1, 2); - correctionsLayout->addWidget(d->caBlueMultLabel, 6, 0, 1, 1); - correctionsLayout->addWidget(d->caBlueMultSpinBox, 6, 1, 1, 2); - correctionsLayout->setRowStretch(7, 10); - correctionsLayout->setSpacing(KDialog::spacingHint()); - correctionsLayout->setMargin(KDialog::spacingHint()); - - addItem(d->correctionsSettings, SmallIcon("kdcraw"), i18nc("@label", "Corrections"), QString("corrections"), false); - - // --------------------------------------------------------------- - // COLOR MANAGEMENT Settings panel - - d->colormanSettings = new QWidget(this); - QGridLayout* const colormanLayout = new QGridLayout(d->colormanSettings); - - d->inputColorSpaceLabel = new QLabel(i18nc("@label:listbox", "Camera Profile:"), d->colormanSettings); - d->inputColorSpaceComboBox = new RComboBox(d->colormanSettings); - d->inputColorSpaceComboBox->insertItem(RawDecodingSettings::NOINPUTCS, i18nc("@item:inlistbox Camera Profile", "None")); - d->inputColorSpaceComboBox->insertItem(RawDecodingSettings::EMBEDDED, i18nc("@item:inlistbox Camera Profile", "Embedded")); - d->inputColorSpaceComboBox->insertItem(RawDecodingSettings::CUSTOMINPUTCS, i18nc("@item:inlistbox Camera Profile", "Custom")); - d->inputColorSpaceComboBox->setDefaultIndex(RawDecodingSettings::NOINPUTCS); - d->inputColorSpaceComboBox->setWhatsThis(i18nc("@info:whatsthis", "Camera Profile" - "Select here the input color space used to decode RAW data." - "None: no " - "input color profile is used during RAW decoding." - "Embedded: use embedded " - "color profile from RAW file, if it exists." - "Custom: use a custom " - "input color space profile.")); - - d->inIccUrlEdit = new KUrlRequester(d->colormanSettings); - d->inIccUrlEdit->setMode(KFile::LocalOnly | KFile::ExistingOnly | KFile::File); - d->inIccUrlEdit->setFilter("*.icc *.icm|"+i18n("ICC Files (*.icc; *.icm)")); - - d->outputColorSpaceLabel = new QLabel(i18nc("@label:listbox", "Workspace:"), d->colormanSettings); - d->outputColorSpaceComboBox = new RComboBox( d->colormanSettings ); - d->outputColorSpaceComboBox->insertItem(RawDecodingSettings::RAWCOLOR, i18nc("@item:inlistbox Workspace", "Raw (no profile)")); - d->outputColorSpaceComboBox->insertItem(RawDecodingSettings::SRGB, i18nc("@item:inlistbox Workspace", "sRGB")); - d->outputColorSpaceComboBox->insertItem(RawDecodingSettings::ADOBERGB, i18nc("@item:inlistbox Workspace", "Adobe RGB")); - d->outputColorSpaceComboBox->insertItem(RawDecodingSettings::WIDEGAMMUT, i18nc("@item:inlistbox Workspace", "Wide Gamut")); - d->outputColorSpaceComboBox->insertItem(RawDecodingSettings::PROPHOTO, i18nc("@item:inlistbox Workspace", "Pro-Photo")); - d->outputColorSpaceComboBox->insertItem(RawDecodingSettings::CUSTOMOUTPUTCS, i18nc("@item:inlistbox Workspace", "Custom")); - d->outputColorSpaceComboBox->setDefaultIndex(RawDecodingSettings::SRGB); - d->outputColorSpaceComboBox->setWhatsThis(i18nc("@info:whatsthis", "Workspace" - "Select here the output color space used to decode RAW data." - "Raw (linear): " - "in this mode, no output color space is used during RAW decoding." - "sRGB: this is an RGB " - "color space, created cooperatively by Hewlett-Packard and " - "Microsoft. It is the best choice for images destined for the Web " - "and portrait photography." - "Adobe RGB: this color " - "space is an extended RGB color space, developed by Adobe. It is " - "used for photography applications such as advertising and fine " - "art." - "Wide Gamut: this color " - "space is an expanded version of the Adobe RGB color space." - "Pro-Photo: this color " - "space is an RGB color space, developed by Kodak, that offers an " - "especially large gamut designed for use with photographic outputs " - "in mind." - "Custom: use a custom " - "output color space profile.")); - - d->outIccUrlEdit = new KUrlRequester(d->colormanSettings); - d->outIccUrlEdit->setMode(KFile::LocalOnly | KFile::File | KFile::ExistingOnly); - d->outIccUrlEdit->setFilter("*.icc *.icm|"+i18n("ICC Files (*.icc; *.icm)")); - - colormanLayout->addWidget(d->inputColorSpaceLabel, 0, 0, 1, 1); - colormanLayout->addWidget(d->inputColorSpaceComboBox, 0, 1, 1, 2); - colormanLayout->addWidget(d->inIccUrlEdit, 1, 0, 1, 3); - colormanLayout->addWidget(d->outputColorSpaceLabel, 2, 0, 1, 1); - colormanLayout->addWidget(d->outputColorSpaceComboBox, 2, 1, 1, 2); - colormanLayout->addWidget(d->outIccUrlEdit, 3, 0, 1, 3); - colormanLayout->setRowStretch(4, 10); - colormanLayout->setSpacing(KDialog::spacingHint()); - colormanLayout->setMargin(KDialog::spacingHint()); - - addItem(d->colormanSettings, SmallIcon("kdcraw"), i18nc("@label", "Color Management"), QString("colormanagement"), false); - - if (! (advSettings & COLORSPACE)) - removeItem(COLORMANAGEMENT); - - addStretch(); - - // --------------------------------------------------------------- - - connect(d->unclipColorComboBox, SIGNAL(activated(int)), - this, SLOT(slotUnclipColorActivated(int))); - - connect(d->whiteBalanceComboBox, SIGNAL(activated(int)), - this, SLOT(slotWhiteBalanceToggled(int))); - - connect(d->noiseReductionComboBox, SIGNAL(activated(int)), - this, SLOT(slotNoiseReductionChanged(int))); - - connect(d->enableCACorrectionBox, SIGNAL(toggled(bool)), - this, SLOT(slotCACorrectionToggled(bool))); - - connect(d->autoCACorrectionBox, SIGNAL(toggled(bool)), - this, SLOT(slotAutoCAToggled(bool))); - - connect(d->blackPointCheckBox, SIGNAL(toggled(bool)), - d->blackPointSpinBox, SLOT(setEnabled(bool))); - - connect(d->whitePointCheckBox, SIGNAL(toggled(bool)), - d->whitePointSpinBox, SLOT(setEnabled(bool))); - - connect(d->sixteenBitsImage, SIGNAL(toggled(bool)), - this, SLOT(slotsixteenBitsImageToggled(bool))); - - connect(dcrawVersion, SIGNAL(leftClickedUrl(QString)), - this, SLOT(processDcrawUrl(QString))); - - connect(d->inputColorSpaceComboBox, SIGNAL(activated(int)), - this, SLOT(slotInputColorSpaceChanged(int))); - - connect(d->outputColorSpaceComboBox, SIGNAL(activated(int)), - this, SLOT(slotOutputColorSpaceChanged(int))); - - connect(d->expoCorrectionBox, SIGNAL(toggled(bool)), - this, SLOT(slotExposureCorrectionToggled(bool))); - - connect(d->expoCorrectionShiftSpinBox, SIGNAL(valueChanged(double)), - this, SLOT(slotExpoCorrectionShiftChanged(double))); - - // Wrapper to emit signal when something is changed in settings. - - connect(d->inIccUrlEdit, SIGNAL(urlSelected(KUrl)), - this, SIGNAL(signalSettingsChanged())); - - connect(d->outIccUrlEdit, SIGNAL(urlSelected(KUrl)), - this, SIGNAL(signalSettingsChanged())); - - connect(d->whiteBalanceComboBox, SIGNAL(activated(int)), - this, SIGNAL(signalSettingsChanged())); - - connect(d->RAWQualityComboBox, SIGNAL(activated(int)), - this, SLOT(slotRAWQualityChanged(int))); - - connect(d->unclipColorComboBox, SIGNAL(activated(int)), - this, SIGNAL(signalSettingsChanged())); - - connect(d->inputColorSpaceComboBox, SIGNAL(activated(int)), - this, SIGNAL(signalSettingsChanged())); - - connect(d->outputColorSpaceComboBox, SIGNAL(activated(int)), - this, SIGNAL(signalSettingsChanged())); - - connect(d->blackPointCheckBox, SIGNAL(toggled(bool)), - this, SIGNAL(signalSettingsChanged())); - - connect(d->whitePointCheckBox, SIGNAL(toggled(bool)), - this, SIGNAL(signalSettingsChanged())); - - connect(d->sixteenBitsImage, SIGNAL(toggled(bool)), - this, SIGNAL(signalSettingsChanged())); - - connect(d->fixColorsHighlightsBox, SIGNAL(toggled(bool)), - this, SIGNAL(signalSettingsChanged())); - - connect(d->autoBrightnessBox, SIGNAL(toggled(bool)), - this, SIGNAL(signalSettingsChanged())); - - connect(d->fourColorCheckBox, SIGNAL(toggled(bool)), - this, SIGNAL(signalSettingsChanged())); - - connect(d->dontStretchPixelsCheckBox, SIGNAL(toggled(bool)), - this, SIGNAL(signalSettingsChanged())); - - connect(d->refineInterpolationBox, SIGNAL(toggled(bool)), - this, SIGNAL(signalSettingsChanged())); - - connect(d->customWhiteBalanceSpinBox, SIGNAL(valueChanged(int)), - this, SIGNAL(signalSettingsChanged())); - - connect(d->reconstructSpinBox, SIGNAL(valueChanged(int)), - this, SIGNAL(signalSettingsChanged())); - - connect(d->blackPointSpinBox, SIGNAL(valueChanged(int)), - this, SIGNAL(signalSettingsChanged())); - - connect(d->whitePointSpinBox, SIGNAL(valueChanged(int)), - this, SIGNAL(signalSettingsChanged())); - - connect(d->NRSpinBox1, SIGNAL(valueChanged(int)), - this, SIGNAL(signalSettingsChanged())); - - connect(d->NRSpinBox2, SIGNAL(valueChanged(int)), - this, SIGNAL(signalSettingsChanged())); - - connect(d->medianFilterPassesSpinBox, SIGNAL(valueChanged(int)), - this, SIGNAL(signalSettingsChanged())); - - connect(d->customWhiteBalanceGreenSpinBox, SIGNAL(valueChanged(double)), - this, SIGNAL(signalSettingsChanged())); - - connect(d->caRedMultSpinBox, SIGNAL(valueChanged(double)), - this, SIGNAL(signalSettingsChanged())); - - connect(d->caBlueMultSpinBox, SIGNAL(valueChanged(double)), - this, SIGNAL(signalSettingsChanged())); - - connect(d->brightnessSpinBox, SIGNAL(valueChanged(double)), - this, SIGNAL(signalSettingsChanged())); - - connect(d->expoCorrectionHighlightSpinBox, SIGNAL(valueChanged(double)), - this, SIGNAL(signalSettingsChanged())); -} - -DcrawSettingsWidget::~DcrawSettingsWidget() -{ - delete d; -} - -void DcrawSettingsWidget::updateMinimumWidth() -{ - int width = 0; - - for (int i = 0; i < count(); i++) - { - if (widget(i)->width() > width) - width = widget(i)->width(); - } - - setMinimumWidth(width); -} - -void DcrawSettingsWidget::processDcrawUrl(const QString& url) -{ - KToolInvocation::self()->invokeBrowser(url); -} - -KUrlRequester* DcrawSettingsWidget::inputProfileUrlEdit() const -{ - return d->inIccUrlEdit; -} - -KUrlRequester* DcrawSettingsWidget::outputProfileUrlEdit() const -{ - return d->outIccUrlEdit; -} - -void DcrawSettingsWidget::resetToDefault() -{ - setSettings(RawDecodingSettings()); -} - -void DcrawSettingsWidget::slotsixteenBitsImageToggled(bool b) -{ - setEnabledBrightnessSettings(!b); - emit signalSixteenBitsImageToggled(d->sixteenBitsImage->isChecked()); -} - -void DcrawSettingsWidget::slotWhiteBalanceToggled(int v) -{ - if (v == 3) - { - d->customWhiteBalanceSpinBox->setEnabled(true); - d->customWhiteBalanceGreenSpinBox->setEnabled(true); - d->customWhiteBalanceLabel->setEnabled(true); - d->customWhiteBalanceGreenLabel->setEnabled(true); - } - else - { - d->customWhiteBalanceSpinBox->setEnabled(false); - d->customWhiteBalanceGreenSpinBox->setEnabled(false); - d->customWhiteBalanceLabel->setEnabled(false); - d->customWhiteBalanceGreenLabel->setEnabled(false); - } -} - -void DcrawSettingsWidget::slotUnclipColorActivated(int v) -{ - if (v == 3) // Reconstruct Highlight method - { - d->reconstructLabel->setEnabled(true); - d->reconstructSpinBox->setEnabled(true); - } - else - { - d->reconstructLabel->setEnabled(false); - d->reconstructSpinBox->setEnabled(false); - } -} - -void DcrawSettingsWidget::slotNoiseReductionChanged(int item) -{ - d->NRSpinBox1->setEnabled(true); - d->NRLabel1->setEnabled(true); - d->NRSpinBox2->setEnabled(true); - d->NRLabel2->setEnabled(true); - d->NRLabel1->setText(i18nc("@label", "Threshold:")); - d->NRSpinBox1->setWhatsThis(i18nc("@info:whatsthis", "Threshold" - "Set here the noise reduction threshold value to use.")); - - switch(item) - { - case RawDecodingSettings::WAVELETSNR: - case RawDecodingSettings::FBDDNR: - case RawDecodingSettings::LINENR: - d->NRSpinBox2->setVisible(false); - d->NRLabel2->setVisible(false); - break; - - case RawDecodingSettings::IMPULSENR: - d->NRLabel1->setText(i18nc("@label", "Luminance:")); - d->NRSpinBox1->setWhatsThis(i18nc("@info:whatsthis", "Luminance" - "Amount of Luminance impulse noise reduction.")); - d->NRLabel2->setText(i18nc("@label", "Chrominance:")); - d->NRSpinBox2->setWhatsThis(i18nc("@info:whatsthis", "Chrominance" - "Amount of Chrominance impulse noise reduction.")); - d->NRSpinBox2->setVisible(true); - d->NRLabel2->setVisible(true); - break; - - default: - d->NRSpinBox1->setEnabled(false); - d->NRLabel1->setEnabled(false); - d->NRSpinBox2->setEnabled(false); - d->NRLabel2->setEnabled(false); - d->NRSpinBox2->setVisible(false); - d->NRLabel2->setVisible(false); - break; - } - - emit signalSettingsChanged(); -} - -void DcrawSettingsWidget::slotCACorrectionToggled(bool b) -{ - d->autoCACorrectionBox->setEnabled(b); - slotAutoCAToggled(d->autoCACorrectionBox->isChecked()); -} - -void DcrawSettingsWidget::slotAutoCAToggled(bool b) -{ - if (b) - { - d->caRedMultSpinBox->setValue(0.0); - d->caBlueMultSpinBox->setValue(0.0); - } - - bool mult = (!b) && (d->autoCACorrectionBox->isEnabled()); - d->caRedMultSpinBox->setEnabled(mult); - d->caBlueMultSpinBox->setEnabled(mult); - d->caRedMultLabel->setEnabled(mult); - d->caBlueMultLabel->setEnabled(mult); - emit signalSettingsChanged(); -} - -void DcrawSettingsWidget::slotExposureCorrectionToggled(bool b) -{ - d->expoCorrectionShiftLabel->setEnabled(b); - d->expoCorrectionShiftSpinBox->setEnabled(b); - d->expoCorrectionHighlightLabel->setEnabled(b); - d->expoCorrectionHighlightSpinBox->setEnabled(b); - - slotExpoCorrectionShiftChanged(d->expoCorrectionShiftSpinBox->value()); -} - -void DcrawSettingsWidget::slotExpoCorrectionShiftChanged(double ev) -{ - // Only enable Highligh exposure correction if Shift correction is >= 1.0, else this settings do not take effect. - bool b = (ev >= 1.0); - - d->expoCorrectionHighlightLabel->setEnabled(b); - d->expoCorrectionHighlightSpinBox->setEnabled(b); - - emit signalSettingsChanged(); -} - -void DcrawSettingsWidget::slotInputColorSpaceChanged(int item) -{ - d->inIccUrlEdit->setEnabled(item == RawDecodingSettings::CUSTOMINPUTCS); -} - -void DcrawSettingsWidget::slotOutputColorSpaceChanged(int item) -{ - d->outIccUrlEdit->setEnabled(item == RawDecodingSettings::CUSTOMOUTPUTCS); -} - -void DcrawSettingsWidget::slotRAWQualityChanged(int quality) -{ - switch(quality) - { - case RawDecodingSettings::DCB: - case RawDecodingSettings::VCD_AHD: - // These options can be only avaialble if Libraw use GPL2 pack. - d->medianFilterPassesLabel->setEnabled(KDcraw::librawUseGPL2DemosaicPack()); - d->medianFilterPassesSpinBox->setEnabled(KDcraw::librawUseGPL2DemosaicPack()); - d->refineInterpolationBox->setEnabled(KDcraw::librawUseGPL2DemosaicPack()); - break; - - case RawDecodingSettings::PL_AHD: - case RawDecodingSettings::AFD: - case RawDecodingSettings::VCD: - case RawDecodingSettings::LMMSE: - case RawDecodingSettings::AMAZE: - d->medianFilterPassesLabel->setEnabled(false); - d->medianFilterPassesSpinBox->setEnabled(false); - d->refineInterpolationBox->setEnabled(false); - break; - - default: // BILINEAR, VNG, PPG, AHD - d->medianFilterPassesLabel->setEnabled(true); - d->medianFilterPassesSpinBox->setEnabled(true); - d->refineInterpolationBox->setEnabled(false); - break; - } - - emit signalSettingsChanged(); -} - -void DcrawSettingsWidget::setEnabledBrightnessSettings(bool b) -{ - d->brightnessLabel->setEnabled(b); - d->brightnessSpinBox->setEnabled(b); -} - -bool DcrawSettingsWidget::brightnessSettingsIsEnabled() const -{ - return d->brightnessSpinBox->isEnabled(); -} - -void DcrawSettingsWidget::setSettings(const RawDecodingSettings& settings) -{ - d->sixteenBitsImage->setChecked(settings.sixteenBitsImage); - - switch(settings.whiteBalance) - { - case RawDecodingSettings::CAMERA: - d->whiteBalanceComboBox->setCurrentIndex(1); - break; - case RawDecodingSettings::AUTO: - d->whiteBalanceComboBox->setCurrentIndex(2); - break; - case RawDecodingSettings::CUSTOM: - d->whiteBalanceComboBox->setCurrentIndex(3); - break; - default: - d->whiteBalanceComboBox->setCurrentIndex(0); - break; - } - slotWhiteBalanceToggled(d->whiteBalanceComboBox->currentIndex()); - - d->customWhiteBalanceSpinBox->setValue(settings.customWhiteBalance); - d->customWhiteBalanceGreenSpinBox->setValue(settings.customWhiteBalanceGreen); - d->fourColorCheckBox->setChecked(settings.RGBInterpolate4Colors); - d->autoBrightnessBox->setChecked(settings.autoBrightness); - d->fixColorsHighlightsBox->setChecked(settings.fixColorsHighlights); - - switch(settings.unclipColors) - { - case 0: - d->unclipColorComboBox->setCurrentIndex(0); - break; - case 1: - d->unclipColorComboBox->setCurrentIndex(1); - break; - case 2: - d->unclipColorComboBox->setCurrentIndex(2); - break; - default: // Reconstruct Highlight method - d->unclipColorComboBox->setCurrentIndex(3); - d->reconstructSpinBox->setValue(settings.unclipColors-3); - break; - } - slotUnclipColorActivated(d->unclipColorComboBox->currentIndex()); - - d->dontStretchPixelsCheckBox->setChecked(settings.DontStretchPixels); - d->brightnessSpinBox->setValue(settings.brightness); - d->blackPointCheckBox->setChecked(settings.enableBlackPoint); - d->blackPointSpinBox->setEnabled(settings.enableBlackPoint); - d->blackPointSpinBox->setValue(settings.blackPoint); - d->whitePointCheckBox->setChecked(settings.enableWhitePoint); - d->whitePointSpinBox->setEnabled(settings.enableWhitePoint); - d->whitePointSpinBox->setValue(settings.whitePoint); - - int q = settings.RAWQuality; - - // If Libraw do not support GPL2 pack, reset to BILINEAR. - if (!KDcraw::librawUseGPL2DemosaicPack()) - { - for (int i=RawDecodingSettings::DCB ; i <=RawDecodingSettings::LMMSE ; ++i) - { - if (q == i) - { - q = RawDecodingSettings::BILINEAR; - kDebug() << "Libraw GPL2 pack not avaialble. Raw quality set to Bilinear"; - break; - } - } - } - - // If Libraw do not support GPL3 pack, reset to BILINEAR. - if (!KDcraw::librawUseGPL3DemosaicPack() && (q == RawDecodingSettings::AMAZE)) - { - q = RawDecodingSettings::BILINEAR; - kDebug() << "Libraw GPL3 pack not avaialble. Raw quality set to Bilinear"; - } - - d->RAWQualityComboBox->setCurrentIndex(q); - - switch(q) - { - case RawDecodingSettings::DCB: - d->medianFilterPassesSpinBox->setValue(settings.dcbIterations); - d->refineInterpolationBox->setChecked(settings.dcbEnhanceFl); - break; - case RawDecodingSettings::VCD_AHD: - d->medianFilterPassesSpinBox->setValue(settings.eeciRefine); - d->refineInterpolationBox->setChecked(settings.eeciRefine); - break; - default: - d->medianFilterPassesSpinBox->setValue(settings.medianFilterPasses); - d->refineInterpolationBox->setChecked(false); // option not used. - break; - } - - slotRAWQualityChanged(q); - - d->inputColorSpaceComboBox->setCurrentIndex((int)settings.inputColorSpace); - slotInputColorSpaceChanged((int)settings.inputColorSpace); - d->outputColorSpaceComboBox->setCurrentIndex((int)settings.outputColorSpace); - slotOutputColorSpaceChanged((int)settings.outputColorSpace); - - d->noiseReductionComboBox->setCurrentIndex(settings.NRType); - slotNoiseReductionChanged(settings.NRType); - d->NRSpinBox1->setValue(settings.NRThreshold); - d->NRSpinBox2->setValue(settings.NRChroThreshold); - - d->enableCACorrectionBox->setChecked(settings.enableCACorrection); - d->caRedMultSpinBox->setValue(settings.caMultiplier[0]); - d->caBlueMultSpinBox->setValue(settings.caMultiplier[1]); - d->autoCACorrectionBox->setChecked((settings.caMultiplier[0] == 0.0) && (settings.caMultiplier[1] == 0.0)); - slotCACorrectionToggled(settings.enableCACorrection); - - d->expoCorrectionBox->setChecked(settings.expoCorrection); - slotExposureCorrectionToggled(settings.expoCorrection); - d->expoCorrectionShiftSpinBox->setValue(d->shiftExpoFromLinearToEv(settings.expoCorrectionShift)); - d->expoCorrectionHighlightSpinBox->setValue(settings.expoCorrectionHighlight); - - d->inIccUrlEdit->setUrl(KUrl(settings.inputProfile)); - d->outIccUrlEdit->setUrl(KUrl(settings.outputProfile)); -} - -RawDecodingSettings DcrawSettingsWidget::settings() const -{ - RawDecodingSettings prm; - prm.sixteenBitsImage = d->sixteenBitsImage->isChecked(); - - switch(d->whiteBalanceComboBox->currentIndex()) - { - case 1: - prm.whiteBalance = RawDecodingSettings::CAMERA; - break; - case 2: - prm.whiteBalance = RawDecodingSettings::AUTO; - break; - case 3: - prm.whiteBalance = RawDecodingSettings::CUSTOM; - break; - default: - prm.whiteBalance = RawDecodingSettings::NONE; - break; - } - - prm.customWhiteBalance = d->customWhiteBalanceSpinBox->value(); - prm.customWhiteBalanceGreen = d->customWhiteBalanceGreenSpinBox->value(); - prm.RGBInterpolate4Colors = d->fourColorCheckBox->isChecked(); - prm.autoBrightness = d->autoBrightnessBox->isChecked(); - prm.fixColorsHighlights = d->fixColorsHighlightsBox->isChecked(); - - switch(d->unclipColorComboBox->currentIndex()) - { - case 0: - prm.unclipColors = 0; - break; - case 1: - prm.unclipColors = 1; - break; - case 2: - prm.unclipColors = 2; - break; - default: // Reconstruct Highlight method - prm.unclipColors = d->reconstructSpinBox->value()+3; - break; - } - - prm.DontStretchPixels = d->dontStretchPixelsCheckBox->isChecked(); - prm.brightness = d->brightnessSpinBox->value(); - prm.enableBlackPoint = d->blackPointCheckBox->isChecked(); - prm.blackPoint = d->blackPointSpinBox->value(); - prm.enableWhitePoint = d->whitePointCheckBox->isChecked(); - prm.whitePoint = d->whitePointSpinBox->value(); - - prm.RAWQuality = (RawDecodingSettings::DecodingQuality)d->RAWQualityComboBox->currentIndex(); - switch(prm.RAWQuality) - { - case RawDecodingSettings::DCB: - prm.dcbIterations = d->medianFilterPassesSpinBox->value(); - prm.dcbEnhanceFl = d->refineInterpolationBox->isChecked(); - break; - case RawDecodingSettings::VCD_AHD: - prm.esMedPasses = d->medianFilterPassesSpinBox->value(); - prm.eeciRefine = d->refineInterpolationBox->isChecked(); - break; - default: - prm.medianFilterPasses = d->medianFilterPassesSpinBox->value(); - break; - } - - prm.NRType = (RawDecodingSettings::NoiseReduction)d->noiseReductionComboBox->currentIndex(); - switch (prm.NRType) - { - case RawDecodingSettings::NONR: - { - prm.NRThreshold = 0; - prm.NRChroThreshold = 0; - break; - } - case RawDecodingSettings::WAVELETSNR: - case RawDecodingSettings::FBDDNR: - case RawDecodingSettings::LINENR: - { - prm.NRThreshold = d->NRSpinBox1->value(); - prm.NRChroThreshold = 0; - break; - } - default: // IMPULSENR - { - prm.NRThreshold = d->NRSpinBox1->value(); - prm.NRChroThreshold = d->NRSpinBox2->value(); - break; - } - } - - prm.enableCACorrection = d->enableCACorrectionBox->isChecked(); - prm.caMultiplier[0] = d->caRedMultSpinBox->value(); - prm.caMultiplier[1] = d->caBlueMultSpinBox->value(); - - prm.expoCorrection = d->expoCorrectionBox->isChecked(); - prm.expoCorrectionShift = d->shiftExpoFromEvToLinear(d->expoCorrectionShiftSpinBox->value()); - prm.expoCorrectionHighlight = d->expoCorrectionHighlightSpinBox->value(); - - prm.inputColorSpace = (RawDecodingSettings::InputColorSpace)(d->inputColorSpaceComboBox->currentIndex()); - prm.outputColorSpace = (RawDecodingSettings::OutputColorSpace)(d->outputColorSpaceComboBox->currentIndex()); - prm.inputProfile = d->inIccUrlEdit->url().toLocalFile(); - prm.outputProfile = d->outIccUrlEdit->url().toLocalFile(); - - return prm; -} - -void DcrawSettingsWidget::writeSettings(KConfigGroup& group) -{ - RawDecodingSettings prm = settings(); - prm.writeSettings(group); - RExpanderBox::writeSettings(group); -} - -void DcrawSettingsWidget::readSettings(KConfigGroup& group) -{ - RawDecodingSettings prm; - prm.readSettings(group); - setSettings(prm); - RExpanderBox::readSettings(group); -} - -} // NameSpace KDcrawIface diff --git a/kdcraw/libkdcraw/dcrawsettingswidget.h b/kdcraw/libkdcraw/dcrawsettingswidget.h deleted file mode 100644 index 6f4745d7..00000000 --- a/kdcraw/libkdcraw/dcrawsettingswidget.h +++ /dev/null @@ -1,127 +0,0 @@ -/** =========================================================== - * @file - * - * This file is a part of digiKam project - * http://www.digikam.org - * - * @date 2006-09-13 - * @brief LibRaw settings widgets - * - * @author Copyright (C) 2006-2013 by Gilles Caulier - * caulier dot gilles at gmail dot com - * @author Copyright (C) 2006-2011 by Marcel Wiesweg - * marcel dot wiesweg at gmx dot de - * @author Copyright (C) 2007-2008 by Guillaume Castagnino - * casta at xwing dot info - * - * This program 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 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * ============================================================ */ - -#ifndef DCRAW_SETTINGS_WIDGET_H -#define DCRAW_SETTINGS_WIDGET_H - -// Qt includes - -#include - -// KDE includes - -#include -#include - -// Local includes - -#include "kdcraw_export.h" -#include "rawdecodingsettings.h" -#include "rexpanderbox.h" - -namespace KDcrawIface -{ - -class KDCRAW_EXPORT DcrawSettingsWidget : public RExpanderBox -{ - Q_OBJECT - -public: - - enum AdvancedSettingsOptions - { - SIXTEENBITS = 0x00000001, - COLORSPACE = 0x00000002, - POSTPROCESSING = 0x00000004, - BLACKWHITEPOINTS = 0x00000008 - }; - - enum SettingsTabs - { - DEMOSAICING = 0, - WHITEBALANCE, - CORRECTIONS, - COLORMANAGEMENT - }; - -public: - - /** - * @param advSettings the default value is COLORSPACE - */ - explicit DcrawSettingsWidget(QWidget* const parent, int advSettings = COLORSPACE); - virtual ~DcrawSettingsWidget(); - - KUrlRequester* inputProfileUrlEdit() const; - KUrlRequester* outputProfileUrlEdit() const; - - void setup(int advSettings); - - void setEnabledBrightnessSettings(bool b); - bool brightnessSettingsIsEnabled() const; - - void updateMinimumWidth(); - - void resetToDefault(); - - void setSettings(const RawDecodingSettings& settings); - RawDecodingSettings settings() const; - - void readSettings(KConfigGroup& group); - void writeSettings(KConfigGroup& group); - -Q_SIGNALS: - - void signalSixteenBitsImageToggled(bool); - void signalSettingsChanged(); - -private Q_SLOTS: - - void slotWhiteBalanceToggled(int); - void slotsixteenBitsImageToggled(bool); - void slotUnclipColorActivated(int); - void slotNoiseReductionChanged(int); - void slotCACorrectionToggled(bool); - void slotExposureCorrectionToggled(bool); - void slotAutoCAToggled(bool); - void processDcrawUrl(const QString&); - void slotInputColorSpaceChanged(int); - void slotOutputColorSpaceChanged(int); - void slotRAWQualityChanged(int); - void slotExpoCorrectionShiftChanged(double); - -private: - - class Private; - Private* const d; -}; - -} // NameSpace KDcrawIface - -#endif /* DCRAW_SETTINGS_WIDGET_H */ diff --git a/kdcraw/libkdcraw/kdcraw.cpp b/kdcraw/libkdcraw/kdcraw.cpp deleted file mode 100644 index 0091be60..00000000 --- a/kdcraw/libkdcraw/kdcraw.cpp +++ /dev/null @@ -1,593 +0,0 @@ -/** =========================================================== - * @file - * - * This file is a part of digiKam project - * http://www.digikam.org - * - * @date 2006-12-09 - * @brief a tread-safe libraw C++ program interface - * - * @author Copyright (C) 2006-2013 by Gilles Caulier - * caulier dot gilles at gmail dot com - * @author Copyright (C) 2006-2013 by Marcel Wiesweg - * marcel dot wiesweg at gmx dot de - * @author Copyright (C) 2007-2008 by Guillaume Castagnino - * casta at xwing dot info - * - * This program 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 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * ============================================================ */ - -#include "moc_kdcraw.cpp" -#include "kdcraw_p.h" - -// Qt includes - -#include -#include -#include - -// KDE includes -#include - -// LibRaw includes - -#include - -#ifdef LIBRAW_HAS_CONFIG -#include -#endif - -// Local includes - -#include "version.h" -#include "rawfiles.h" - -static const KCatalogLoader loader("libkdcraw"); - -namespace KDcrawIface -{ - -KDcraw::KDcraw() - : d(new Private(this)) -{ - m_cancel = false; -} - -KDcraw::~KDcraw() -{ - cancel(); - delete d; -} - -QString KDcraw::version() -{ - return QString(kdcraw_version); -} - -void KDcraw::cancel() -{ - m_cancel = true; -} - -bool KDcraw::loadRawPreview(QImage& image, const QString& path) -{ - // In first, try to extract the embedded JPEG preview. Very fast. - bool ret = loadEmbeddedPreview(image, path); - - if (ret) - return true; - - // In second, decode and half size of RAW picture. More slow. - return (loadHalfPreview(image, path)); -} - -bool KDcraw::loadEmbeddedPreview(QImage& image, const QString& path) -{ - QByteArray imgData; - - if ( loadEmbeddedPreview(imgData, path) ) - { - kDebug() << "Preview data size:" << imgData.size(); - - if (image.loadFromData( imgData )) - { - kDebug() << "Using embedded RAW preview extraction"; - return true; - } - } - - kDebug() << "Failed to load embedded RAW preview"; - return false; -} - -bool KDcraw::loadEmbeddedPreview(QByteArray& imgData, const QString& path) -{ - QFileInfo fileInfo(path); - QString rawFilesExt(rawFiles()); - QString ext = fileInfo.suffix().toUpper(); - - if (!fileInfo.exists() || ext.isEmpty() || !rawFilesExt.toUpper().contains(ext)) - return false; - - LibRaw raw; - - int ret = raw.open_file(QFile::encodeName(path)); - - if (ret != LIBRAW_SUCCESS) - { - kDebug() << "LibRaw: failed to run open_file: " << libraw_strerror(ret); - raw.recycle(); - return false; - } - - return (Private::loadEmbeddedPreview(imgData, raw)); -} - -bool KDcraw::loadEmbeddedPreview(QByteArray& imgData, const QBuffer& buffer) -{ - QString rawFilesExt(KDcrawIface::KDcraw::rawFiles()); - LibRaw raw; - - QByteArray inData = buffer.data(); - int ret = raw.open_buffer((void*) inData.data(), (size_t) inData.size()); - - if (ret != LIBRAW_SUCCESS) - { - kDebug() << "LibRaw: failed to run open_buffer: " << libraw_strerror(ret); - raw.recycle(); - return false; - } - - return (Private::loadEmbeddedPreview(imgData, raw)); -} - -bool KDcraw::loadHalfPreview(QImage& image, const QString& path) -{ - QFileInfo fileInfo(path); - QString rawFilesExt(rawFiles()); - QString ext = fileInfo.suffix().toUpper(); - - if (!fileInfo.exists() || ext.isEmpty() || !rawFilesExt.toUpper().contains(ext)) - return false; - - kDebug() << "Try to use reduced RAW picture extraction"; - - LibRaw raw; - raw.imgdata.params.use_auto_wb = 1; // Use automatic white balance. - raw.imgdata.params.use_camera_wb = 1; // Use camera white balance, if possible. - raw.imgdata.params.half_size = 1; // Half-size color image (3x faster than -q). - - int ret = raw.open_file(QFile::encodeName(path)); - - if (ret != LIBRAW_SUCCESS) - { - kDebug() << "LibRaw: failed to run open_file: " << libraw_strerror(ret); - raw.recycle(); - return false; - } - - - if(!Private::loadHalfPreview(image, raw)) - { - kDebug() << "Failed to get half preview from LibRaw!"; - return false; - } - - kDebug() << "Using reduced RAW picture extraction"; - - return true; -} - -bool KDcraw::loadHalfPreview(QByteArray& imgData, const QString& path) -{ - QFileInfo fileInfo(path); - QString rawFilesExt(rawFiles()); - QString ext = fileInfo.suffix().toUpper(); - - if (!fileInfo.exists() || ext.isEmpty() || !rawFilesExt.toUpper().contains(ext)) - return false; - - kDebug() << "Try to use reduced RAW picture extraction"; - - LibRaw raw; - int ret = raw.open_file(QFile::encodeName(path)); - - if (ret != LIBRAW_SUCCESS) - { - kDebug() << "LibRaw: failed to run dcraw_process: " << libraw_strerror(ret); - raw.recycle(); - return false; - } - - QImage image; - - if (!Private::loadHalfPreview(image, raw)) - { - kDebug() << "KDcraw: failed to get half preview: " << libraw_strerror(ret); - return false; - } - - QBuffer buffer(&imgData); - buffer.open(QIODevice::WriteOnly); - image.save(&buffer, "JPEG"); - - return true; -} - -bool KDcraw::loadHalfPreview(QByteArray& imgData, const QBuffer& inBuffer) -{ - QString rawFilesExt(KDcrawIface::KDcraw::rawFiles()); - LibRaw raw; - - QByteArray inData = inBuffer.data(); - int ret = raw.open_buffer((void*) inData.data(), (size_t) inData.size()); - - if (ret != LIBRAW_SUCCESS) - { - kDebug() << "LibRaw: failed to run dcraw_make_mem_image: " << libraw_strerror(ret); - raw.recycle(); - return false; - } - - QImage image; - - if (!Private::loadHalfPreview(image, raw)) - { - kDebug() << "KDcraw: failed to get half preview: " << libraw_strerror(ret); - return false; - } - - QBuffer buffer(&imgData); - buffer.open(QIODevice::WriteOnly); - image.save(&buffer, "JPG"); - - return true; -} - -bool KDcraw::loadFullImage(QImage& image, const QString& path, const RawDecodingSettings& settings) -{ - QFileInfo fileInfo(path); - QString rawFilesExt(rawFiles()); - QString ext = fileInfo.suffix().toUpper(); - - if (!fileInfo.exists() || ext.isEmpty() || !rawFilesExt.toUpper().contains(ext)) - return false; - - kDebug() << "Try to load full RAW picture..."; - - RawDecodingSettings prm = settings; - prm.sixteenBitsImage = false; - QByteArray imgData; - int width, height, rgbmax; - - KDcraw decoder; - bool ret = decoder.decodeRAWImage(path, prm, imgData, width, height, rgbmax); - - if (!ret) - { - kDebug() << "Failled to load full RAW picture"; - return false; - } - - uchar* sptr = (uchar*)imgData.data(); - uchar tmp8[2]; - - // Set RGB color components. - for (int i = 0 ; i < width * height ; ++i) - { - // Swap Red and Blue - tmp8[0] = sptr[2]; - tmp8[1] = sptr[0]; - sptr[0] = tmp8[0]; - sptr[2] = tmp8[1]; - - sptr += 3; - } - - image = QImage(width, height, QImage::Format_ARGB32); - uint* dptr = reinterpret_cast(image.bits()); - sptr = (uchar*)imgData.data(); - - for (int i = 0 ; i < width * height ; ++i) - { - *dptr++ = qRgba(sptr[2], sptr[1], sptr[0], 0xFF); - sptr += 3; - } - - kDebug() << "Load full RAW picture done"; - - return true; -} - -bool KDcraw::rawFileIdentify(DcrawInfoContainer& identify, const QString& path) -{ - QFileInfo fileInfo(path); - QString rawFilesExt(rawFiles()); - QString ext = fileInfo.suffix().toUpper(); - identify.isDecodable = false; - - if (!fileInfo.exists() || ext.isEmpty() || !rawFilesExt.toUpper().contains(ext)) - return false; - - LibRaw raw; - - int ret = raw.open_file(QFile::encodeName(path)); - - if (ret != LIBRAW_SUCCESS) - { - kDebug() << "LibRaw: failed to run open_file: " << libraw_strerror(ret); - raw.recycle(); - return false; - } - - ret = raw.adjust_sizes_info_only(); - - if (ret != LIBRAW_SUCCESS) - { - kDebug() << "LibRaw: failed to run adjust_sizes_info_only: " << libraw_strerror(ret); - raw.recycle(); - return false; - } - - Private::fillIndentifyInfo(&raw, identify); - raw.recycle(); - return true; -} - -// ---------------------------------------------------------------------------------- - -bool KDcraw::extractRAWData(const QString& filePath, QByteArray& rawData, DcrawInfoContainer& identify, unsigned int shotSelect) -{ - QFileInfo fileInfo(filePath); - QString rawFilesExt(rawFiles()); - QString ext = fileInfo.suffix().toUpper(); - identify.isDecodable = false; - - if (!fileInfo.exists() || ext.isEmpty() || !rawFilesExt.toUpper().contains(ext)) - return false; - - if (m_cancel) - return false; - - d->setProgress(0.1); - - LibRaw raw; - // Set progress call back function. - raw.set_progress_handler(callbackForLibRaw, d); - - int ret = raw.open_file(QFile::encodeName(filePath)); - - if (ret != LIBRAW_SUCCESS) - { - kDebug() << "LibRaw: failed to run open_file: " << libraw_strerror(ret); - raw.recycle(); - return false; - } - - if (m_cancel) - { - raw.recycle(); - return false; - } - - d->setProgress(0.3); - - raw.imgdata.params.output_bps = 16; - raw.imgdata.params.shot_select = shotSelect; - ret = raw.unpack(); - - if (ret != LIBRAW_SUCCESS) - { - kDebug() << "LibRaw: failed to run unpack: " << libraw_strerror(ret); - raw.recycle(); - return false; - } - - if (m_cancel) - { - raw.recycle(); - return false; - } - - d->setProgress(0.4); - - ret = raw.raw2image(); - - if (ret != LIBRAW_SUCCESS) - { - kDebug() << "LibRaw: failed to run raw2image: " << libraw_strerror(ret); - raw.recycle(); - return false; - } - - if (m_cancel) - { - raw.recycle(); - return false; - } - - d->setProgress(0.6); - - Private::fillIndentifyInfo(&raw, identify); - - if (m_cancel) - { - raw.recycle(); - return false; - } - - d->setProgress(0.8); - - rawData = QByteArray(); - - if (raw.imgdata.idata.filters == 0) - { - qulonglong overflowcheck = qulonglong(raw.imgdata.sizes.iwidth) * raw.imgdata.sizes.iheight * raw.imgdata.idata.colors * sizeof(unsigned short); - if (overflowcheck > INT_MAX) { - kDebug() << "Raw data size overflow"; - raw.recycle(); - return false; - } - rawData.resize(int(overflowcheck)); - - unsigned short* output = reinterpret_cast(rawData.data()); - - for (unsigned int row = 0; row < raw.imgdata.sizes.iheight; row++) - { - for (unsigned int col = 0; col < raw.imgdata.sizes.iwidth; col++) - { - for (int color = 0; color < raw.imgdata.idata.colors; color++) - { - *output = raw.imgdata.image[raw.imgdata.sizes.iwidth*row + col][color]; - output++; - } - } - } - } - else - { - qulonglong overflowcheck = qulonglong(raw.imgdata.sizes.iwidth) * raw.imgdata.sizes.iheight * sizeof(unsigned short); - if (overflowcheck > INT_MAX) { - kDebug() << "Raw data size overflow"; - raw.recycle(); - return false; - } - rawData.resize(int(overflowcheck)); - - unsigned short* output = reinterpret_cast(rawData.data()); - - for (uint row = 0; row < raw.imgdata.sizes.iheight; row++) - { - for (uint col = 0; col < raw.imgdata.sizes.iwidth; col++) - { - *output = raw.imgdata.image[raw.imgdata.sizes.iwidth*row + col][raw.COLOR(row, col)]; - output++; - } - } - } - - raw.recycle(); - d->setProgress(1.0); - - return true; -} - -bool KDcraw::decodeHalfRAWImage(const QString& filePath, const RawDecodingSettings& rawDecodingSettings, - QByteArray& imageData, int& width, int& height, int& rgbmax) -{ - m_rawDecodingSettings = rawDecodingSettings; - m_rawDecodingSettings.halfSizeColorImage = true; - return (d->loadFromLibraw(filePath, imageData, width, height, rgbmax)); -} - -bool KDcraw::decodeRAWImage(const QString& filePath, const RawDecodingSettings& rawDecodingSettings, - QByteArray& imageData, int& width, int& height, int& rgbmax) -{ - m_rawDecodingSettings = rawDecodingSettings; - return (d->loadFromLibraw(filePath, imageData, width, height, rgbmax)); -} - -bool KDcraw::checkToCancelWaitingData() -{ - return m_cancel; -} - -void KDcraw::setWaitingDataProgress(double) -{ -} - -const char* KDcraw::rawFiles() -{ - return raw_file_extentions; -} - -QStringList KDcraw::rawFilesList() -{ - QString string = QString::fromLatin1(rawFiles()); - return string.remove("*.").split(' '); -} - -int KDcraw::rawFilesVersion() -{ - return raw_file_extensions_version; -} - -QStringList KDcraw::supportedCamera() -{ - QStringList camera; - const char** const list = LibRaw::cameraList(); - - for (int i = 0; i < LibRaw::cameraCount(); i++) - camera.append(list[i]); - - return camera; -} - -QString KDcraw::librawVersion() -{ - return QString(LIBRAW_VERSION_STR).remove("-Release"); -} - -int KDcraw::librawUseGomp() -{ -#ifdef LIBRAW_HAS_CONFIG -# ifdef LIBRAW_USE_OPENMP - return true; -# else - return false; -# endif -#else - return -1; -#endif -} - -int KDcraw::librawUseRawSpeed() -{ -#ifdef LIBRAW_HAS_CONFIG -# ifdef LIBRAW_USE_RAWSPEED - return true; -# else - return false; -# endif -#else - return -1; -#endif -} - -int KDcraw::librawUseGPL2DemosaicPack() -{ -#ifdef LIBRAW_HAS_CONFIG -# ifdef LIBRAW_USE_DEMOSAIC_PACK_GPL2 - return true; -# else - return false; -# endif -#else - return -1; -#endif -} - -int KDcraw::librawUseGPL3DemosaicPack() -{ -#ifdef LIBRAW_HAS_CONFIG -# ifdef LIBRAW_USE_DEMOSAIC_PACK_GPL3 - return true; -# else - return false; -# endif -#else - return -1; -#endif -} - -} // namespace KDcrawIface diff --git a/kdcraw/libkdcraw/kdcraw.h b/kdcraw/libkdcraw/kdcraw.h deleted file mode 100644 index 2777cde6..00000000 --- a/kdcraw/libkdcraw/kdcraw.h +++ /dev/null @@ -1,267 +0,0 @@ -/** =========================================================== - * @file - * - * This file is a part of digiKam project - * http://www.digikam.org - * - * @date 2006-12-09 - * @brief a tread-safe libraw C++ program interface - * - * @author Copyright (C) 2006-2013 by Gilles Caulier - * caulier dot gilles at gmail dot com - * @author Copyright (C) 2006-2013 by Marcel Wiesweg - * marcel dot wiesweg at gmx dot de - * @author Copyright (C) 2007-2008 by Guillaume Castagnino - * casta at xwing dot info - * - * This program 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 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * ============================================================ */ - -#ifndef KDCRAW_H -#define KDCRAW_H - -// C++ includes - -#include - -// Qt includes - -#include -#include -#include -#include - -// Local includes - -#include "kdcraw_export.h" -#include "rawdecodingsettings.h" -#include "dcrawinfocontainer.h" - -/** @brief Main namespace of libKDcraw - */ -namespace KDcrawIface -{ - -class KDCRAW_EXPORT KDcraw : public QObject -{ - Q_OBJECT - -public: - - /** Standard constructor. - */ - KDcraw(); - - /** Standard destructor. - */ - virtual ~KDcraw(); - -public: - - /** Return a string version of libkdcraw release - */ - static QString version(); - - /** Get the preview of RAW picture as a QImage. - It tries loadEmbeddedPreview() first and if it fails, calls loadHalfPreview(). - */ - static bool loadRawPreview(QImage& image, const QString& path); - - /** Get the preview of RAW picture as a QByteArray holding JPEG data. - It tries loadEmbeddedPreview() first and if it fails, calls loadHalfPreview(). - */ - static bool loadRawPreview(QByteArray& imgData, const QString& path); - - /** Get the preview of RAW picture passed in QBuffer as a QByteArray holding JPEG data. - It tries loadEmbeddedPreview() first and if it fails, calls loadHalfPreview(). - */ - static bool loadRawPreview(QByteArray& imgData, const QBuffer& inBuffer); - - /** Get the embedded JPEG preview image from RAW picture as a QByteArray which will include Exif Data. - This is fast and non cancelable. This method does not require a class instance to run. - */ - static bool loadEmbeddedPreview(QByteArray& imgData, const QString& path); - - /** Get the embedded JPEG preview image from RAW picture as a QImage. This is fast and non cancelable - This method does not require a class instance to run. - */ - static bool loadEmbeddedPreview(QImage& image, const QString& path); - - /** Get the embedded JPEG preview image from RAW image passed in QBuffer as a QByteArray which will include Exif Data. - This is fast and non cancelable. This method does not require a class instance to run. - */ - static bool loadEmbeddedPreview(QByteArray& imgData, const QBuffer& inBuffer); - - /** Get the half decoded RAW picture. This is slower than loadEmbeddedPreview() method - and non cancelable. This method does not require a class instance to run. - */ - static bool loadHalfPreview(QImage& image, const QString& path); - - /** Get the half decoded RAW picture as JPEG data in QByteArray. This is slower than loadEmbeddedPreview() - method and non cancelable. This method does not require a class instance to run. - */ - static bool loadHalfPreview(QByteArray& imgData, const QString& path); - - /** Get the half decoded RAW picture passed in QBuffer as JPEG data in QByteArray. This is slower than loadEmbeddedPreview() - method and non cancelable. This method does not require a class instance to run. - */ - static bool loadHalfPreview(QByteArray& imgData, const QBuffer& inBuffer); - - /** Get the full decoded RAW picture. This is a more slower than loadHalfPreview() method - and non cancelable. This method does not require a class instance to run. - */ - static bool loadFullImage(QImage& image, const QString& path, const RawDecodingSettings& settings = RawDecodingSettings()); - - /** Get the camera settings witch have taken RAW file. Look into dcrawinfocontainer.h - for more details. This is a fast and non cancelable method witch do not require - a class instance to run. - */ - static bool rawFileIdentify(DcrawInfoContainer& identify, const QString& path); - - /** Return the string of all RAW file type mime supported. - */ - static const char* rawFiles(); - - /** Return the list of all RAW file type mime supported, - as a QStringList, without wildcard and suffix dot. - */ - static QStringList rawFilesList(); - - /** Returns a version number for the list of supported RAW file types. - This version is incremented if the list of supported formats has changed - between library releases. - */ - static int rawFilesVersion(); - - /** Provide a list of supported RAW Camera name. - */ - static QStringList supportedCamera(); - - /** Return LibRaw version string. - */ - static QString librawVersion(); - - /** Return true or false if LibRaw use parallel demosaicing or not (libgomp support). - * Return -1 if undefined. - */ - static int librawUseGomp(); - - /** Return true or false if LibRaw use RawSpeed codec or not. - * Return -1 if undefined. - */ - static int librawUseRawSpeed(); - - /** Return true or false if LibRaw use Demosaic Pack GPL2 or not. - * Return -1 if undefined. - */ - static int librawUseGPL2DemosaicPack(); - - /** Return true or false if LibRaw use Demosaic Pack GPL3 or not. - * Return -1 if undefined. - */ - static int librawUseGPL3DemosaicPack(); - -public: - - /** Extract Raw image data undemosaiced and without post processing from 'filePath' picture file. - This is a cancelable method which require a class instance to run because RAW pictures loading - can take a while. - - This method return: - - - A byte array container 'rawData' with raw data. - - All info about Raw image into 'identify' container. - - 'false' is returned if loadding failed, else 'true'. - */ - bool extractRAWData(const QString& filePath, QByteArray& rawData, DcrawInfoContainer& identify, unsigned int shotSelect=0); - - /** Extract a small size of decode RAW data from 'filePath' picture file using - 'rawDecodingSettings' settings. This is a cancelable method which require - a class instance to run because RAW pictures decoding can take a while. - - This method return: - - - A byte array container 'imageData' with picture data. Pixels order is RGB. - Color depth can be 8 or 16. In 8 bits you can access to color component - using (uchar*), in 16 bits using (ushort*). - - - Size size of image in number of pixels ('width' and 'height'). - - The max average of RGB components from decoded picture. - - 'false' is returned if decoding failed, else 'true'. - */ - bool decodeHalfRAWImage(const QString& filePath, const RawDecodingSettings& rawDecodingSettings, - QByteArray& imageData, int& width, int& height, int& rgbmax); - - /** Extract a full size of RAW data from 'filePath' picture file using - 'rawDecodingSettings' settings. This is a cancelable method which require - a class instance to run because RAW pictures decoding can take a while. - - This method return: - - - A byte array container 'imageData' with picture data. Pixels order is RGB. - Color depth can be 8 or 16. In 8 bits you can access to color component - using (uchar*), in 16 bits using (ushort*). - - - Size size of image in number of pixels ('width' and 'height'). - - The max average of RGB components from decoded picture. - - 'false' is returned if decoding failed, else 'true'. - */ - bool decodeRAWImage(const QString& filePath, const RawDecodingSettings& rawDecodingSettings, - QByteArray& imageData, int& width, int& height, int& rgbmax); - - /** To cancel 'decodeHalfRAWImage' and 'decodeRAWImage' methods running - in a separate thread. - */ - void cancel(); - -protected: - - /** Used internally to cancel RAW decoding operation. Normally, you don't need to use it - directly, excepted if you derivated this class. Usual way is to use cancel() method - */ - bool m_cancel; - - /** The settings container used to perform RAW pictures decoding. See 'rawdecodingsetting.h' - for details. - */ - RawDecodingSettings m_rawDecodingSettings; - -protected: - - /** Re-implement this method to control the cancelisation of loop witch wait data - from RAW decoding process with your propers envirronement. - By default, this method check if m_cancel is true. - */ - virtual bool checkToCancelWaitingData(); - - /** Re-implement this method to control the pseudo progress value during RAW decoding (when dcraw run with an - internal loop without feedback) with your proper environment. By default, this method does nothing. - Progress value average for this stage is 0%-n%, with 'n' == 40% max (see setWaitingDataProgress() method). - */ - virtual void setWaitingDataProgress(double value); - -public: - - // Declared public to be called externally by callbackForLibRaw() static method. - class Private; - -private: - - Private* const d; - - friend class Private; -}; - -} // namespace KDcrawIface - -#endif /* KDCRAW_H */ diff --git a/kdcraw/libkdcraw/kdcraw_p.cpp b/kdcraw/libkdcraw/kdcraw_p.cpp deleted file mode 100644 index 4395e71c..00000000 --- a/kdcraw/libkdcraw/kdcraw_p.cpp +++ /dev/null @@ -1,692 +0,0 @@ -/** =========================================================== - * @file - * - * This file is a part of digiKam project - * http://www.digikam.org - * - * @date 2008-10-09 - * @brief internal private container for KDcraw - * - * @author Copyright (C) 2008-2013 by Gilles Caulier - * caulier dot gilles at gmail dot com - * - * This program 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 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * ============================================================ */ - -#include "kdcraw.h" -#include "kdcraw_p.h" - -// Qt includes - -#include -#include - -namespace KDcrawIface -{ - -int callbackForLibRaw(void* data, enum LibRaw_progress p, int iteration, int expected) -{ - if (data) - { - KDcraw::Private* const d = static_cast(data); - - if (d) - { - return d->progressCallback(p, iteration, expected); - } - } - - return 0; -} - -// -------------------------------------------------------------------------------------------------- - -KDcraw::Private::Private(KDcraw* const p) -{ - m_progress = 0.0; - m_parent = p; -} - -KDcraw::Private::~Private() -{ -} - -void KDcraw::Private::createPPMHeader(QByteArray& imgData, libraw_processed_image_t* const img) -{ - QString header = QString("P%1\n%2 %3\n%4\n").arg(img->colors == 3 ? "6" : "5") - .arg(img->width) - .arg(img->height) - .arg((1 << img->bits)-1); - imgData.append(header.toAscii()); - imgData.append(QByteArray((const char*)img->data, (int)img->data_size)); -} - -int KDcraw::Private::progressCallback(enum LibRaw_progress p, int iteration, int expected) -{ - kDebug() << "LibRaw progress: " << libraw_strprogress(p) << " pass " - << iteration << " of " << expected; - - // post a little change in progress indicator to show raw processor activity. - setProgress(progressValue()+0.01); - - // Clean processing termination by user... - if (m_parent->checkToCancelWaitingData()) - { - kDebug() << "LibRaw process terminaison invoked..."; - m_parent->m_cancel = true; - m_progress = 0.0; - return 1; - } - - // Return 0 to continue processing... - return 0; -} - -void KDcraw::Private::setProgress(double value) -{ - m_progress = value; - m_parent->setWaitingDataProgress(m_progress); -} - -double KDcraw::Private::progressValue() const -{ - return m_progress; -} - -void KDcraw::Private::fillIndentifyInfo(LibRaw* const raw, DcrawInfoContainer& identify) -{ - identify.dateTime.setTime_t(raw->imgdata.other.timestamp); - identify.make = QString(raw->imgdata.idata.make); - identify.model = QString(raw->imgdata.idata.model); - identify.owner = QString(raw->imgdata.other.artist); - identify.DNGVersion = QString::number(raw->imgdata.idata.dng_version); - identify.sensitivity = raw->imgdata.other.iso_speed; - identify.exposureTime = raw->imgdata.other.shutter; - identify.aperture = raw->imgdata.other.aperture; - identify.focalLength = raw->imgdata.other.focal_len; - identify.imageSize = QSize(raw->imgdata.sizes.width, raw->imgdata.sizes.height); - identify.fullSize = QSize(raw->imgdata.sizes.raw_width, raw->imgdata.sizes.raw_height); - identify.outputSize = QSize(raw->imgdata.sizes.iwidth, raw->imgdata.sizes.iheight); - identify.thumbSize = QSize(raw->imgdata.thumbnail.twidth, raw->imgdata.thumbnail.theight); - identify.topMargin = raw->imgdata.sizes.top_margin; - identify.leftMargin = raw->imgdata.sizes.left_margin; - identify.hasIccProfile = raw->imgdata.color.profile ? true : false; - identify.isDecodable = true; - identify.pixelAspectRatio = raw->imgdata.sizes.pixel_aspect; - identify.rawColors = raw->imgdata.idata.colors; - identify.rawImages = raw->imgdata.idata.raw_count; - identify.blackPoint = raw->imgdata.color.black; - - for (int ch = 0; ch < 4; ch++) - { - identify.blackPointCh[ch] = raw->imgdata.color.cblack[ch]; - } - - identify.whitePoint = raw->imgdata.color.maximum; - identify.orientation = (DcrawInfoContainer::ImageOrientation)raw->imgdata.sizes.flip; - - memcpy(&identify.cameraColorMatrix1, &raw->imgdata.color.cmatrix, sizeof(raw->imgdata.color.cmatrix)); - memcpy(&identify.cameraColorMatrix2, &raw->imgdata.color.rgb_cam, sizeof(raw->imgdata.color.rgb_cam)); - memcpy(&identify.cameraXYZMatrix, &raw->imgdata.color.cam_xyz, sizeof(raw->imgdata.color.cam_xyz)); - - if (raw->imgdata.idata.filters) - { - if (!raw->imgdata.idata.cdesc[3]) - { - raw->imgdata.idata.cdesc[3] = 'G'; - } - - for (int i=0; i < 16; i++) - { - identify.filterPattern.append(raw->imgdata.idata.cdesc[raw->COLOR(i >> 1,i & 1)]); - } - - identify.colorKeys = raw->imgdata.idata.cdesc; - } - - for(int c = 0 ; c < raw->imgdata.idata.colors ; c++) - { - identify.daylightMult[c] = raw->imgdata.color.pre_mul[c]; - } - - if (raw->imgdata.color.cam_mul[0] > 0) - { - for(int c = 0 ; c < 4 ; c++) - { - identify.cameraMult[c] = raw->imgdata.color.cam_mul[c]; - } - } -} - -bool KDcraw::Private::loadFromLibraw(const QString& filePath, QByteArray& imageData, - int& width, int& height, int& rgbmax) -{ - m_parent->m_cancel = false; - - LibRaw raw; - // Set progress call back function. - raw.set_progress_handler(callbackForLibRaw, this); - - QByteArray deadpixelPath = QFile::encodeName(m_parent->m_rawDecodingSettings.deadPixelMap); - QByteArray cameraProfile = QFile::encodeName(m_parent->m_rawDecodingSettings.inputProfile); - QByteArray outputProfile = QFile::encodeName(m_parent->m_rawDecodingSettings.outputProfile); - - if (!m_parent->m_rawDecodingSettings.autoBrightness) - { - // Use a fixed white level, ignoring the image histogram. - raw.imgdata.params.no_auto_bright = 1; - } - - if (m_parent->m_rawDecodingSettings.sixteenBitsImage) - { - // (-4) 16bit ppm output - raw.imgdata.params.output_bps = 16; - } - - if (m_parent->m_rawDecodingSettings.halfSizeColorImage) - { - // (-h) Half-size color image (3x faster than -q). - raw.imgdata.params.half_size = 1; - } - - if (m_parent->m_rawDecodingSettings.RGBInterpolate4Colors) - { - // (-f) Interpolate RGB as four colors. - raw.imgdata.params.four_color_rgb = 1; - } - - if (m_parent->m_rawDecodingSettings.DontStretchPixels) - { - // (-j) Do not stretch the image to its correct aspect ratio. - raw.imgdata.params.use_fuji_rotate = 1; - } - - // (-H) Unclip highlight color. - raw.imgdata.params.highlight = m_parent->m_rawDecodingSettings.unclipColors; - - if (m_parent->m_rawDecodingSettings.brightness != 1.0) - { - // (-b) Set Brightness value. - raw.imgdata.params.bright = m_parent->m_rawDecodingSettings.brightness; - } - - if (m_parent->m_rawDecodingSettings.enableBlackPoint) - { - // (-k) Set Black Point value. - raw.imgdata.params.user_black = m_parent->m_rawDecodingSettings.blackPoint; - } - - if (m_parent->m_rawDecodingSettings.enableWhitePoint) - { - // (-S) Set White Point value (saturation). - raw.imgdata.params.user_sat = m_parent->m_rawDecodingSettings.whitePoint; - } - - if (m_parent->m_rawDecodingSettings.medianFilterPasses > 0) - { - // (-m) After interpolation, clean up color artifacts by repeatedly applying a 3x3 median filter to the R-G and B-G channels. - raw.imgdata.params.med_passes = m_parent->m_rawDecodingSettings.medianFilterPasses; - } - - if (!m_parent->m_rawDecodingSettings.deadPixelMap.isEmpty()) - { - // (-P) Read the dead pixel list from this file. - raw.imgdata.params.bad_pixels = deadpixelPath.data(); - } - - switch (m_parent->m_rawDecodingSettings.whiteBalance) - { - case RawDecodingSettings::NONE: - { - break; - } - case RawDecodingSettings::CAMERA: - { - // (-w) Use camera white balance, if possible. - raw.imgdata.params.use_camera_wb = 1; - break; - } - case RawDecodingSettings::AUTO: - { - // (-a) Use automatic white balance. - raw.imgdata.params.use_auto_wb = 1; - break; - } - case RawDecodingSettings::CUSTOM: - { - /* Convert between Temperature and RGB. - */ - double T; - double RGB[3]; - double xD, yD, X, Y, Z; - DcrawInfoContainer identify; - T = m_parent->m_rawDecodingSettings.customWhiteBalance; - - /* Here starts the code picked and adapted from ufraw (0.12.1) - to convert Temperature + green multiplier to RGB multipliers - */ - /* Convert between Temperature and RGB. - * Base on information from http://www.brucelindbloom.com/ - * The fit for D-illuminant between 4000K and 12000K are from CIE - * The generalization to 2000K < T < 4000K and the blackbody fits - * are my own and should be taken with a grain of salt. - */ - const double XYZ_to_RGB[3][3] = { - { 3.24071, -0.969258, 0.0556352 }, - {-1.53726, 1.87599, -0.203996 }, - {-0.498571, 0.0415557, 1.05707 } - }; - - // Fit for CIE Daylight illuminant - if (T <= 4000) - { - xD = 0.27475e9/(T*T*T) - 0.98598e6/(T*T) + 1.17444e3/T + 0.145986; - } - else if (T <= 7000) - { - xD = -4.6070e9/(T*T*T) + 2.9678e6/(T*T) + 0.09911e3/T + 0.244063; - } - else - { - xD = -2.0064e9/(T*T*T) + 1.9018e6/(T*T) + 0.24748e3/T + 0.237040; - } - - yD = -3*xD*xD + 2.87*xD - 0.275; - X = xD/yD; - Y = 1; - Z = (1-xD-yD)/yD; - RGB[0] = X*XYZ_to_RGB[0][0] + Y*XYZ_to_RGB[1][0] + Z*XYZ_to_RGB[2][0]; - RGB[1] = X*XYZ_to_RGB[0][1] + Y*XYZ_to_RGB[1][1] + Z*XYZ_to_RGB[2][1]; - RGB[2] = X*XYZ_to_RGB[0][2] + Y*XYZ_to_RGB[1][2] + Z*XYZ_to_RGB[2][2]; - /* End of the code picked to ufraw - */ - - RGB[1] = RGB[1] / m_parent->m_rawDecodingSettings.customWhiteBalanceGreen; - - /* By default, decraw override his default D65 WB - We need to keep it as a basis : if not, colors with some - DSLR will have a high dominant of color that will lead to - a completely wrong WB - */ - if (rawFileIdentify(identify, filePath)) - { - RGB[0] = identify.daylightMult[0] / RGB[0]; - RGB[1] = identify.daylightMult[1] / RGB[1]; - RGB[2] = identify.daylightMult[2] / RGB[2]; - } - else - { - RGB[0] = 1.0 / RGB[0]; - RGB[1] = 1.0 / RGB[1]; - RGB[2] = 1.0 / RGB[2]; - kDebug() << "Warning: cannot get daylight multipliers"; - } - - // (-r) set Raw Color Balance Multipliers. - raw.imgdata.params.user_mul[0] = RGB[0]; - raw.imgdata.params.user_mul[1] = RGB[1]; - raw.imgdata.params.user_mul[2] = RGB[2]; - raw.imgdata.params.user_mul[3] = RGB[1]; - break; - } - case RawDecodingSettings::AERA: - { - // (-A) Calculate the white balance by averaging a rectangular area from image. - raw.imgdata.params.greybox[0] = m_parent->m_rawDecodingSettings.whiteBalanceArea.left(); - raw.imgdata.params.greybox[1] = m_parent->m_rawDecodingSettings.whiteBalanceArea.top(); - raw.imgdata.params.greybox[2] = m_parent->m_rawDecodingSettings.whiteBalanceArea.width(); - raw.imgdata.params.greybox[3] = m_parent->m_rawDecodingSettings.whiteBalanceArea.height(); - break; - } - } - - // (-q) Use an interpolation method. - raw.imgdata.params.user_qual = m_parent->m_rawDecodingSettings.RAWQuality; - - switch (m_parent->m_rawDecodingSettings.NRType) - { - case RawDecodingSettings::WAVELETSNR: - { - // (-n) Use wavelets to erase noise while preserving real detail. - raw.imgdata.params.threshold = m_parent->m_rawDecodingSettings.NRThreshold; - break; - } - case RawDecodingSettings::FBDDNR: - { - // (100 - 1000) => (1 - 10) conversion - raw.imgdata.params.fbdd_noiserd = lround(m_parent->m_rawDecodingSettings.NRThreshold / 100.0); - break; - } -#if !LIBRAW_COMPILE_CHECK_VERSION_NOTLESS(0, 19) - case RawDecodingSettings::LINENR: - { - // (100 - 1000) => (0.001 - 0.02) conversion. - raw.imgdata.params.linenoise = m_parent->m_rawDecodingSettings.NRThreshold * 2.11E-5 + 0.00111111; - raw.imgdata.params.cfaline = true; - break; - } - case RawDecodingSettings::IMPULSENR: - { - // (100 - 1000) => (0.005 - 0.05) conversion. - raw.imgdata.params.lclean = m_parent->m_rawDecodingSettings.NRThreshold * 5E-5; - raw.imgdata.params.cclean = m_parent->m_rawDecodingSettings.NRChroThreshold * 5E-5; - raw.imgdata.params.cfa_clean = true; - break; - } -#endif - default: // No Noise Reduction - { - raw.imgdata.params.threshold = 0; - raw.imgdata.params.fbdd_noiserd = 0; -#if !LIBRAW_COMPILE_CHECK_VERSION_NOTLESS(0, 19) - raw.imgdata.params.linenoise = 0; - raw.imgdata.params.cfaline = false; - raw.imgdata.params.lclean = 0; - raw.imgdata.params.cclean = 0; - raw.imgdata.params.cfa_clean = false; -#endif - break; - } - } - -#if !LIBRAW_COMPILE_CHECK_VERSION_NOTLESS(0, 19) - // Chromatic aberration correction. - raw.imgdata.params.ca_correc = m_parent->m_rawDecodingSettings.enableCACorrection; - raw.imgdata.params.cared = m_parent->m_rawDecodingSettings.caMultiplier[0]; - raw.imgdata.params.cablue = m_parent->m_rawDecodingSettings.caMultiplier[1]; -#endif - - // Exposure Correction before interpolation. - raw.imgdata.params.exp_correc = m_parent->m_rawDecodingSettings.expoCorrection; - raw.imgdata.params.exp_shift = m_parent->m_rawDecodingSettings.expoCorrectionShift; - raw.imgdata.params.exp_preser = m_parent->m_rawDecodingSettings.expoCorrectionHighlight; - - switch (m_parent->m_rawDecodingSettings.inputColorSpace) - { - case RawDecodingSettings::EMBEDDED: - { - // (-p embed) Use input profile from RAW file to define the camera's raw colorspace. - raw.imgdata.params.camera_profile = (char*)"embed"; - break; - } - case RawDecodingSettings::CUSTOMINPUTCS: - { - if (!m_parent->m_rawDecodingSettings.inputProfile.isEmpty()) - { - // (-p) Use input profile file to define the camera's raw colorspace. - raw.imgdata.params.camera_profile = cameraProfile.data(); - } - break; - } - default: - { - // No input profile - break; - } - } - - switch (m_parent->m_rawDecodingSettings.outputColorSpace) - { - case RawDecodingSettings::CUSTOMOUTPUTCS: - { - if (!m_parent->m_rawDecodingSettings.outputProfile.isEmpty()) - { - // (-o) Use ICC profile file to define the output colorspace. - raw.imgdata.params.output_profile = outputProfile.data(); - } - break; - } - default: - { - // (-o) Define the output colorspace. - raw.imgdata.params.output_color = m_parent->m_rawDecodingSettings.outputColorSpace; - break; - } - } - - //-- Extended demosaicing settings ---------------------------------------------------------- - raw.imgdata.params.dcb_iterations = m_parent->m_rawDecodingSettings.dcbIterations; - raw.imgdata.params.dcb_enhance_fl = m_parent->m_rawDecodingSettings.dcbEnhanceFl; -#if !LIBRAW_COMPILE_CHECK_VERSION_NOTLESS(0, 19) - raw.imgdata.params.eeci_refine = m_parent->m_rawDecodingSettings.eeciRefine; - raw.imgdata.params.es_med_passes = m_parent->m_rawDecodingSettings.esMedPasses; -#endif - - //------------------------------------------------------------------------------------------- - - setProgress(0.1); - - kDebug() << filePath; - kDebug() << m_parent->m_rawDecodingSettings; - - int ret = raw.open_file(QFile::encodeName(filePath)); - - if (ret != LIBRAW_SUCCESS) - { - kDebug() << "LibRaw: failed to run open_file: " << libraw_strerror(ret); - raw.recycle(); - return false; - } - - if (m_parent->m_cancel) - { - raw.recycle(); - return false; - } - - setProgress(0.2); - - ret = raw.unpack(); - - if (ret != LIBRAW_SUCCESS) - { - kDebug() << "LibRaw: failed to run unpack: " << libraw_strerror(ret); - raw.recycle(); - return false; - } - - if (m_parent->m_cancel) - { - raw.recycle(); - return false; - } - - setProgress(0.25); - - if (m_parent->m_rawDecodingSettings.fixColorsHighlights) - { - kDebug() << "Applying LibRaw highlights adjustments"; - // 1.0 is fallback to default value - raw.imgdata.params.adjust_maximum_thr = 1.0; - } - else - { - kDebug() << "Disabling LibRaw highlights adjustments"; - // 0.0 disables this feature - raw.imgdata.params.adjust_maximum_thr = 0.0; - } - - ret = raw.dcraw_process(); - - if (ret != LIBRAW_SUCCESS) - { - kDebug() << "LibRaw: failed to run dcraw_process: " << libraw_strerror(ret); - raw.recycle(); - return false; - } - - if (m_parent->m_cancel) - { - raw.recycle(); - return false; - } - - setProgress(0.3); - - libraw_processed_image_t* img = raw.dcraw_make_mem_image(&ret); - - if(!img) - { - kDebug() << "LibRaw: failed to run dcraw_make_mem_image: " << libraw_strerror(ret); - raw.recycle(); - return false; - } - - if (m_parent->m_cancel) - { - // Clear memory allocation. Introduced with LibRaw 0.11.0 - raw.dcraw_clear_mem(img); - raw.recycle(); - return false; - } - - setProgress(0.35); - - width = img->width; - height = img->height; - rgbmax = (1 << img->bits)-1; - - if (img->colors == 3) - { - imageData = QByteArray((const char*)img->data, (int)img->data_size); - } - else - { - // img->colors == 1 (Grayscale) : convert to RGB - imageData = QByteArray(); - - for (int i = 0 ; i < (int)img->data_size ; ++i) - { - for (int j = 0 ; j < 3 ; ++j) - { - imageData.append(img->data[i]); - } - } - } - - // Clear memory allocation. Introduced with LibRaw 0.11.0 - raw.dcraw_clear_mem(img); - raw.recycle(); - - if (m_parent->m_cancel) - { - return false; - } - - setProgress(0.4); - - kDebug() << "LibRaw: data info: width=" << width - << " height=" << height - << " rgbmax=" << rgbmax; - - return true; -} - -bool KDcraw::Private::loadEmbeddedPreview(QByteArray& imgData, LibRaw& raw) -{ - int ret = raw.unpack_thumb(); - - if (ret != LIBRAW_SUCCESS) - { - raw.recycle(); - kDebug() << "LibRaw: failed to run unpack_thumb: " << libraw_strerror(ret); - raw.recycle(); - return false; - } - - libraw_processed_image_t* const thumb = raw.dcraw_make_mem_thumb(&ret); - - if(!thumb) - { - kDebug() << "LibRaw: failed to run dcraw_make_mem_thumb: " << libraw_strerror(ret); - raw.recycle(); - return false; - } - - if(thumb->type == LIBRAW_IMAGE_BITMAP) - { - createPPMHeader(imgData, thumb); - } - else - { - imgData = QByteArray((const char*)thumb->data, (int)thumb->data_size); - } - - // Clear memory allocation. Introduced with LibRaw 0.11.0 - raw.dcraw_clear_mem(thumb); - raw.recycle(); - - if ( imgData.isEmpty() ) - { - kDebug() << "Failed to load JPEG thumb from LibRaw!"; - return false; - } - - return true; -} - -bool KDcraw::Private::loadHalfPreview(QImage& image, LibRaw& raw) -{ - raw.imgdata.params.use_auto_wb = 1; // Use automatic white balance. - raw.imgdata.params.use_camera_wb = 1; // Use camera white balance, if possible. - raw.imgdata.params.half_size = 1; // Half-size color image (3x faster than -q). - QByteArray imgData; - - int ret = raw.unpack(); - - if (ret != LIBRAW_SUCCESS) - { - kDebug() << "LibRaw: failed to run unpack: " << libraw_strerror(ret); - raw.recycle(); - return false; - } - - ret = raw.dcraw_process(); - - if (ret != LIBRAW_SUCCESS) - { - kDebug() << "LibRaw: failed to run dcraw_process: " << libraw_strerror(ret); - raw.recycle(); - return false; - } - - libraw_processed_image_t* halfImg = raw.dcraw_make_mem_image(&ret); - - if(!halfImg) - { - kDebug() << "LibRaw: failed to run dcraw_make_mem_image: " << libraw_strerror(ret); - raw.recycle(); - return false; - } - - Private::createPPMHeader(imgData, halfImg); - // Clear memory allocation. Introduced with LibRaw 0.11.0 - raw.dcraw_clear_mem(halfImg); - raw.recycle(); - - if ( imgData.isEmpty() ) - { - kDebug() << "Failed to load half preview from LibRaw!"; - return false; - } - - if (!image.loadFromData(imgData)) - { - kDebug() << "Failed to load PPM data from LibRaw!"; - return false; - } - - return true; -} - -} // namespace KDcrawIface diff --git a/kdcraw/libkdcraw/kdcraw_p.h b/kdcraw/libkdcraw/kdcraw_p.h deleted file mode 100644 index c309f90d..00000000 --- a/kdcraw/libkdcraw/kdcraw_p.h +++ /dev/null @@ -1,94 +0,0 @@ -/** =========================================================== - * @file - * - * This file is a part of digiKam project - * http://www.digikam.org - * - * @date 2008-10-09 - * @brief internal private container for KDcraw - * - * @author Copyright (C) 2008-2013 by Gilles Caulier - * caulier dot gilles at gmail dot com - * - * This program 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 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * ============================================================ */ - -#ifndef KDCRAWPRIVATE_H -#define KDCRAWPRIVATE_H - -// Qt includes - -#include - -// KDE includes - -#include - -// LibRaw includes - -#include - -// Local includes - -#include "dcrawinfocontainer.h" - -namespace KDcrawIface -{ - -class KDcraw; - -extern "C" -{ - int callbackForLibRaw(void* data, enum LibRaw_progress p, int iteration, int expected); -} - -class KDcraw::Private -{ - -public: - - Private(KDcraw* const p); - ~Private(); - -public: - - int progressCallback(enum LibRaw_progress p, int iteration, int expected); - - void setProgress(double value); - double progressValue() const; - - bool loadFromLibraw(const QString& filePath, QByteArray& imageData, - int& width, int& height, int& rgbmax); - -public: - - static void createPPMHeader(QByteArray& imgData, libraw_processed_image_t* const img); - - static void fillIndentifyInfo(LibRaw* const raw, DcrawInfoContainer& identify); - - static bool loadEmbeddedPreview(QByteArray&, LibRaw&); - - static bool loadHalfPreview(QImage&, LibRaw&); - -private: - - double m_progress; - - KDcraw* m_parent; - - friend class KDcraw; -}; - -} // namespace KDcrawIface - -#endif /* KDCRAWPRIVATE_H */ diff --git a/kdcraw/libkdcraw/rawdecodingsettings.cpp b/kdcraw/libkdcraw/rawdecodingsettings.cpp deleted file mode 100644 index cd8aff69..00000000 --- a/kdcraw/libkdcraw/rawdecodingsettings.cpp +++ /dev/null @@ -1,396 +0,0 @@ -/** =========================================================== - * @file - * - * This file is a part of digiKam project - * http://www.digikam.org - * - * @date 2006-12-09 - * @brief Raw decoding settings - * - * @author Copyright (C) 2006-2013 by Gilles Caulier - * caulier dot gilles at gmail dot com - * @author Copyright (C) 2006-2013 by Marcel Wiesweg - * marcel dot wiesweg at gmx dot de - * @author Copyright (C) 2007-2008 by Guillaume Castagnino - * casta at xwing dot info - * - * This program 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 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * ============================================================ */ - -#define OPTIONFIXCOLORSHIGHLIGHTSENTRY "FixColorsHighlights" -#define OPTIONDECODESIXTEENBITENTRY "SixteenBitsImage" -#define OPTIONWHITEBALANCEENTRY "White Balance" -#define OPTIONCUSTOMWHITEBALANCEENTRY "Custom White Balance" -#define OPTIONCUSTOMWBGREENENTRY "Custom White Balance Green" -#define OPTIONFOURCOLORRGBENTRY "Four Color RGB" -#define OPTIONUNCLIPCOLORSENTRY "Unclip Color" -// Wrong spelling, but do not fix it since it is a configuration key -// krazy:cond=spelling -#define OPTIONDONTSTRETCHPIXELSENTRY "Dont Stretch Pixels" -// krazy:endcond=spelling -#define OPTIONMEDIANFILTERPASSESENTRY "Median Filter Passes" -#define OPTIONNOISEREDUCTIONTYPEENTRY "Noise Reduction Type" -#define OPTIONNOISEREDUCTIONTHRESHOLDENTRY "Noise Reduction Threshold" -#define OPTIONUSECACORRECTIONENTRY "EnableCACorrection" -#define OPTIONCAREDMULTIPLIERENTRY "caRedMultiplier" -#define OPTIONCABLUEMULTIPLIERENTRY "caBlueMultiplier" -#define OPTIONAUTOBRIGHTNESSENTRY "AutoBrightness" -#define OPTIONDECODINGQUALITYENTRY "Decoding Quality" -#define OPTIONINPUTCOLORSPACEENTRY "Input Color Space" -#define OPTIONOUTPUTCOLORSPACEENTRY "Output Color Space" -#define OPTIONINPUTCOLORPROFILEENTRY "Input Color Profile" -#define OPTIONOUTPUTCOLORPROFILEENTRY "Output Color Profile" -#define OPTIONBRIGHTNESSMULTIPLIERENTRY "Brightness Multiplier" -#define OPTIONUSEBLACKPOINTENTRY "Use Black Point" -#define OPTIONBLACKPOINTENTRY "Black Point" -#define OPTIONUSEWHITEPOINTENTRY "Use White Point" -#define OPTIONWHITEPOINTENTRY "White Point" - -//-- Extended demosaicing settings ---------------------------------------------------------- - -#define OPTIONDCBITERATIONSENTRY "Dcb Iterations" -#define OPTIONDCBENHANCEFLENTRY "Dcb Enhance Filter" -#define OPTIONEECIREFINEENTRY "Eeci Refine" -#define OPTIONESMEDPASSESENTRY "Es Median Filter Passes" -#define OPTIONNRCHROMINANCETHRESHOLDENTRY "Noise Reduction Chrominance Threshold" -#define OPTIONEXPOCORRECTIONENTRY "Expo Correction" -#define OPTIONEXPOCORRECTIONSHIFTENTRY "Expo Correction Shift" -#define OPTIONEXPOCORRECTIONHIGHLIGHTENTRY "Expo Correction Highlight" - -#include "rawdecodingsettings.h" - -namespace KDcrawIface -{ - -RawDecodingSettings::RawDecodingSettings() -{ - fixColorsHighlights = false; - autoBrightness = true; - sixteenBitsImage = false; - brightness = 1.0; - RAWQuality = BILINEAR; - inputColorSpace = NOINPUTCS; - outputColorSpace = SRGB; - RGBInterpolate4Colors = false; - DontStretchPixels = false; - unclipColors = 0; - whiteBalance = CAMERA; - customWhiteBalance = 6500; - customWhiteBalanceGreen = 1.0; - medianFilterPasses = 0; - - halfSizeColorImage = false; - - enableBlackPoint = false; - blackPoint = 0; - - enableWhitePoint = false; - whitePoint = 0; - - NRType = NONR; - NRThreshold = 0; - - enableCACorrection = false; - caMultiplier[0] = 0.0; - caMultiplier[1] = 0.0; - - inputProfile = QString(); - outputProfile = QString(); - - deadPixelMap = QString(); - - whiteBalanceArea = QRect(); - - //-- Extended demosaicing settings ---------------------------------------------------------- - - dcbIterations = -1; - dcbEnhanceFl = false; - eeciRefine = false; - esMedPasses = 0; - NRChroThreshold = 0; - expoCorrection = false; - expoCorrectionShift = 1.0; - expoCorrectionHighlight = 0.0; -} - -RawDecodingSettings::~RawDecodingSettings() -{ -} - -RawDecodingSettings& RawDecodingSettings::operator=(const RawDecodingSettings& o) -{ - fixColorsHighlights = o.fixColorsHighlights; - autoBrightness = o.autoBrightness; - sixteenBitsImage = o.sixteenBitsImage; - brightness = o.brightness; - RAWQuality = o.RAWQuality; - inputColorSpace = o.inputColorSpace; - outputColorSpace = o.outputColorSpace; - RGBInterpolate4Colors = o.RGBInterpolate4Colors; - DontStretchPixels = o.DontStretchPixels; - unclipColors = o.unclipColors; - whiteBalance = o.whiteBalance; - customWhiteBalance = o.customWhiteBalance; - customWhiteBalanceGreen = o.customWhiteBalanceGreen; - halfSizeColorImage = o.halfSizeColorImage; - enableBlackPoint = o.enableBlackPoint; - blackPoint = o.blackPoint; - enableWhitePoint = o.enableWhitePoint; - whitePoint = o.whitePoint; - NRType = o.NRType; - NRThreshold = o.NRThreshold; - enableCACorrection = o.enableCACorrection; - caMultiplier[0] = o.caMultiplier[0]; - caMultiplier[1] = o.caMultiplier[1]; - medianFilterPasses = o.medianFilterPasses; - inputProfile = o.inputProfile; - outputProfile = o.outputProfile; - deadPixelMap = o.deadPixelMap; - whiteBalanceArea = o.whiteBalanceArea; - - //-- Extended demosaicing settings ---------------------------------------------------------- - - dcbIterations = o.dcbIterations; - dcbEnhanceFl = o.dcbEnhanceFl; - eeciRefine = o.eeciRefine; - esMedPasses = o.esMedPasses; - NRChroThreshold = o.NRChroThreshold; - expoCorrection = o.expoCorrection; - expoCorrectionShift = o.expoCorrectionShift; - expoCorrectionHighlight = o.expoCorrectionHighlight; - - return *this; -} - -bool RawDecodingSettings::operator==(const RawDecodingSettings& o) const -{ - return fixColorsHighlights == o.fixColorsHighlights - && autoBrightness == o.autoBrightness - && sixteenBitsImage == o.sixteenBitsImage - && brightness == o.brightness - && RAWQuality == o.RAWQuality - && inputColorSpace == o.inputColorSpace - && outputColorSpace == o.outputColorSpace - && RGBInterpolate4Colors == o.RGBInterpolate4Colors - && DontStretchPixels == o.DontStretchPixels - && unclipColors == o.unclipColors - && whiteBalance == o.whiteBalance - && customWhiteBalance == o.customWhiteBalance - && customWhiteBalanceGreen == o.customWhiteBalanceGreen - && halfSizeColorImage == o.halfSizeColorImage - && enableBlackPoint == o.enableBlackPoint - && blackPoint == o.blackPoint - && enableWhitePoint == o.enableWhitePoint - && whitePoint == o.whitePoint - && NRType == o.NRType - && NRThreshold == o.NRThreshold - && enableCACorrection == o.enableCACorrection - && caMultiplier[0] == o.caMultiplier[0] - && caMultiplier[1] == o.caMultiplier[1] - && medianFilterPasses == o.medianFilterPasses - && inputProfile == o.inputProfile - && outputProfile == o.outputProfile - && deadPixelMap == o.deadPixelMap - && whiteBalanceArea == o.whiteBalanceArea - - //-- Extended demosaicing settings ---------------------------------------------------------- - - && dcbIterations == o.dcbIterations - && dcbEnhanceFl == o.dcbEnhanceFl - && eeciRefine == o.eeciRefine - && esMedPasses == o.esMedPasses - && NRChroThreshold == o.NRChroThreshold - && expoCorrection == o.expoCorrection - && expoCorrectionShift == o.expoCorrectionShift - && expoCorrectionHighlight == o.expoCorrectionHighlight - ; -} - -void RawDecodingSettings::optimizeTimeLoading() -{ - fixColorsHighlights = false; - autoBrightness = true; - sixteenBitsImage = true; - brightness = 1.0; - RAWQuality = BILINEAR; - inputColorSpace = NOINPUTCS; - outputColorSpace = SRGB; - RGBInterpolate4Colors = false; - DontStretchPixels = false; - unclipColors = 0; - whiteBalance = CAMERA; - customWhiteBalance = 6500; - customWhiteBalanceGreen = 1.0; - halfSizeColorImage = true; - medianFilterPasses = 0; - - enableBlackPoint = false; - blackPoint = 0; - - enableWhitePoint = false; - whitePoint = 0; - - NRType = NONR; - NRThreshold = 0; - - enableCACorrection = false; - caMultiplier[0] = 0.0; - caMultiplier[1] = 0.0; - - inputProfile = QString(); - outputProfile = QString(); - - deadPixelMap = QString(); - - whiteBalanceArea = QRect(); - - //-- Extended demosaicing settings ---------------------------------------------------------- - - dcbIterations = -1; - dcbEnhanceFl = false; - eeciRefine = false; - esMedPasses = 0; - NRChroThreshold = 0; - expoCorrection = false; - expoCorrectionShift = 1.0; - expoCorrectionHighlight = 0.0; -} - -void RawDecodingSettings::readSettings(KConfigGroup& group) -{ - RawDecodingSettings defaultPrm; - - fixColorsHighlights = group.readEntry(OPTIONFIXCOLORSHIGHLIGHTSENTRY, defaultPrm.fixColorsHighlights); - sixteenBitsImage = group.readEntry(OPTIONDECODESIXTEENBITENTRY, defaultPrm.sixteenBitsImage); - whiteBalance = (WhiteBalance) - group.readEntry(OPTIONWHITEBALANCEENTRY, (int)defaultPrm.whiteBalance); - customWhiteBalance = group.readEntry(OPTIONCUSTOMWHITEBALANCEENTRY, defaultPrm.customWhiteBalance); - customWhiteBalanceGreen = group.readEntry(OPTIONCUSTOMWBGREENENTRY, defaultPrm.customWhiteBalanceGreen); - RGBInterpolate4Colors = group.readEntry(OPTIONFOURCOLORRGBENTRY, defaultPrm.RGBInterpolate4Colors); - unclipColors = group.readEntry(OPTIONUNCLIPCOLORSENTRY, defaultPrm.unclipColors); - DontStretchPixels = group.readEntry(OPTIONDONTSTRETCHPIXELSENTRY, defaultPrm.DontStretchPixels); - NRType = (NoiseReduction) - group.readEntry(OPTIONNOISEREDUCTIONTYPEENTRY, (int)defaultPrm.NRType); - brightness = group.readEntry(OPTIONBRIGHTNESSMULTIPLIERENTRY, defaultPrm.brightness); - enableBlackPoint = group.readEntry(OPTIONUSEBLACKPOINTENTRY, defaultPrm.enableBlackPoint); - blackPoint = group.readEntry(OPTIONBLACKPOINTENTRY, defaultPrm.blackPoint); - enableWhitePoint = group.readEntry(OPTIONUSEWHITEPOINTENTRY, defaultPrm.enableWhitePoint); - whitePoint = group.readEntry(OPTIONWHITEPOINTENTRY, defaultPrm.whitePoint); - medianFilterPasses = group.readEntry(OPTIONMEDIANFILTERPASSESENTRY, defaultPrm.medianFilterPasses); - NRThreshold = group.readEntry(OPTIONNOISEREDUCTIONTHRESHOLDENTRY, defaultPrm.NRThreshold); - enableCACorrection = group.readEntry(OPTIONUSECACORRECTIONENTRY, defaultPrm.enableCACorrection); - caMultiplier[0] = group.readEntry(OPTIONCAREDMULTIPLIERENTRY, defaultPrm.caMultiplier[0]); - caMultiplier[1] = group.readEntry(OPTIONCABLUEMULTIPLIERENTRY, defaultPrm.caMultiplier[1]); - RAWQuality = (DecodingQuality) - group.readEntry(OPTIONDECODINGQUALITYENTRY, (int)defaultPrm.RAWQuality); - outputColorSpace = (OutputColorSpace) - group.readEntry(OPTIONOUTPUTCOLORSPACEENTRY, (int)defaultPrm.outputColorSpace); - autoBrightness = group.readEntry(OPTIONAUTOBRIGHTNESSENTRY, defaultPrm.autoBrightness); - - //-- Extended demosaicing settings ---------------------------------------------------------- - - dcbIterations = group.readEntry(OPTIONDCBITERATIONSENTRY, defaultPrm.dcbIterations); - dcbEnhanceFl = group.readEntry(OPTIONDCBENHANCEFLENTRY, defaultPrm.dcbEnhanceFl); - eeciRefine = group.readEntry(OPTIONEECIREFINEENTRY, defaultPrm.eeciRefine); - esMedPasses = group.readEntry(OPTIONESMEDPASSESENTRY, defaultPrm.esMedPasses); - NRChroThreshold = group.readEntry(OPTIONNRCHROMINANCETHRESHOLDENTRY, defaultPrm.NRChroThreshold); - expoCorrection = group.readEntry(OPTIONEXPOCORRECTIONENTRY, defaultPrm.expoCorrection); - expoCorrectionShift = group.readEntry(OPTIONEXPOCORRECTIONSHIFTENTRY, defaultPrm.expoCorrectionShift); - expoCorrectionHighlight = group.readEntry(OPTIONEXPOCORRECTIONHIGHLIGHTENTRY, defaultPrm.expoCorrectionHighlight); -} - -void RawDecodingSettings::writeSettings(KConfigGroup& group) -{ - group.writeEntry(OPTIONFIXCOLORSHIGHLIGHTSENTRY, fixColorsHighlights); - group.writeEntry(OPTIONDECODESIXTEENBITENTRY, sixteenBitsImage); - group.writeEntry(OPTIONWHITEBALANCEENTRY, (int)whiteBalance); - group.writeEntry(OPTIONCUSTOMWHITEBALANCEENTRY, customWhiteBalance); - group.writeEntry(OPTIONCUSTOMWBGREENENTRY, customWhiteBalanceGreen); - group.writeEntry(OPTIONFOURCOLORRGBENTRY, RGBInterpolate4Colors); - group.writeEntry(OPTIONUNCLIPCOLORSENTRY, unclipColors); - group.writeEntry(OPTIONDONTSTRETCHPIXELSENTRY, DontStretchPixels); - group.writeEntry(OPTIONNOISEREDUCTIONTYPEENTRY, (int)NRType); - group.writeEntry(OPTIONBRIGHTNESSMULTIPLIERENTRY, brightness); - group.writeEntry(OPTIONUSEBLACKPOINTENTRY, enableBlackPoint); - group.writeEntry(OPTIONBLACKPOINTENTRY, blackPoint); - group.writeEntry(OPTIONUSEWHITEPOINTENTRY, enableWhitePoint); - group.writeEntry(OPTIONWHITEPOINTENTRY, whitePoint); - group.writeEntry(OPTIONMEDIANFILTERPASSESENTRY, medianFilterPasses); - group.writeEntry(OPTIONNOISEREDUCTIONTHRESHOLDENTRY, NRThreshold); - group.writeEntry(OPTIONUSECACORRECTIONENTRY, enableCACorrection); - group.writeEntry(OPTIONCAREDMULTIPLIERENTRY, caMultiplier[0]); - group.writeEntry(OPTIONCABLUEMULTIPLIERENTRY, caMultiplier[1]); - group.writeEntry(OPTIONDECODINGQUALITYENTRY, (int)RAWQuality); - group.writeEntry(OPTIONOUTPUTCOLORSPACEENTRY, (int)outputColorSpace); - group.writeEntry(OPTIONAUTOBRIGHTNESSENTRY, autoBrightness); - - //-- Extended demosaicing settings ---------------------------------------------------------- - - group.writeEntry(OPTIONDCBITERATIONSENTRY, dcbIterations); - group.writeEntry(OPTIONDCBENHANCEFLENTRY, dcbEnhanceFl); - group.writeEntry(OPTIONEECIREFINEENTRY, eeciRefine); - group.writeEntry(OPTIONESMEDPASSESENTRY, esMedPasses); - group.writeEntry(OPTIONNRCHROMINANCETHRESHOLDENTRY, NRChroThreshold); - group.writeEntry(OPTIONEXPOCORRECTIONENTRY, expoCorrection); - group.writeEntry(OPTIONEXPOCORRECTIONSHIFTENTRY, expoCorrectionShift); - group.writeEntry(OPTIONEXPOCORRECTIONHIGHLIGHTENTRY, expoCorrectionHighlight); -} - -QDebug operator<<(QDebug dbg, const RawDecodingSettings& s) -{ - dbg.nospace() << endl; - dbg.nospace() << "-- RAW DECODING SETTINGS --------------------------------" << endl; - dbg.nospace() << "-- autoBrightness: " << s.autoBrightness << endl; - dbg.nospace() << "-- sixteenBitsImage: " << s.sixteenBitsImage << endl; - dbg.nospace() << "-- brightness: " << s.brightness << endl; - dbg.nospace() << "-- RAWQuality: " << s.RAWQuality << endl; - dbg.nospace() << "-- inputColorSpace: " << s.inputColorSpace << endl; - dbg.nospace() << "-- outputColorSpace: " << s.outputColorSpace << endl; - dbg.nospace() << "-- RGBInterpolate4Colors: " << s.RGBInterpolate4Colors << endl; - dbg.nospace() << "-- DontStretchPixels: " << s.DontStretchPixels << endl; - dbg.nospace() << "-- unclipColors: " << s.unclipColors << endl; - dbg.nospace() << "-- whiteBalance: " << s.whiteBalance << endl; - dbg.nospace() << "-- customWhiteBalance: " << s.customWhiteBalance << endl; - dbg.nospace() << "-- customWhiteBalanceGreen: " << s.customWhiteBalanceGreen << endl; - dbg.nospace() << "-- halfSizeColorImage: " << s.halfSizeColorImage << endl; - dbg.nospace() << "-- enableBlackPoint: " << s.enableBlackPoint << endl; - dbg.nospace() << "-- blackPoint: " << s.blackPoint << endl; - dbg.nospace() << "-- enableWhitePoint: " << s.enableWhitePoint << endl; - dbg.nospace() << "-- whitePoint: " << s.whitePoint << endl; - dbg.nospace() << "-- NoiseReductionType: " << s.NRType << endl; - dbg.nospace() << "-- NoiseReductionThreshold: " << s.NRThreshold << endl; - dbg.nospace() << "-- enableCACorrection: " << s.enableCACorrection << endl; - dbg.nospace() << "-- caMultiplier: " << s.caMultiplier[0] - << ", " << s.caMultiplier[1] << endl; - dbg.nospace() << "-- medianFilterPasses: " << s.medianFilterPasses << endl; - dbg.nospace() << "-- inputProfile: " << s.inputProfile << endl; - dbg.nospace() << "-- outputProfile: " << s.outputProfile << endl; - dbg.nospace() << "-- deadPixelMap: " << s.deadPixelMap << endl; - dbg.nospace() << "-- whiteBalanceArea: " << s.whiteBalanceArea << endl; - - //-- Extended demosaicing settings ---------------------------------------------------------- - - dbg.nospace() << "-- dcbIterations: " << s.dcbIterations << endl; - dbg.nospace() << "-- dcbEnhanceFl: " << s.dcbEnhanceFl << endl; - dbg.nospace() << "-- eeciRefine: " << s.eeciRefine << endl; - dbg.nospace() << "-- esMedPasses: " << s.esMedPasses << endl; - dbg.nospace() << "-- NRChrominanceThreshold: " << s.NRChroThreshold << endl; - dbg.nospace() << "-- expoCorrection: " << s.expoCorrection << endl; - dbg.nospace() << "-- expoCorrectionShift: " << s.expoCorrectionShift << endl; - dbg.nospace() << "-- expoCorrectionHighlight: " << s.expoCorrectionHighlight << endl; - dbg.nospace() << "---------------------------------------------------------" << endl; - - return dbg.space(); -} - -} // namespace KDcrawIface diff --git a/kdcraw/libkdcraw/rawdecodingsettings.h b/kdcraw/libkdcraw/rawdecodingsettings.h deleted file mode 100644 index 813add5c..00000000 --- a/kdcraw/libkdcraw/rawdecodingsettings.h +++ /dev/null @@ -1,375 +0,0 @@ -/** =========================================================== - * @file - * - * This file is a part of digiKam project - * http://www.digikam.org - * - * @date 2006-12-09 - * @brief Raw decoding settings - * - * @author Copyright (C) 2006-2013 by Gilles Caulier - * caulier dot gilles at gmail dot com - * @author Copyright (C) 2006-2013 by Marcel Wiesweg - * marcel dot wiesweg at gmx dot de - * @author Copyright (C) 2007-2008 by Guillaume Castagnino - * casta at xwing dot info - * - * This program 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 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * ============================================================ */ - -#ifndef RAW_DECODING_SETTINGS_H -#define RAW_DECODING_SETTINGS_H - -// Qt includes - -#include -#include -#include - -// KDE includes - -#include - -// Local includes - -#include "kdcraw_export.h" - -namespace KDcrawIface -{ - -class KDCRAW_EXPORT RawDecodingSettings -{ - -public: - - /** RAW decoding Interpolation methods - * - * NOTE: from original dcraw demosaic - * - * Bilinear: use high-speed but low-quality bilinear - * interpolation (default - for slow computer). In this method, - * the red value of a non-red pixel is computed as the average of - * the adjacent red pixels, and similar for blue and green. - * VNG: use Variable Number of Gradients interpolation. - * This method computes gradients near the pixel of interest and uses - * the lower gradients (representing smoother and more similar parts - * of the image) to make an estimate. - * PPG: use Patterned Pixel Grouping interpolation. - * Pixel Grouping uses assumptions about natural scenery in making estimates. - * It has fewer color artifacts on natural images than the Variable Number of - * Gradients method. - * AHD: use Adaptive Homogeneity-Directed interpolation. - * This method selects the direction of interpolation so as to - * maximize a homogeneity metric, thus typically minimizing color artifacts. - * - * NOTE: from GPL2 demosaic pack. - * - * DCB: DCB interpolation (see http://www.linuxphoto.org/html/dcb.html for details) - * PL_AHD: modified AHD interpolation (see http://sites.google.com/site/demosaicalgorithms/modified-dcraw - * for details). - * AFD: demosaicing through 5 pass median filter from PerfectRaw project. - * VCD: VCD interpolation. - * VCD_AHD: mixed demosaicing between VCD and AHD. - * LMMSE: LMMSE interpolation from PerfectRaw. - * - * NOTE: from GPL3 demosaic pack. - * - * AMAZE: AMaZE interpolation and color aberration removal from RawTherapee project. - */ - enum DecodingQuality - { - // from original dcraw demosaic - BILINEAR = 0, - VNG = 1, - PPG = 2, - AHD = 3, - // Extended demosaicing method from GPL2 demosaic pack - DCB = 4, - PL_AHD = 5, - AFD = 6, - VCD = 7, - VCD_AHD = 8, - LMMSE = 9, - // Extended demosaicing methods from GPL3 demosaic pack - AMAZE = 10 - }; - - /** White balances alternatives - * NONE: no white balance used : reverts to standard daylight D65 WB. - * CAMERA: Use the camera embedded WB if available. Reverts to NONE if not. - * AUTO: Averages an auto WB on the entire image. - * CUSTOM: Let use set it's own temperature and green factor (later converted to RGBG factors). - * AERA: Let use an aera from image to average white balance (see whiteBalanceArea for details). - */ - enum WhiteBalance - { - NONE = 0, - CAMERA = 1, - AUTO = 2, - CUSTOM = 3, - AERA = 4 - }; - - /** Noise Reduction method to apply before demosaicing - * NONR: No noise reduction. - * WAVELETSNR: wavelets correction to erase noise while preserving real detail. It's applied after interpolation. - * FBDDNR: Fake Before Demosaicing Denoising noise reduction. It's applied before interpolation. - * LINENR: CFA Line Denoise. It's applied after interpolation. - * IMPULSENR: Impulse Denoise. It's applied after interpolation. - */ - enum NoiseReduction - { - NONR = 0, - WAVELETSNR, - FBDDNR, - LINENR, - IMPULSENR - }; - - /** Input color profile used to decoded image - * NOINPUTCS: No input color profile. - * EMBEDDED: Use the camera profile embedded in RAW file if exist. - * CUSTOMINPUTCS: Use a custom input color space profile. - */ - enum InputColorSpace - { - NOINPUTCS = 0, - EMBEDDED, - CUSTOMINPUTCS - }; - - /** Output RGB color space used to decoded image - * RAWCOLOR: No output color profile (Linear RAW). - * SRGB: Use standard sRGB color space. - * ADOBERGB: Use standard Adobe RGB color space. - * WIDEGAMMUT: Use standard RGB Wide Gamut color space. - * PROPHOTO: Use standard RGB Pro Photo color space. - * CUSTOMOUTPUTCS: Use a custom workspace color profile. - */ - enum OutputColorSpace - { - RAWCOLOR = 0, - SRGB, - ADOBERGB, - WIDEGAMMUT, - PROPHOTO, - CUSTOMOUTPUTCS - }; - - /** Standard constructor with default settings - */ - RawDecodingSettings(); - - /** Equivalent to the copy constructor - */ - RawDecodingSettings& operator=(const RawDecodingSettings& prm); - - /** Compare for equality - */ - bool operator==(const RawDecodingSettings& o) const; - - /** Standard destructor - */ - virtual ~RawDecodingSettings(); - - /** Method to use a settings to optimize time loading, for exemple to compute image histogram - */ - void optimizeTimeLoading(); - - /** Methods to read/write settings from/to a config file - */ - void readSettings(KConfigGroup& group); - void writeSettings(KConfigGroup& group); - -public: - - /** If true, images with overblown channels are processed much more accurate, - * without 'pink clouds' (and blue highlights under tungsteen lamps). - */ - bool fixColorsHighlights; - - /** If false, use a fixed white level, ignoring the image histogram. - */ - bool autoBrightness; - - /** Turn on RAW file decoding in 16 bits per color per pixel instead 8 bits. - */ - bool sixteenBitsImage; - - /** Half-size color image decoding (twice as fast as "enableRAWQuality"). - * Turn on this option to reduce time loading to render histogram for example, - * no to render an image to screen. - */ - bool halfSizeColorImage; - - /** White balance type to use. See WhiteBalance values for detail - */ - WhiteBalance whiteBalance; - - /** The temperature and the green multiplier of the custom white balance - */ - int customWhiteBalance; - double customWhiteBalanceGreen; - - /** Turn on RAW file decoding using RGB interpolation as four colors. - */ - bool RGBInterpolate4Colors; - - /** For cameras with non-square pixels, do not stretch the image to its - * correct aspect ratio. In any case, this option guarantees that each - * output pixel corresponds to one RAW pixel. - */ - bool DontStretchPixels; - - /** Unclip Highlight color level: - * 0 = Clip all highlights to solid white. - * 1 = Leave highlights unclipped in various shades of pink. - * 2 = Blend clipped and unclipped values together for a gradual - * fade to white. - * 3-9 = Reconstruct highlights. Low numbers favor whites; high numbers - * favor colors. - */ - int unclipColors; - - /** RAW quality decoding factor value. See DecodingQuality values - * for details. - */ - DecodingQuality RAWQuality; - - /** After interpolation, clean up color artifacts by repeatedly applying - * a 3x3 median filter to the R-G and B-G channels. - */ - int medianFilterPasses; - - /** Noise reduction method to apply before demosaicing. - */ - NoiseReduction NRType; - - /** Noise reduction threshold value. Null value disable NR. Range is between 100 and 1000. - * For IMPULSENR : set the amount of Luminance impulse denoise. - */ - int NRThreshold; - - /** Turn on chromatic aberrations correction - * @deprecated does not work with libraw>=0.19 - */ - bool enableCACorrection; - - /** Magnification factor for Red and Blue layers - * - caMultiplier[0] = amount of correction on red-green axis. - * - caMultiplier[1] = amount of correction on blue-yellow axis. - * - Both values set to 0.0 = automatic CA correction. - * @deprecated does not work with libraw>=0.19 - */ - double caMultiplier[2]; - - /** Brightness of output image. - */ - double brightness; - - /** Turn on the black point setting to decode RAW image. - */ - bool enableBlackPoint; - - /** Black Point value of output image. - */ - int blackPoint; - - /** Turn on the white point setting to decode RAW image. - */ - bool enableWhitePoint; - - /** White Point value of output image. - */ - int whitePoint; - - /** The input color profile used to decoded RAW data. See OutputColorProfile - * values for details. - */ - InputColorSpace inputColorSpace; - - /** Path to custom input ICC profile to define the camera's raw colorspace. - */ - QString inputProfile; - - /** The output color profile used to decoded RAW data. See OutputColorProfile - * values for details. - */ - OutputColorSpace outputColorSpace; - - /** Path to custom output ICC profile to define the color workspace. - */ - QString outputProfile; - - /** Path to text file including dead pixel list. - */ - QString deadPixelMap; - - /** Rectangle used to calculate the white balance by averaging the region of image. - */ - QRect whiteBalanceArea; - - //-- Extended demosaicing settings ---------------------------------------------------------- - - /// For DCB interpolation. - - /** Number of DCB median filtering correction passes. - * -1 : disable (default) - * 1-10 : DCB correction passes - */ - int dcbIterations; - - /** Turn on the DCB interpolation with enhance interpolated colors. - */ - bool dcbEnhanceFl; - - /// For VCD_AHD interpolation. - - /** Turn on the EECI refine for VCD Demosaicing. - */ - bool eeciRefine; - - /** Use edge-sensitive median filtering for artifact supression after VCD demosaicing. - * 0 : disable (default) - * 1-10 : median filter passes. - */ - int esMedPasses; - - /** For IMPULSENR Noise reduction. Set the amount of Chrominance impulse denoise. - * Null value disable NR. Range is between 100 and 1000. - * @deprecated does not work with libraw>=0.19 - */ - int NRChroThreshold; - - /** Turn on the Exposure Correction before interpolation. - */ - bool expoCorrection; - - /** Shift of Exposure Correction before interpolation in linear scale. - * Usable range is from 0.25 (darken image 1 stop : -2EV) to 8.0 (lighten ~1.5 photographic stops : +3EV). - */ - double expoCorrectionShift; - - /** Amount of highlight preservation for exposure correction before interpolation in E.V. - * Usable range is from 0.0 (linear exposure shift, highlights may blow) to 1.0 (maximum highlights preservation) - * This settings can only take effect if expoCorrectionShift > 1.0. - */ - double expoCorrectionHighlight; -}; - -//! kDebug() stream operator. Writes settings @a s to the debug output in a nicely formatted way. -KDCRAW_EXPORT QDebug operator<<(QDebug dbg, const RawDecodingSettings& s); - -} // namespace KDcrawIface - -#endif /* RAW_DECODING_SETTINGS_H */ diff --git a/kdcraw/libkdcraw/rawfiles.h b/kdcraw/libkdcraw/rawfiles.h deleted file mode 100644 index 00682353..00000000 --- a/kdcraw/libkdcraw/rawfiles.h +++ /dev/null @@ -1,99 +0,0 @@ -/** =========================================================== - * @file - * - * This file is a part of digiKam project - * http://www.digikam.org - * - * @date 2005-11-06 - * @brief list of RAW file extensions supported by libraw - * - * @author Copyright (C) 2005-2013 by Gilles Caulier - * caulier dot gilles at gmail dot com - * - * This program 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 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * ============================================================ */ - -#ifndef RAW_FILES_H -#define RAW_FILES_H - -// NOTE: extension list Version 1 and 2 are taken from http://www.cybercom.net/~dcoffin/dcraw/rawphoto.c - -// Ext Descriptions From -// www.file-extensions.org -// en.wikipedia.org/wiki/RAW_file_format -// filext.com - -static const char raw_file_extentions[] = - -// NOTE: VERSION 1 - "*.bay " // Casio Digital Camera Raw File Format. - "*.bmq " // NuCore Raw Image File. - "*.cr2 " // Canon Digital Camera RAW Image Format version 2.0. These images are based on the TIFF image standard. - "*.crw " // Canon Digital Camera RAW Image Format version 1.0. - "*.cs1 " // Capture Shop Raw Image File. - "*.dc2 " // Kodak DC25 Digital Camera File. - "*.dcr " // Kodak Digital Camera Raw Image Format for these models: Kodak DSC Pro SLR/c, Kodak DSC Pro SLR/n, Kodak DSC Pro 14N, Kodak DSC PRO 14nx. - "*.dng " // Adobe Digital Negative: DNG is publicly available archival format for the raw files generated by digital cameras. By addressing the lack of an open standard for the raw files created by individual camera models, DNG helps ensure that photographers will be able to access their files in the future. - "*.erf " // Epson Digital Camera Raw Image Format. - "*.fff " // Imacon Digital Camera Raw Image Format. - "*.hdr " // Leaf Raw Image File. - "*.k25 " // Kodak DC25 Digital Camera Raw Image Format. - "*.kdc " // Kodak Digital Camera Raw Image Format. - "*.mdc " // Minolta RD175 Digital Camera Raw Image Format. - "*.mos " // Mamiya Digital Camera Raw Image Format. - "*.mrw " // Minolta Dimage Digital Camera Raw Image Format. - "*.nef " // Nikon Digital Camera Raw Image Format. - "*.orf " // Olympus Digital Camera Raw Image Format. - "*.pef " // Pentax Digital Camera Raw Image Format. - "*.pxn " // Logitech Digital Camera Raw Image Format. - "*.raf " // Fuji Digital Camera Raw Image Format. - "*.raw " // Panasonic Digital Camera Image Format. - "*.rdc " // Digital Foto Maker Raw Image File. - "*.sr2 " // Sony Digital Camera Raw Image Format. - "*.srf " // Sony Digital Camera Raw Image Format for DSC-F828 8 megapixel digital camera or Sony DSC-R1 - "*.x3f " // Sigma Digital Camera Raw Image Format for devices based on Foveon X3 direct image sensor. - "*.arw " // Sony Digital Camera Raw Image Format for Alpha devices. - -// NOTE: VERSION 2 - - "*.3fr " // Hasselblad Digital Camera Raw Image Format. - "*.cine " // Phantom Software Raw Image File. - "*.ia " // Sinar Raw Image File. - "*.kc2 " // Kodak DCS200 Digital Camera Raw Image Format. - "*.mef " // Mamiya Digital Camera Raw Image Format. - "*.nrw " // Nikon Digital Camera Raw Image Format. - "*.qtk " // Apple Quicktake 100/150 Digital Camera Raw Image Format. - "*.rw2 " // Panasonic LX3 Digital Camera Raw Image Format. - "*.sti " // Sinar Capture Shop Raw Image File. - -// NOTE: VERSION 3 - - "*.rwl " // Leica Digital Camera Raw Image Format. - -// NOTE: VERSION 4 - - "*.srw "; // Samnsung Raw Image Format. - -/* TODO: check if these format are supported - "*.drf " // Kodak Digital Camera Raw Image Format. - "*.dsc " // Kodak Digital Camera Raw Image Format. - "*.ptx " // Pentax Digital Camera Raw Image Format. - "*.cap " // Phase One Digital Camera Raw Image Format. - "*.iiq " // Phase One Digital Camera Raw Image Format. - "*.rwz " // Rawzor Digital Camera Raw Image Format. -*/ - -// increment this number whenever you change the above string -static const int raw_file_extensions_version = 4; - -#endif // RAW_FILES_H diff --git a/kdcraw/libkdcraw/rcombobox.cpp b/kdcraw/libkdcraw/rcombobox.cpp deleted file mode 100644 index e140e5f0..00000000 --- a/kdcraw/libkdcraw/rcombobox.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/** =========================================================== - * @file - * - * This file is a part of digiKam project - * http://www.digikam.org - * - * @date 2008-08-16 - * @brief a combo box widget re-implemented with a - * reset button to switch to a default item - * - * @author Copyright (C) 2008-2013 by Gilles Caulier - * caulier dot gilles at gmail dot com - * - * This program 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 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * ============================================================ */ - -#include "moc_rcombobox.cpp" - -// Qt includes - -#include - -// KDE includes - -#include -#include -#include - -namespace KDcrawIface -{ - -class RComboBox::Private -{ - -public: - - Private() - { - defaultIndex = 0; - resetButton = 0; - combo = 0; - } - - int defaultIndex; - - QToolButton* resetButton; - - KComboBox* combo; -}; - -RComboBox::RComboBox(QWidget* const parent) - : KHBox(parent), d(new Private) -{ - d->combo = new KComboBox(this); - d->resetButton = new QToolButton(this); - d->resetButton->setAutoRaise(true); - d->resetButton->setFocusPolicy(Qt::NoFocus); - d->resetButton->setIcon(SmallIcon("document-revert")); - d->resetButton->setToolTip(i18nc("@info:tooltip", "Reset to default value")); - - setStretchFactor(d->combo, 10); - setMargin(0); - setSpacing(KDialog::spacingHint()); - - // ------------------------------------------------------------- - - connect(d->resetButton, SIGNAL(clicked()), - this, SLOT(slotReset())); - - connect(d->combo, SIGNAL(activated(int)), - this, SLOT(slotItemActivated(int))); - - connect(d->combo, SIGNAL(currentIndexChanged(int)), - this, SLOT(slotCurrentIndexChanged(int))); -} - -RComboBox::~RComboBox() -{ - delete d; -} - -KComboBox* RComboBox::combo() const -{ - return d->combo; -} - -void RComboBox::addItem(const QString& t, int index) -{ - d->combo->addItem(t, index); -} - -void RComboBox::insertItem(int index, const QString& t) -{ - d->combo->insertItem(index, t); -} - -int RComboBox::currentIndex() const -{ - return d->combo->currentIndex(); -} - -void RComboBox::setCurrentIndex(int v) -{ - d->combo->setCurrentIndex(v); -} - -int RComboBox::defaultIndex() const -{ - return d->defaultIndex; -} - -void RComboBox::setDefaultIndex(int v) -{ - d->defaultIndex = v; - d->combo->setCurrentIndex(d->defaultIndex); - slotItemActivated(v); -} - -void RComboBox::slotReset() -{ - d->combo->setCurrentIndex(d->defaultIndex); - d->resetButton->setEnabled(false); - slotItemActivated(d->defaultIndex); - emit reset(); -} - -void RComboBox::slotItemActivated(int v) -{ - d->resetButton->setEnabled(v != d->defaultIndex); - emit activated(v); -} - -void RComboBox::slotCurrentIndexChanged(int v) -{ - d->resetButton->setEnabled(v != d->defaultIndex); - emit currentIndexChanged(v); -} - -} // namespace KDcrawIface diff --git a/kdcraw/libkdcraw/rcombobox.h b/kdcraw/libkdcraw/rcombobox.h deleted file mode 100644 index e49c75d6..00000000 --- a/kdcraw/libkdcraw/rcombobox.h +++ /dev/null @@ -1,86 +0,0 @@ -/** =========================================================== - * @file - * - * This file is a part of digiKam project - * http://www.digikam.org - * - * @date 2008-08-16 - * @brief a combo box widget re-implemented with a - * reset button to switch to a default item - * - * @author Copyright (C) 2008-2013 by Gilles Caulier - * caulier dot gilles at gmail dot com - * - * This program 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 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * ============================================================ */ - -#ifndef RCOMBOBOX_H -#define RCOMBOBOX_H - -// KDE includes - -#include -#include - -// Local includes - -#include "kdcraw_export.h" - -namespace KDcrawIface -{ - -class KDCRAW_EXPORT RComboBox : public KHBox -{ - - Q_OBJECT - -public: - - RComboBox(QWidget* const parent=0); - ~RComboBox(); - - void setCurrentIndex(int d); - int currentIndex() const; - - void setDefaultIndex(int d); - int defaultIndex() const; - - KComboBox* combo() const; - - void addItem(const QString& t, int index = -1); - void insertItem(int index, const QString& t); - -Q_SIGNALS: - - void reset(); - void activated(int); - void currentIndexChanged(int); - -public Q_SLOTS: - - void slotReset(); - -private Q_SLOTS: - - void slotItemActivated(int); - void slotCurrentIndexChanged(int); - -private: - - class Private; - Private* const d; -}; - -} // namespace KDcrawIface - -#endif /* RCOMBOBOX_H */ diff --git a/kdcraw/libkdcraw/rexpanderbox.cpp b/kdcraw/libkdcraw/rexpanderbox.cpp deleted file mode 100644 index c7d5742b..00000000 --- a/kdcraw/libkdcraw/rexpanderbox.cpp +++ /dev/null @@ -1,827 +0,0 @@ -/** =========================================================== - * @file - * - * This file is a part of digiKam project - * http://www.digikam.org - * - * @date 2008-03-14 - * @brief A widget to host settings as expander box - * - * @author Copyright (C) 2008-2013 by Gilles Caulier - * caulier dot gilles at gmail dot com - * @author Copyright (C) 2008-2013 by Marcel Wiesweg - * marcel dot wiesweg at gmx dot de - * @author Copyright (C) 2010 by Manuel Viet - * contact at 13zenrv dot fr - * - * This program 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 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * ============================================================ */ - -#include "moc_rexpanderbox.cpp" - -// Qt includes - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// KDE includes - -#include -#include -#include -#include -#include - -namespace KDcrawIface -{ - -RClickLabel::RClickLabel(QWidget* const parent) - : QLabel(parent) -{ - setCursor(Qt::PointingHandCursor); -} - -RClickLabel::RClickLabel(const QString& text, QWidget* const parent) - : QLabel(text, parent) -{ - setCursor(Qt::PointingHandCursor); -} - -RClickLabel::~RClickLabel() -{ -} - -void RClickLabel::mousePressEvent(QMouseEvent* event) -{ - QLabel::mousePressEvent(event); - - /* - * In some contexts, like QGraphicsView, there will be no - * release event if the press event was not accepted. - */ - if (event->button() == Qt::LeftButton) - { - event->accept(); - } -} - -void RClickLabel::mouseReleaseEvent(QMouseEvent* event) -{ - QLabel::mouseReleaseEvent(event); - - if (event->button() == Qt::LeftButton) - { - emit leftClicked(); - emit activated(); - event->accept(); - } -} - -void RClickLabel::keyPressEvent(QKeyEvent* e) -{ - switch (e->key()) - { - case Qt::Key_Down: - case Qt::Key_Right: - case Qt::Key_Space: - emit activated(); - return; - default: - break; - } - - QLabel::keyPressEvent(e); -} - -// ------------------------------------------------------------------------ - -RSqueezedClickLabel::RSqueezedClickLabel(QWidget* const parent) - : KSqueezedTextLabel(parent) -{ - setCursor(Qt::PointingHandCursor); -} - -RSqueezedClickLabel::RSqueezedClickLabel(const QString& text, QWidget* const parent) - : KSqueezedTextLabel(text, parent) -{ - setCursor(Qt::PointingHandCursor); -} - -RSqueezedClickLabel::~RSqueezedClickLabel() -{ -} - -void RSqueezedClickLabel::mouseReleaseEvent(QMouseEvent* event) -{ - KSqueezedTextLabel::mouseReleaseEvent(event); - - if (event->button() == Qt::LeftButton) - { - emit leftClicked(); - emit activated(); - event->accept(); - } -} - -void RSqueezedClickLabel::mousePressEvent(QMouseEvent* event) -{ - QLabel::mousePressEvent(event); - - /* - * In some contexts, like QGraphicsView, there will be no - * release event if the press event was not accepted. - */ - if (event->button() == Qt::LeftButton) - { - event->accept(); - } -} - -void RSqueezedClickLabel::keyPressEvent(QKeyEvent* e) -{ - switch (e->key()) - { - case Qt::Key_Down: - case Qt::Key_Right: - case Qt::Key_Space: - emit activated(); - return; - default: - break; - } - - QLabel::keyPressEvent(e); -} - -// ------------------------------------------------------------------------ - -RArrowClickLabel::RArrowClickLabel(QWidget* const parent) - : QWidget(parent), m_arrowType(Qt::DownArrow) -{ - setCursor(Qt::PointingHandCursor); - setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - m_size = 8; - m_margin = 2; -} - -void RArrowClickLabel::setArrowType(Qt::ArrowType type) -{ - m_arrowType = type; - update(); -} - -RArrowClickLabel::~RArrowClickLabel() -{ -} - -Qt::ArrowType RArrowClickLabel::arrowType() const -{ - return m_arrowType; -} - -void RArrowClickLabel::mousePressEvent(QMouseEvent* event) -{ - /* - * In some contexts, like QGraphicsView, there will be no - * release event if the press event was not accepted. - */ - if (event->button() == Qt::LeftButton) - { - event->accept(); - } -} - -void RArrowClickLabel::mouseReleaseEvent(QMouseEvent* event) -{ - if (event->button() == Qt::LeftButton) - { - emit leftClicked(); - } -} - -void RArrowClickLabel::paintEvent(QPaintEvent*) -{ - // Inspired by karrowbutton.cpp, - // Copyright (C) 2001 Frerich Raabe - - QPainter p(this); - - QStyleOptionFrame opt; - opt.init(this); - opt.lineWidth = 2; - opt.midLineWidth = 0; - - /* - p.fillRect( rect(), palette().brush( QPalette::Background ) ); - style()->drawPrimitive( QStyle::PE_Frame, &opt, &p, this); - */ - - if (m_arrowType == Qt::NoArrow) - return; - - if (width() < m_size + m_margin || height() < m_size + m_margin) - return; // don't draw arrows if we are too small - - unsigned int x = 0, y = 0; - if (m_arrowType == Qt::DownArrow) - { - x = (width() - m_size) / 2; - y = height() - (m_size + m_margin); - } - else if (m_arrowType == Qt::UpArrow) - { - x = (width() - m_size) / 2; - y = m_margin; - } - else if (m_arrowType == Qt::RightArrow) - { - x = width() - (m_size + m_margin); - y = (height() - m_size) / 2; - } - else // arrowType == LeftArrow - { - x = m_margin; - y = (height() - m_size) / 2; - } - -/* - if (isDown()) - { - ++x; - ++y; - } -*/ - - QStyle::PrimitiveElement e = QStyle::PE_IndicatorArrowLeft; - - switch (m_arrowType) - { - case Qt::LeftArrow: - e = QStyle::PE_IndicatorArrowLeft; - break; - case Qt::RightArrow: - e = QStyle::PE_IndicatorArrowRight; - break; - case Qt::UpArrow: - e = QStyle::PE_IndicatorArrowUp; - break; - case Qt::DownArrow: - e = QStyle::PE_IndicatorArrowDown; - break; - case Qt::NoArrow: - break; - } - - opt.state |= QStyle::State_Enabled; - opt.rect = QRect( x, y, m_size, m_size); - - style()->drawPrimitive( e, &opt, &p, this ); -} - -QSize RArrowClickLabel::sizeHint() const -{ - return QSize(m_size + 2*m_margin, m_size + 2*m_margin); -} - -// ------------------------------------------------------------------------ - -class RLabelExpander::Private -{ - -public: - - Private() - { - clickLabel = 0; - containerWidget = 0; - pixmapLabel = 0; - grid = 0; - arrow = 0; - line = 0; - hbox = 0; - checkBox = 0; - expandByDefault = true; - } - - bool expandByDefault; - - QCheckBox* checkBox; - QLabel* pixmapLabel; - QWidget* containerWidget; - QGridLayout* grid; - - KSeparator* line; - QWidget* hbox; - - RArrowClickLabel* arrow; - RClickLabel* clickLabel; -}; - -RLabelExpander::RLabelExpander(QWidget* const parent) - : QWidget(parent), d(new Private) -{ - d->grid = new QGridLayout(this); - d->line = new KSeparator(Qt::Horizontal, this); - d->hbox = new QWidget(this); - d->arrow = new RArrowClickLabel(d->hbox); - d->checkBox = new QCheckBox(d->hbox); - d->pixmapLabel = new QLabel(d->hbox); - d->clickLabel = new RClickLabel(d->hbox); - - QHBoxLayout* const hlay = new QHBoxLayout(d->hbox); - hlay->addWidget(d->arrow); - hlay->addWidget(d->checkBox); - hlay->addWidget(d->pixmapLabel); - hlay->addWidget(d->clickLabel, 10); - hlay->setMargin(0); - hlay->setSpacing(KDialog::spacingHint()); - - d->pixmapLabel->installEventFilter(this); - d->pixmapLabel->setCursor(Qt::PointingHandCursor); - - d->hbox->setCursor(Qt::PointingHandCursor); - setCheckBoxVisible(false); - - d->grid->addWidget(d->line, 0, 0, 1, 3); - d->grid->addWidget(d->hbox, 1, 0, 1, 3); - d->grid->setColumnStretch(2, 10); - d->grid->setMargin(KDialog::spacingHint()); - d->grid->setSpacing(KDialog::spacingHint()); - - connect(d->arrow, SIGNAL(leftClicked()), - this, SLOT(slotToggleContainer())); - - connect(d->clickLabel, SIGNAL(activated()), - this, SLOT(slotToggleContainer())); - - connect(d->checkBox, SIGNAL(toggled(bool)), - this, SIGNAL(signalToggled(bool))); -} - -RLabelExpander::~RLabelExpander() -{ - delete d; -} - -void RLabelExpander::setCheckBoxVisible(bool b) -{ - d->checkBox->setVisible(b); -} - -bool RLabelExpander::checkBoxIsVisible() const -{ - return d->checkBox->isVisible(); -} - -void RLabelExpander::setChecked(bool b) -{ - d->checkBox->setChecked(b); -} - -bool RLabelExpander::isChecked() const -{ - return d->checkBox->isChecked(); -} - -void RLabelExpander::setLineVisible(bool b) -{ - d->line->setVisible(b); -} - -bool RLabelExpander::lineIsVisible() const -{ - return d->line->isVisible(); -} - -void RLabelExpander::setText(const QString& txt) -{ - d->clickLabel->setText(QString("%1").arg(txt)); -} - -QString RLabelExpander::text() const -{ - return d->clickLabel->text(); -} - -void RLabelExpander::setIcon(const QPixmap& pix) -{ - d->pixmapLabel->setPixmap(pix); -} - -const QPixmap* RLabelExpander::icon() const -{ - return d->pixmapLabel->pixmap(); -} - -void RLabelExpander::setWidget(QWidget* const widget) -{ - if (widget) - { - d->containerWidget = widget; - d->containerWidget->setParent(this); - d->grid->addWidget(d->containerWidget, 2, 0, 1, 3); - } -} - -QWidget* RLabelExpander::widget() const -{ - return d->containerWidget; -} - -void RLabelExpander::setExpandByDefault(bool b) -{ - d->expandByDefault = b; -} - -bool RLabelExpander::isExpandByDefault() const -{ - return d->expandByDefault; -} - -void RLabelExpander::setExpanded(bool b) -{ - if (d->containerWidget) - { - d->containerWidget->setVisible(b); - if (b) - d->arrow->setArrowType(Qt::DownArrow); - else - d->arrow->setArrowType(Qt::RightArrow); - } - - emit signalExpanded(b); -} - -bool RLabelExpander::isExpanded() const -{ - return (d->arrow->arrowType() == Qt::DownArrow); -} - -void RLabelExpander::slotToggleContainer() -{ - if (d->containerWidget) - setExpanded(!d->containerWidget->isVisible()); -} - -bool RLabelExpander::eventFilter(QObject* obj, QEvent* ev) -{ - if ( obj == d->pixmapLabel) - { - if ( ev->type() == QEvent::MouseButtonRelease) - { - slotToggleContainer(); - return false; - } - else - { - return false; - } - } - else - { - // pass the event on to the parent class - return QWidget::eventFilter(obj, ev); - } -} - -// ------------------------------------------------------------------------ - -class RExpanderBox::Private -{ -public: - - Private(RExpanderBox* const box) - { - parent = box; - vbox = 0; - } - - void createItem(int index, QWidget* const w, const QPixmap& pix, const QString& txt, - const QString& objName, bool expandBydefault) - { - RLabelExpander* const exp = new RLabelExpander(parent->viewport()); - exp->setText(txt); - exp->setIcon(pix); - exp->setWidget(w); - exp->setLineVisible(!wList.isEmpty()); - exp->setObjectName(objName); - exp->setExpandByDefault(expandBydefault); - - if (index >= 0) - { - vbox->insertWidget(index, exp); - wList.insert(index, exp); - } - else - { - vbox->addWidget(exp); - wList.append(exp); - } - - parent->connect(exp, SIGNAL(signalExpanded(bool)), - parent, SLOT(slotItemExpanded(bool))); - - parent->connect(exp, SIGNAL(signalToggled(bool)), - parent, SLOT(slotItemToggled(bool))); - } - -public: - - QList wList; - - QVBoxLayout* vbox; - - RExpanderBox* parent; -}; - -RExpanderBox::RExpanderBox(QWidget* const parent) - : QScrollArea(parent), d(new Private(this)) -{ - setFrameStyle(QFrame::NoFrame); - setWidgetResizable(true); - QWidget* const main = new QWidget(viewport()); - d->vbox = new QVBoxLayout(main); - d->vbox->setMargin(0); - d->vbox->setSpacing(KDialog::spacingHint()); - setWidget(main); - - setAutoFillBackground(false); - viewport()->setAutoFillBackground(false); - main->setAutoFillBackground(false); -} - -RExpanderBox::~RExpanderBox() -{ - d->wList.clear(); - delete d; -} - -void RExpanderBox::setCheckBoxVisible(int index, bool b) -{ - if (index > d->wList.count() || index < 0) return; - d->wList[index]->setCheckBoxVisible(b); -} - -bool RExpanderBox::checkBoxIsVisible(int index) const -{ - if (index > d->wList.count() || index < 0) return false; - return d->wList[index]->checkBoxIsVisible(); -} - -void RExpanderBox::setChecked(int index, bool b) -{ - if (index > d->wList.count() || index < 0) return; - d->wList[index]->setChecked(b); -} - -bool RExpanderBox::isChecked(int index) const -{ - if (index > d->wList.count() || index < 0) return false; - return d->wList[index]->isChecked(); -} - -void RExpanderBox::addItem(QWidget* const w, const QPixmap& pix, const QString& txt, - const QString& objName, bool expandBydefault) -{ - d->createItem(-1, w, pix, txt, objName, expandBydefault); -} - -void RExpanderBox::addItem(QWidget* const w, const QString& txt, - const QString& objName, bool expandBydefault) -{ - addItem(w, QPixmap(), txt, objName, expandBydefault); -} - -void RExpanderBox::addStretch() -{ - d->vbox->addStretch(10); -} - -void RExpanderBox::insertItem(int index, QWidget* const w, const QPixmap& pix, const QString& txt, - const QString& objName, bool expandBydefault) -{ - d->createItem(index, w, pix, txt, objName, expandBydefault); -} - -void RExpanderBox::slotItemExpanded(bool b) -{ - RLabelExpander* const exp = dynamic_cast(sender()); - if (exp) - { - int index = indexOf(exp); - emit signalItemExpanded(index, b); - } -} - -void RExpanderBox::slotItemToggled(bool b) -{ - RLabelExpander* const exp = dynamic_cast(sender()); - if (exp) - { - int index = indexOf(exp); - emit signalItemToggled(index, b); - } -} - -void RExpanderBox::insertItem(int index, QWidget* const w, const QString& txt, - const QString& objName, bool expandBydefault) -{ - insertItem(index, w, QPixmap(), txt, objName, expandBydefault); -} - -void RExpanderBox::insertStretch(int index) -{ - d->vbox->insertStretch(index, 10); -} - -void RExpanderBox::removeItem(int index) -{ - if (index > d->wList.count() || index < 0) return; - d->wList[index]->hide(); - d->wList.removeAt(index); -} - -void RExpanderBox::setItemText(int index, const QString& txt) -{ - if (index > d->wList.count() || index < 0) return; - d->wList[index]->setText(txt); -} - -QString RExpanderBox::itemText(int index) const -{ - if (index > d->wList.count() || index < 0) return QString(); - return d->wList[index]->text(); -} - -void RExpanderBox::setItemIcon(int index, const QPixmap& pix) -{ - if (index > d->wList.count() || index < 0) return; - d->wList[index]->setIcon(pix); -} - -const QPixmap* RExpanderBox::itemIcon(int index) const -{ - if (index > d->wList.count() || index < 0) return 0; - return d->wList[index]->icon(); -} - -int RExpanderBox::count() const -{ - return d->wList.count(); -} - -void RExpanderBox::setItemToolTip(int index, const QString& tip) -{ - if (index > d->wList.count() || index < 0) return; - d->wList[index]->setToolTip(tip); -} - -QString RExpanderBox::itemToolTip(int index) const -{ - if (index > d->wList.count() || index < 0) return QString(); - return d->wList[index]->toolTip(); -} - -void RExpanderBox::setItemEnabled(int index, bool enabled) -{ - if (index > d->wList.count() || index < 0) return; - d->wList[index]->setEnabled(enabled); -} - -bool RExpanderBox::isItemEnabled(int index) const -{ - if (index > d->wList.count() || index < 0) return false; - return d->wList[index]->isEnabled(); -} - -RLabelExpander* RExpanderBox::widget(int index) const -{ - if (index > d->wList.count() || index < 0) return 0; - - return d->wList[index]; -} - -int RExpanderBox::indexOf(RLabelExpander* const widget) const -{ - for (int i = 0 ; i < count(); ++i) - { - RLabelExpander* const exp = d->wList[i]; - - if (widget == exp) - return i; - } - return -1; -} - -void RExpanderBox::setItemExpanded(int index, bool b) -{ - if (index > d->wList.count() || index < 0) return; - - RLabelExpander* const exp = d->wList[index]; - - if (!exp) return; - - exp->setExpanded(b); -} - -bool RExpanderBox::isItemExpanded(int index) const -{ - if (index > d->wList.count() || index < 0) return false; - - RLabelExpander* const exp = d->wList[index]; - - if (!exp) return false; - - return (exp->isExpanded()); -} - -void RExpanderBox::readSettings(KConfigGroup& group) -{ - for (int i = 0 ; i < count(); ++i) - { - RLabelExpander* const exp = d->wList[i]; - - if (exp) - { - exp->setExpanded(group.readEntry(QString("%1 Expanded").arg(exp->objectName()), - exp->isExpandByDefault())); - } - } -} - -void RExpanderBox::writeSettings(KConfigGroup& group) -{ - for (int i = 0 ; i < count(); ++i) - { - RLabelExpander* const exp = d->wList[i]; - - if (exp) - { - group.writeEntry(QString("%1 Expanded").arg(exp->objectName()), - exp->isExpanded()); - } - } -} - -// ------------------------------------------------------------------------ - -RExpanderBoxExclusive::RExpanderBoxExclusive(QWidget* const parent) - : RExpanderBox(parent) -{ - setIsToolBox(true); -} - -RExpanderBoxExclusive::~RExpanderBoxExclusive() -{ -} - -void RExpanderBoxExclusive::slotItemExpanded(bool b) -{ - RLabelExpander* const exp = dynamic_cast(sender()); - if (!exp) return; - - if (isToolBox() && b) - { - int item = 0; - - while (item < count()) - { - if (isItemExpanded(item) && item != indexOf(exp)) - { - setItemExpanded(item, false); - } - - item++; - } - } - emit signalItemExpanded(indexOf(exp), b); -} - -void RExpanderBoxExclusive::setIsToolBox(bool b) -{ - m_toolbox = b; -} - -bool RExpanderBoxExclusive::isToolBox() const -{ - return (m_toolbox); -} - -} // namespace KDcrawIface diff --git a/kdcraw/libkdcraw/rexpanderbox.h b/kdcraw/libkdcraw/rexpanderbox.h deleted file mode 100644 index 8bb91878..00000000 --- a/kdcraw/libkdcraw/rexpanderbox.h +++ /dev/null @@ -1,299 +0,0 @@ -/** =========================================================== - * @file - * - * This file is a part of digiKam project - * http://www.digikam.org - * - * @date 2008-03-14 - * @brief A widget to host settings as expander box - * - * @author Copyright (C) 2008-2013 by Gilles Caulier - * caulier dot gilles at gmail dot com - * @author Copyright (C) 2008-2013 by Marcel Wiesweg - * marcel dot wiesweg at gmx dot de - * @author Copyright (C) 2010 by Manuel Viet - * contact at 13zenrv dot fr - * - * This program 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 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * ============================================================ */ - -#ifndef REXPANDERBOX_H -#define REXPANDERBOX_H - -// Qt includes - -#include -#include -#include -#include -#include - -// KDE includes - -#include -#include - -// Local includes - -#include "kdcraw_export.h" - -namespace KDcrawIface -{ - -class KDCRAW_EXPORT RClickLabel : public QLabel -{ - Q_OBJECT - -public: - - RClickLabel(QWidget* const parent = 0); - explicit RClickLabel(const QString& text, QWidget* const parent = 0); - ~RClickLabel(); - -Q_SIGNALS: - - /// Emitted when activated by left mouse click - void leftClicked(); - /// Emitted when activated, by mouse or key press - void activated(); - -protected: - - virtual void mousePressEvent(QMouseEvent* event); - virtual void mouseReleaseEvent(QMouseEvent* event); - virtual void keyPressEvent(QKeyEvent* event); -}; - -// ------------------------------------------------------------------------- - -class KDCRAW_EXPORT RSqueezedClickLabel : public KSqueezedTextLabel -{ - Q_OBJECT - -public: - - RSqueezedClickLabel(QWidget* const parent = 0); - explicit RSqueezedClickLabel(const QString& text, QWidget* const parent = 0); - ~RSqueezedClickLabel(); - -Q_SIGNALS: - - void leftClicked(); - void activated(); - -protected: - - virtual void mousePressEvent(QMouseEvent* event); - virtual void mouseReleaseEvent(QMouseEvent* event); - virtual void keyPressEvent(QKeyEvent* event); -}; - -// ------------------------------------------------------------------------- - -class KDCRAW_EXPORT RArrowClickLabel : public QWidget -{ - Q_OBJECT - -public: - - RArrowClickLabel(QWidget* const parent = 0); - ~RArrowClickLabel(); - - void setArrowType(Qt::ArrowType arrowType); - Qt::ArrowType arrowType() const; - - virtual QSize sizeHint () const; - -Q_SIGNALS: - - void leftClicked(); - -protected: - - virtual void mousePressEvent(QMouseEvent* event); - virtual void mouseReleaseEvent(QMouseEvent* event); - virtual void paintEvent(QPaintEvent* event); - -protected: - - Qt::ArrowType m_arrowType; - int m_size; - int m_margin; -}; - -// ------------------------------------------------------------------------- - -class KDCRAW_EXPORT RLabelExpander : public QWidget -{ - Q_OBJECT - -public: - - RLabelExpander(QWidget* const parent = 0); - ~RLabelExpander(); - - void setCheckBoxVisible(bool b); - bool checkBoxIsVisible() const; - - void setChecked(bool b); - bool isChecked() const; - - void setLineVisible(bool b); - bool lineIsVisible() const; - - void setText(const QString& txt); - QString text() const; - - void setIcon(const QPixmap& pix); - const QPixmap* icon() const; - - void setWidget(QWidget* const widget); - QWidget* widget() const; - - void setExpanded(bool b); - bool isExpanded() const; - - void setExpandByDefault(bool b); - bool isExpandByDefault() const; - -Q_SIGNALS: - - void signalExpanded(bool); - void signalToggled(bool); - -private Q_SLOTS: - - void slotToggleContainer(); - -private: - - bool eventFilter(QObject* obj, QEvent* ev); - -private: - - class Private; - Private* const d; -}; - -// ------------------------------------------------------------------------- - -class KDCRAW_EXPORT RExpanderBox : public QScrollArea -{ - Q_OBJECT - -public: - - RExpanderBox(QWidget* const parent = 0); - ~RExpanderBox(); - - /** Add RLabelExpander item at end of box layout with these settings : - 'w' : the widget hosted by RLabelExpander. - 'pix' : pixmap used as icon to item title. - 'txt' : text used as item title. - 'objName' : item object name used to read/save expanded settings to rc file. - 'expandBydefault' : item state by default (expanded or not). - */ - void addItem(QWidget* const w, const QPixmap& pix, const QString& txt, - const QString& objName, bool expandBydefault); - void addItem(QWidget* const w, const QString& txt, - const QString& objName, bool expandBydefault); - - /** Insert RLabelExpander item at box layout index with these settings : - 'w' : the widget hosted by RLabelExpander. - 'pix' : pixmap used as icon to item title. - 'txt' : text used as item title. - 'objName' : item object name used to read/save expanded settings to rc file. - 'expandBydefault' : item state by default (expanded or not). - */ - void insertItem(int index, QWidget* const w, const QPixmap& pix, const QString& txt, - const QString& objName, bool expandBydefault); - void insertItem(int index, QWidget* const w, const QString& txt, - const QString& objName, bool expandBydefault); - - void removeItem(int index); - - void setCheckBoxVisible(int index, bool b); - bool checkBoxIsVisible(int index) const; - - void setChecked(int index, bool b); - bool isChecked(int index) const; - - void setItemText(int index, const QString& txt); - QString itemText (int index) const; - - void setItemIcon(int index, const QPixmap& pix); - const QPixmap* itemIcon(int index) const; - - void setItemToolTip(int index, const QString& tip); - QString itemToolTip(int index) const; - - void setItemEnabled(int index, bool enabled); - bool isItemEnabled(int index) const; - - void addStretch(); - void insertStretch(int index); - - void setItemExpanded(int index, bool b); - bool isItemExpanded(int index) const; - - int count() const; - - RLabelExpander* widget(int index) const; - int indexOf(RLabelExpander* const widget) const; - - virtual void readSettings(KConfigGroup& group); - virtual void writeSettings(KConfigGroup& group); - -Q_SIGNALS: - - void signalItemExpanded(int index, bool b); - void signalItemToggled(int index, bool b); - -private Q_SLOTS: - - void slotItemExpanded(bool b); - void slotItemToggled(bool b); - -private: - - class Private; - Private* const d; -}; - -// ------------------------------------------------------------------------- - -class KDCRAW_EXPORT RExpanderBoxExclusive : public RExpanderBox -{ - Q_OBJECT - -public: - - RExpanderBoxExclusive(QWidget* const parent = 0); - ~RExpanderBoxExclusive(); - - /** Show one expander open at most */ - void setIsToolBox(bool b); - bool isToolBox() const; - -private Q_SLOTS: - - void slotItemExpanded(bool b); - -private: - - bool m_toolbox; -}; - -} // namespace KDcrawIface - -#endif // REXPANDERBOX_H diff --git a/kdcraw/libkdcraw/rnuminput.cpp b/kdcraw/libkdcraw/rnuminput.cpp deleted file mode 100644 index 92b68000..00000000 --- a/kdcraw/libkdcraw/rnuminput.cpp +++ /dev/null @@ -1,239 +0,0 @@ -/** =========================================================== - * @file - * - * This file is a part of digiKam project - * http://www.digikam.org - * - * @date 2008-08-16 - * @brief Integer and double num input widget - * re-implemented with a reset button to switch to - * a default value - * - * @author Copyright (C) 2008-2013 by Gilles Caulier - * caulier dot gilles at gmail dot com - * - * This program 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 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * ============================================================ */ - -#include "moc_rnuminput.cpp" - -// Qt includes - -#include - -// KDE includes - -#include -#include -#include - -namespace KDcrawIface -{ - -class RIntNumInput::Private -{ - -public: - - Private() - { - defaultValue = 0; - resetButton = 0; - input = 0; - } - - int defaultValue; - - QToolButton* resetButton; - - KIntNumInput* input; -}; - -RIntNumInput::RIntNumInput(QWidget* const parent) - : KHBox(parent), d(new Private) -{ - d->input = new KIntNumInput(this); - d->resetButton = new QToolButton(this); - d->resetButton->setAutoRaise(true); - d->resetButton->setFocusPolicy(Qt::NoFocus); - d->resetButton->setIcon(SmallIcon("document-revert")); - d->resetButton->setToolTip(i18nc("@info:tooltip", "Reset to default value")); - - setStretchFactor(d->input, 10); - setMargin(0); - setSpacing(KDialog::spacingHint()); - - // ------------------------------------------------------------- - - connect(d->resetButton, SIGNAL(clicked()), - this, SLOT(slotReset())); - - connect(d->input, SIGNAL(valueChanged(int)), - this, SLOT(slotValueChanged(int))); -} - -RIntNumInput::~RIntNumInput() -{ - delete d; -} - -KIntNumInput* RIntNumInput::input() const -{ - return d->input; -} - -void RIntNumInput::setSliderEnabled(bool b) -{ - d->input->setSliderEnabled(b); -} - -void RIntNumInput::setRange(int min, int max, int step) -{ - d->input->setRange(min, max, step); -} - -int RIntNumInput::value() const -{ - return d->input->value(); -} - -void RIntNumInput::setValue(int v) -{ - d->input->setValue(v); -} - -int RIntNumInput::defaultValue() const -{ - return d->defaultValue; -} - -void RIntNumInput::setDefaultValue(int v) -{ - d->defaultValue = v; - d->input->setValue(d->defaultValue); - slotValueChanged(v); -} - -void RIntNumInput::slotReset() -{ - d->input->setValue(d->defaultValue); - d->resetButton->setEnabled(false); - emit reset(); -} - -void RIntNumInput::slotValueChanged(int v) -{ - d->resetButton->setEnabled(v != d->defaultValue); - emit valueChanged(v); -} - -// ---------------------------------------------------- - -class RDoubleNumInput::Private -{ - -public: - - Private() - { - defaultValue = 0.0; - resetButton = 0; - input = 0; - } - - double defaultValue; - - QToolButton* resetButton; - - KDoubleNumInput* input; -}; - -RDoubleNumInput::RDoubleNumInput(QWidget* const parent) - : KHBox(parent), d(new Private) -{ - d->input = new KDoubleNumInput(this); - d->resetButton = new QToolButton(this); - d->resetButton->setAutoRaise(true); - d->resetButton->setFocusPolicy(Qt::NoFocus); - d->resetButton->setIcon(SmallIcon("document-revert")); - d->resetButton->setToolTip(i18nc("@info:tooltip", "Reset to default value")); - - setStretchFactor(d->input, 10); - setMargin(0); - setSpacing(KDialog::spacingHint()); - - // ------------------------------------------------------------- - - connect(d->resetButton, SIGNAL(clicked()), - this, SLOT(slotReset())); - - connect(d->input, SIGNAL(valueChanged(double)), - this, SLOT(slotValueChanged(double))); -} - -RDoubleNumInput::~RDoubleNumInput() -{ - delete d; -} - -KDoubleNumInput* RDoubleNumInput::input() const -{ - return d->input; -} - -void RDoubleNumInput::setDecimals(int p) -{ - d->input->setDecimals(p); -} - -void RDoubleNumInput::setRange(double min, double max, double step, bool slider) -{ - d->input->setRange(min, max, step, slider); -} - -double RDoubleNumInput::value() const -{ - return d->input->value(); -} - -void RDoubleNumInput::setValue(double v) -{ - d->input->setValue(v); -} - -double RDoubleNumInput::defaultValue() const -{ - return d->defaultValue; -} - -void RDoubleNumInput::setDefaultValue(double v) -{ - d->defaultValue = v; - d->input->setValue(d->defaultValue); - slotValueChanged(v); -} - -void RDoubleNumInput::slotReset() -{ - d->input->setValue(d->defaultValue); - d->resetButton->setEnabled(false); - emit reset(); -} - -void RDoubleNumInput::slotValueChanged(double v) -{ - d->resetButton->setEnabled(v != d->defaultValue); - emit valueChanged(v); -} - -} // namespace KDcrawIface diff --git a/kdcraw/libkdcraw/rnuminput.h b/kdcraw/libkdcraw/rnuminput.h deleted file mode 100644 index 296d4321..00000000 --- a/kdcraw/libkdcraw/rnuminput.h +++ /dev/null @@ -1,125 +0,0 @@ -/** =========================================================== - * @file - * - * This file is a part of digiKam project - * http://www.digikam.org - * - * @date 2008-08-16 - * @brief Integer and double num input widget - * re-implemented with a reset button to switch to - * a default value - * - * @author Copyright (C) 2008-2013 by Gilles Caulier - * caulier dot gilles at gmail dot com - * - * This program 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 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * ============================================================ */ - -#ifndef RNUMINPUT_H -#define RNUMINPUT_H - -// KDE includes - -#include -#include - -// Local includes - -#include "kdcraw_export.h" - -namespace KDcrawIface -{ - -class KDCRAW_EXPORT RIntNumInput : public KHBox -{ - Q_OBJECT - -public: - - RIntNumInput(QWidget* const parent=0); - ~RIntNumInput(); - - int value() const; - - void setSliderEnabled(bool b); - void setRange(int min, int max, int step); - - void setDefaultValue(int d); - int defaultValue() const; - - KIntNumInput* input() const; - -Q_SIGNALS: - - void reset(); - void valueChanged(int); - -public Q_SLOTS: - - void setValue(int d); - void slotReset(); - -private Q_SLOTS: - - void slotValueChanged(int); - -private: - - class Private; - Private* const d; -}; - -// --------------------------------------------------------- - -class KDCRAW_EXPORT RDoubleNumInput : public KHBox -{ - Q_OBJECT - -public: - - RDoubleNumInput(QWidget* const parent=0); - ~RDoubleNumInput(); - - double value() const; - - void setDecimals(int p); - void setRange(double min, double max, double step, bool slider=true); - - void setDefaultValue(double d); - double defaultValue() const; - - KDoubleNumInput* input() const; - -Q_SIGNALS: - - void reset(); - void valueChanged(double); - -public Q_SLOTS: - - void setValue(double d); - void slotReset(); - -private Q_SLOTS: - - void slotValueChanged(double); - -private: - - class Private; - Private* const d; -}; - -} // namespace KDcrawIface - -#endif /* RNUMINPUT_H */ diff --git a/kdcraw/libkdcraw/squeezedcombobox.cpp b/kdcraw/libkdcraw/squeezedcombobox.cpp deleted file mode 100644 index 3d46d54c..00000000 --- a/kdcraw/libkdcraw/squeezedcombobox.cpp +++ /dev/null @@ -1,200 +0,0 @@ -/** =========================================================== - * @file - * - * This file is a part of digiKam project - * http://www.digikam.org - * - * @date 2008-08-21 - * @brief a combo box with a width not depending of text - * content size - * - * @author Copyright (C) 2006-2013 by Gilles Caulier - * caulier dot gilles at gmail dot com - * @author Copyright (C) 2008 by Andi Clemens - * andi dot clemens at googlemail dot com - * @author Copyright (C) 2005 by Tom Albers - * tomalbers at kde dot nl - * - * This program 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 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * ============================================================ */ - -#include "moc_squeezedcombobox.cpp" - -// Qt includes - -#include -#include -#include -#include -#include -#include -#include - -namespace KDcrawIface -{ - -class SqueezedComboBox::Private -{ -public: - - Private() - { - timer = 0; - } - - QMap originalItems; - - QTimer* timer; -}; - -SqueezedComboBox::SqueezedComboBox(QWidget* const parent, const char* name) - : QComboBox(parent), d(new Private) -{ - setObjectName(name); - setMinimumWidth(100); - d->timer = new QTimer(this); - d->timer->setSingleShot(true); - - connect(d->timer, SIGNAL(timeout()), - this, SLOT(slotTimeOut())); - - connect(this, SIGNAL(activated(int)), - SLOT(slotUpdateToolTip(int))); -} - -SqueezedComboBox::~SqueezedComboBox() -{ - d->originalItems.clear(); - delete d->timer; - delete d; -} - -bool SqueezedComboBox::contains(const QString& text) const -{ - if (text.isEmpty()) - return false; - - for (QMap::const_iterator it = d->originalItems.constBegin() ; it != d->originalItems.constEnd(); ++it) - { - if (it.value() == text) - return true; - } - - return false; -} - -QSize SqueezedComboBox::sizeHint() const -{ - ensurePolished(); - QFontMetrics fm = fontMetrics(); - int maxW = count() ? 18 : 7 * fm.width(QChar('x')) + 18; - int maxH = qMax( fm.lineSpacing(), 14 ) + 2; - - QStyleOptionComboBox options; - options.initFrom(this); - - return style()->sizeFromContents(QStyle::CT_ComboBox, &options, - QSize(maxW, maxH), this).expandedTo(QApplication::globalStrut()); -} - -void SqueezedComboBox::insertSqueezedItem(const QString& newItem, int index, - const QVariant& userData) -{ - d->originalItems[index] = newItem; - QComboBox::insertItem(index, squeezeText(newItem), userData); - - // if this is the first item, set the tooltip. - if (index == 0) - slotUpdateToolTip(0); -} - -void SqueezedComboBox::insertSqueezedList(const QStringList& newItems, int index) -{ - for(QStringList::const_iterator it = newItems.constBegin() ; it != newItems.constEnd() ; ++it) - { - insertSqueezedItem(*it, index); - index++; - } -} - -void SqueezedComboBox::addSqueezedItem(const QString& newItem, - const QVariant& userData) -{ - insertSqueezedItem(newItem, count(), userData); -} - -void SqueezedComboBox::setCurrent(const QString& itemText) -{ - QString squeezedText = squeezeText(itemText); - qint32 itemIndex = findText(squeezedText); - - if (itemIndex >= 0) - setCurrentIndex(itemIndex); -} - -void SqueezedComboBox::resizeEvent(QResizeEvent *) -{ - d->timer->start(200); -} - -void SqueezedComboBox::slotTimeOut() -{ - for (QMap::iterator it = d->originalItems.begin() ; it != d->originalItems.end(); ++it) - { - setItemText( it.key(), squeezeText( it.value() ) ); - } -} - -QString SqueezedComboBox::squeezeText(const QString& original) const -{ - // not the complete widgetSize is usable. Need to compensate for that. - int widgetSize = width()-30; - QFontMetrics fm( fontMetrics() ); - - // If we can fit the full text, return that. - if (fm.width(original) < widgetSize) - return(original); - - // We need to squeeze. - QString sqItem = original; // prevent empty return value; - widgetSize = widgetSize-fm.width("..."); - - for (int i = 0 ; i != original.length(); ++i) - { - if ((int)fm.width(original.right(i)) > widgetSize) - { - sqItem = QString(original.left(i) + "..."); - break; - } - } - - return sqItem; -} - -void SqueezedComboBox::slotUpdateToolTip(int index) -{ - setToolTip(d->originalItems[index]); -} - -QString SqueezedComboBox::itemHighlighted() const -{ - int curItem = currentIndex(); - return d->originalItems[curItem]; -} - -QString SqueezedComboBox::item(int index) const -{ - return d->originalItems[index]; -} - -} // namespace KDcrawIface diff --git a/kdcraw/libkdcraw/squeezedcombobox.h b/kdcraw/libkdcraw/squeezedcombobox.h deleted file mode 100644 index 7468de15..00000000 --- a/kdcraw/libkdcraw/squeezedcombobox.h +++ /dev/null @@ -1,165 +0,0 @@ -/** =========================================================== - * @file - * - * This file is a part of digiKam project - * http://www.digikam.org - * - * @date 2008-08-21 - * @brief a combo box with a width not depending of text - * content size - * - * @author Copyright (C) 2006-2013 by Gilles Caulier - * caulier dot gilles at gmail dot com - * @author Copyright (C) 2008 by Andi Clemens - * andi dot clemens at googlemail dot com - * @author Copyright (C) 2005 by Tom Albers - * tomalbers at kde dot nl - * - * This program 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 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * ============================================================ */ - -#ifndef SQUEEZEDCOMBOBOX_H -#define SQUEEZEDCOMBOBOX_H - -// Qt includes - -#include - -// Local includes - -#include "kdcraw_export.h" - -namespace KDcrawIface -{ - -/** @class SqueezedComboBox - * - * This widget is a QComboBox, but then a little bit - * different. It only shows the right part of the items - * depending on de size of the widget. When it is not - * possible to show the complete item, it will be shortened - * and "..." will be prepended. - */ -class KDCRAW_EXPORT SqueezedComboBox : public QComboBox -{ - Q_OBJECT - -public: - - /** - * Constructor - * @param parent parent widget - * @param name name to give to the widget - */ - explicit SqueezedComboBox(QWidget* const parent = 0, const char* name = 0 ); - /** - * destructor - */ - virtual ~SqueezedComboBox(); - - /** - * - * Returns true if the combobox contains the original (not-squeezed) - * version of text. - * @param text the original (not-squeezed) text to check for - */ - bool contains(const QString& text) const; - - /** - * This inserts a item to the list. See QComboBox::insertItem() - * for details. Please do not use QComboBox::insertItem() to this - * widget, as that will fail. - * @param newItem the original (long version) of the item which needs - * to be added to the combobox - * @param index the position in the widget. - * @param userData custom meta-data assigned to new item. - */ - void insertSqueezedItem(const QString& newItem, int index, - const QVariant& userData=QVariant()); - - /** - * This inserts items to the list. See QComboBox::insertItems() - * for details. Please do not use QComboBox:: insertItems() to this - * widget, as that will fail. - * @param newItems the originals (long version) of the items which needs - * to be added to the combobox - * @param index the position in the widget. - */ - void insertSqueezedList(const QStringList& newItems, int index); - - /** - * Append an item. - * @param newItem the original (long version) of the item which needs - * to be added to the combobox - * @param userData custom meta-data assigned to new item. - */ - void addSqueezedItem(const QString& newItem, - const QVariant& userData=QVariant()); - - /** - * Set the current item to the one matching the given text. - * - * @param itemText the original (long version) of the item text - */ - void setCurrent(const QString& itemText); - - /** - * This method returns the full text (not squeezed) of the currently - * highlighted item. - * @return full text of the highlighted item - */ - QString itemHighlighted() const; - - /** - * This method returns the full text (not squeezed) for the index. - * @param index the position in the widget. - * @return full text of the item - */ - QString item(int index) const; - - /** - * Sets the sizeHint() of this widget. - */ - virtual QSize sizeHint() const; - -private Q_SLOTS: - - void slotTimeOut(); - void slotUpdateToolTip(int index); - -private: - - void resizeEvent(QResizeEvent*); - QString squeezeText(const QString& original) const; - - // Prevent these from being used. - QString currentText() const; - void setCurrentText(const QString& itemText); - void insertItem(const QString& text); - void insertItem(qint32 index, const QString& text); - void insertItem(int index, const QIcon& icon, const QString& text, const QVariant& userData=QVariant()); - void insertItems(int index, const QStringList& list); - void addItem(const QString& text); - void addItem(const QIcon& icon, const QString& text, const QVariant& userData=QVariant()); - void addItems(const QStringList& texts); - QString itemText(int index) const; - -private: - - class Private; - Private* const d; -}; - -} // namespace KDcrawIface - -#endif // SQUEEZEDCOMBOBOX_H diff --git a/kdcraw/libkdcraw/version.h.cmake b/kdcraw/libkdcraw/version.h.cmake deleted file mode 100644 index c93015e3..00000000 --- a/kdcraw/libkdcraw/version.h.cmake +++ /dev/null @@ -1,33 +0,0 @@ -/** =========================================================== - * - * This file is a part of digiKam project - * http://www.digikam.org - * - * @date 2007-02-12 - * @brief libraw program interface for KDE - * - * @author Copyright (C) 2007-2013 by Gilles Caulier - * caulier dot gilles at gmail dot com - * - * This program 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 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * ============================================================ */ - -#ifndef KDCRAW_VERSION_H -#define KDCRAW_VERSION_H - -// Before changing the line below, make sure that FindKdcraw.cmake can still parse it -static const char kdcraw_version[] = "${DCRAW_LIB_VERSION_STRING}"; - -#define KDCRAW_VERSION ${DCRAW_LIB_VERSION_ID} - -#endif // KDCRAW_VERSION_H diff --git a/kdcraw/profiles/CMakeLists.txt b/kdcraw/profiles/CMakeLists.txt deleted file mode 100644 index 3bdddf32..00000000 --- a/kdcraw/profiles/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -# =========================================================== -# -# This file is a part of digiKam project -# http://www.digikam.org -# -# @date 2006-12-09 -# @brief a tread-safe libraw C++ program interface for KDE -# -# @author Copyright (C) 2006-2012 by Gilles Caulier -# caulier dot gilles at gmail dot com -# -# This program 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 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# ============================================================ - -FILE(GLOB icmfiles *.icm *.icc) - -INSTALL( - FILES - ${icmfiles} - DESTINATION ${KDE4_DATA_INSTALL_DIR}/libkdcraw/profiles -) diff --git a/kdcraw/profiles/compatibleWithAdobeRGB1998.icc b/kdcraw/profiles/compatibleWithAdobeRGB1998.icc deleted file mode 100644 index 1eedf0930d177965d7d7fa47bad7e88e00ee74ff..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 580 zcmZQzU~)+;O3z_ZU|`72D=7+ccT$Lmj8b5~#=y?N!NANQ!=Rs-TwLHA>=wcR1bO*+ zsUR8^e7nZL2okxh3o;8;jv$XKCAByisOk?8S0@(~l`t?cRsh+iY8fk_0&=1YgLRY2?{2-^h2hT02cGAKId z=N2TEWG3aLDwJoIWGFbMsV(9+UE6Qqcmpd_^d=r;z2fYPL#%wz?Z{M^LM zJUs=!e1-7DqN2pSl1d$g(Bf2u#1e)4@;rs2%;Ic4ka|$ufM^DW&w=1DXB0bw5QE5o zNQBrN2?hrLr3?%#e-L6Oy$lQsbQl=;ry|7E3>g>%^cfiT%}FjTDubHD$YjjGK!^_j D3%6HW diff --git a/kdcraw/profiles/prophoto.icm b/kdcraw/profiles/prophoto.icm deleted file mode 100644 index 8240383170412071b24321140178c37becf2eca1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1132 zcmb_bJ#Q2-5S`1NNOXXd0tq3S5d})3`v?&QqCg@+0)$RUP5}X;@!Gy!N4xgQ>%G0J z_#^xT3MxAO0aOuG6cqdbs?^Nv9^@iK7fZW-o*B=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m>#Ucn-&?l+n&~e7`))twTl9taWI45`~{Z0b+}XUS=BI{oyEpCW#mIOB0<;4I^8$Iog%*LP96io2oi?CzzW z*dAVQXz%Db_j3b%mVI5n=>2lyywdr)3lbN~`tkjR{c9I{GUzDFlS!=mipVL*}~_f=T&oxbFK46^XC_w z7w*2;^kVj9^2^o5qTj`TuYaZa>gPXf{}^5hS(<&#eZBT)=^N=cC*B&r9a#2Re)=xy z-Res5d+GNlKQKNFeGL9Mx0?A0^Qro?*5|%29$y}>C9SOqwSZ6y2(^Gv3kbD!8;j00JKoK091Rx+60MFY1)YJl?9?kDB ngr~8y`28IKINRvVZOPf(xR}_qb@cR9Ha(ilW+!Iz`wHMcHAE97 diff --git a/kdcraw/profiles/widegamut.icm b/kdcraw/profiles/widegamut.icm deleted file mode 100644 index 120a99a17d6154a37d0160a5f486e91400d3d940..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2044 zcmZQzVE~ znB4(l7Xcjz6rTfPr$g8qz-l1uBVaWlLC!!mHy9Y0c+$aa<|iO_5}3{U0mO#d3sla) zAD)?#s^FfOTUw$33<8i4bwNpL1;`&@0196S3lVMzF^CL^M2KzAWngf!MHQ30%fPU+ zm4Sg*7NJgc3IhX+0|Ub`x#ZHKGLU*;7(gf{V0^MOa5D%pNH8ccXfc>FI5PM%#4+SE zG%`$KSjljJ;ReGeMm|PuMlZ%J#vaBEj8_@|FsU;6GgULKWV*@B&1}b9%)E;EF^eoq zB+GP`>#UNjv8;<(U$Ggp)w7*pmuAml-_Ie!k?r0Lo!3>hh2{liu8}_i@p#m8W$74G~r{CeR6-w zqcn^32^p`l+_RVEa^&UYUoNyMT3#Yr+E(_nBCqmUbz;rEy4d>rjVVp9T1wg&+WR`? zyEgZD_CD;dnJ6`B*Ob_4Ow(7+44KU^XT!Xt1!4=&E^b@uw48Cpp;c{beAbDsf4Fh| z=K8Hc+ckDF?7F>Y=f0T-st+X|@jPaHLgAFa8K$$}&%e9);_}n0Pp&_^`TF*!yMG>V zJQ9DR`ONl3$g8|JUGG+YIQ8k>SJChGKeK<&`g{8S|IxHCnifXW!f3gGUM>ItNOGLM diff --git a/kdcraw/tests/CMakeLists.txt b/kdcraw/tests/CMakeLists.txt deleted file mode 100644 index 52beca8f..00000000 --- a/kdcraw/tests/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -# =========================================================== -# -# This file is a part of digiKam project -# http://www.digikam.org -# -# @date 2006-12-09 -# @brief a tread-safe libraw C++ program interface for KDE -# -# @author Copyright (C) 2006-2013 by Gilles Caulier -# caulier dot gilles at gmail dot com -# -# This program 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 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# ============================================================ - -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../libkdcraw) - -KDE4_ADD_MANUAL_TEST(kdcraw-raw2png raw2png.cpp) -TARGET_LINK_LIBRARIES(kdcraw-raw2png kdcraw ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}) - -KDE4_ADD_MANUAL_TEST(kdcraw-libinfo libinfo.cpp) -TARGET_LINK_LIBRARIES(kdcraw-libinfo kdcraw ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}) diff --git a/kdcraw/tests/libinfo.cpp b/kdcraw/tests/libinfo.cpp deleted file mode 100644 index e3a05e23..00000000 --- a/kdcraw/tests/libinfo.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/** =========================================================== - * - * This file is a part of digiKam project - * http://www.digikam.org - * - * @date 2013-09-07 - * @brief a command line tool to show libkdcraw info - * - * @author Copyright (C) 2013 by Gilles Caulier - * caulier dot gilles at gmail dot com - * - * This program 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 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * ============================================================ */ - -// Qt includes - -#include -#include - -// Local includes - -#include "kdcraw.h" - -using namespace KDcrawIface; - -int main(int /*argc*/, char** /*argv*/) -{ - qDebug() << "Libkdcraw version : " << KDcraw::version(), - qDebug() << "Libraw version : " << KDcraw::librawVersion(); - qDebug() << "Use OpenMP : " << KDcraw::librawUseGomp(); - qDebug() << "Use RawSpeed : " << KDcraw::librawUseRawSpeed(); - qDebug() << "Use GPL2 Pack : " << KDcraw::librawUseGPL2DemosaicPack(); - qDebug() << "Use GPL3 Pack : " << KDcraw::librawUseGPL3DemosaicPack(); - qDebug() << "Raw files list : " << KDcraw::rawFilesList(); - qDebug() << "Raw files version : " << KDcraw::rawFilesVersion(); - qDebug() << "Supported camera : " << KDcraw::supportedCamera(); - - return 0; -} diff --git a/kdcraw/tests/raw2png.cpp b/kdcraw/tests/raw2png.cpp deleted file mode 100644 index 502a95bc..00000000 --- a/kdcraw/tests/raw2png.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/** =========================================================== - * - * This file is a part of digiKam project - * http://www.digikam.org - * - * @date 2008-15-09 - * @brief a command line tool to convert RAW file to PNG - * - * @author Copyright (C) 2008-2012 by Gilles Caulier - * caulier dot gilles at gmail dot com - * - * This program 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 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * ============================================================ */ - -// Qt includes - -#include -#include -#include -#include - -// Local includes - -#include "kdcraw.h" -#include "rawdecodingsettings.h" - -using namespace KDcrawIface; - -int main(int argc, char** argv) -{ - if(argc != 2) - { - qDebug() << "raw2png - RAW Camera Image to PNG Converter"; - qDebug() << "Usage: "; - return -1; - } - - QString filePath(argv[1]); - QFileInfo input(filePath); - QString previewFilePath(input.baseName() + QString(".preview.png")); - QFileInfo previewOutput(previewFilePath); - QString halfFilePath(input.baseName() + QString(".half.png")); - QFileInfo halfOutput(halfFilePath); - QString fullFilePath(input.baseName() + QString(".full.png")); - QFileInfo fullOutput(fullFilePath); - QImage image; - DcrawInfoContainer identify; - - // ----------------------------------------------------------- - - qDebug() << "raw2png: Identify RAW image from " << input.fileName(); - - KDcraw rawProcessor; - if (!rawProcessor.rawFileIdentify(identify, filePath)) - { - qDebug() << "raw2png: Idendify RAW image failed. Aborted..."; - return -1; - } - - int width = identify.imageSize.width(); - int height = identify.imageSize.height(); - - qDebug() << "raw2png: Raw image info:"; - qDebug() << "--- Date: " << identify.dateTime.toString(Qt::ISODate); - qDebug() << "--- Make: " << identify.make; - qDebug() << "--- Model: " << identify.model; - qDebug() << "--- Size: " << width << "x" << height; - qDebug() << "--- Filter: " << identify.filterPattern; - qDebug() << "--- Colors: " << identify.rawColors; - - // ----------------------------------------------------------- - - qDebug() << "raw2png: Loading RAW image preview"; - - if (!rawProcessor.loadRawPreview(image, filePath)) - { - qDebug() << "raw2png: Loading RAW image preview failed. Aborted..."; - return -1; - } - - qDebug() << "raw2png: Saving preview image to " - << previewOutput.fileName() << " size (" - << image.width() << "x" << image.height() - << ")"; - image.save(previewFilePath, "PNG"); - - // ----------------------------------------------------------- - - qDebug() << "raw2png: Loading half RAW image"; - - image = QImage(); - if (!rawProcessor.loadHalfPreview(image, filePath)) - { - qDebug() << "raw2png: Loading half RAW image failed. Aborted..."; - return -1; - } - - qDebug() << "raw2png: Saving half image to " - << halfOutput.fileName() << " size (" - << image.width() << "x" << image.height() - << ")"; - image.save(halfFilePath, "PNG"); - - // ----------------------------------------------------------- - - qDebug() << "raw2png: Loading full RAW image"; - - image = QImage(); - RawDecodingSettings settings; - settings.halfSizeColorImage = false; - settings.sixteenBitsImage = false; - settings.RGBInterpolate4Colors = false; - settings.RAWQuality = RawDecodingSettings::BILINEAR; - - if (!rawProcessor.loadFullImage(image, filePath, settings)) - { - qDebug() << "raw2png: Loading full RAW image failed. Aborted..."; - return -1; - } - - qDebug() << "raw2png: Saving full RAW image to " - << fullOutput.fileName() << " size (" - << image.width() << "x" << image.height() - << ")"; - image.save(fullFilePath, "PNG"); - - return 0; -} diff --git a/kdecore/kdebug.areas b/kdecore/kdebug.areas index 92ccbf1e..65adcd8c 100644 --- a/kdecore/kdebug.areas +++ b/kdecore/kdebug.areas @@ -239,9 +239,6 @@ 51000 KIPI (general) 51001 KIPI (loading) -# KDCRAW - KDE C++ wrapper for LibRaw -51002 KDCRAW - # KEXIV2 - KDE C++ wrapper for LibExiv2 51003 KEXIV2 diff --git a/kdecore/tests/kstandarddirstest.cpp b/kdecore/tests/kstandarddirstest.cpp index fc3885e6..2595cc46 100644 --- a/kdecore/tests/kstandarddirstest.cpp +++ b/kdecore/tests/kstandarddirstest.cpp @@ -305,15 +305,15 @@ void KStandarddirsTest::testAddResourceType() QString ret = KStandardDirs::locate( "dtd", "customization/catalog.xml" ); QCOMPARE(ret, QString()); // normal, there's no "dtd" resource in kstandarddirs by default - KGlobal::dirs()->addResourceType("dtd", "data", "libkdcraw/"); - ret = KStandardDirs::locate( "dtd", "profiles/prophoto.icm" ); + KGlobal::dirs()->addResourceType("dtd", "data", "libkexiv2/"); + ret = KStandardDirs::locate( "dtd", "data/topicset.iptc-subjectcode.xml" ); QVERIFY(!ret.isEmpty()); - ret = KStandardDirs::locate("dtd", "profiles/srgb-d65.icm"); + ret = KStandardDirs::locate("dtd", "data/topicset.iptc-subjectcode.xml"); QVERIFY(!ret.isEmpty()); - const QStringList files = KGlobal::dirs()->findAllResources("dtd", "profiles/*", KStandardDirs::NoDuplicates); - QVERIFY(files.count() > 3); + const QStringList files = KGlobal::dirs()->findAllResources("dtd", "data/*", KStandardDirs::NoDuplicates); + QVERIFY(files.count() >= 1); KGlobal::dirs()->addResourceType("xdgdata-ontology", 0, "ontology"); const QStringList ontologyDirs = KGlobal::dirs()->resourceDirs("xdgdata-ontology"); From f149d0bcf842a6b03b02192272a691a8c38e8515 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sat, 31 Jul 2021 23:46:43 +0300 Subject: [PATCH 3/3] kimgio: replace free() with WebPFree() Signed-off-by: Ivailo Monev --- kimgio/webp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kimgio/webp.cpp b/kimgio/webp.cpp index f44d4120..a15916a8 100644 --- a/kimgio/webp.cpp +++ b/kimgio/webp.cpp @@ -121,12 +121,12 @@ bool WebPHandler::write(const QImage &image) delete [] imageData; if ( size == 0 ) { - free(output); + WebPFree(output); return false; } device()->write(reinterpret_cast(output), size); - free(output); + WebPFree(output); return true; }