SVN commit 489984 by cgilles:
digiKam from trunk : new C++ class to parse RAW file based on dcraw::parse.c implementation. TODO : - add new method to get RAW file orientation. - do a new C++ class based on dcraw decoder implementation ! CCMAIL: [hidden email] M +4 -3 kioslave/Makefile.am M +5 -8 kioslave/digikamthumbnail.cpp M +1 -1 libs/dcraw/Makefile.am A libs/dcraw/dcraw_parse.cpp [License: GPL] A libs/dcraw/dcraw_parse.h [License: GPL] M +2 -1 libs/dimg/Makefile.am M +3 -9 libs/dimg/dimg.cpp M +2 -1 libs/dimg/loaders/Makefile.am M +8 -12 libs/dimg/loaders/rawloader.cpp --- trunk/extragear/graphics/digikam/kioslave/Makefile.am #489983:489984 @@ -1,7 +1,8 @@ INCLUDES = -I$(top_srcdir)/digikam/libs/jpegutils \ - -I$(top_srcdir)/digikam/libs/dimg \ - -I$(top_srcdir)/digikam/digikam \ - $(LIBKEXIF_CFLAGS) $(all_includes) + -I$(top_srcdir)/digikam/libs/dimg \ + -I$(top_srcdir)/digikam/libs/dcraw \ + -I$(top_srcdir)/digikam/digikam \ + $(LIBKEXIF_CFLAGS) $(all_includes) METASOURCES = AUTO KDE_CFLAGS = -w --- trunk/extragear/graphics/digikam/kioslave/digikamthumbnail.cpp #489983:489984 @@ -52,6 +52,7 @@ // Local includes +#include "dcraw_parse.h" #include "dimg.h" #include "exiforientation_p.h" #include "digikamthumbnail.h" @@ -76,11 +77,6 @@ using namespace KIO; -extern "C" -{ -int dcraw_getThumbnail(const char* infile, const char* outfile); -} - static void exifRotate(const QString& filePath, QImage& thumb) { // Rotate thumbnail based on EXIF rotate tag @@ -585,11 +581,12 @@ KTempFile thumbFile(QString::null, "rawthumb"); thumbFile.setAutoDelete(true); - + Digikam::DcrawParse rawFileParser; + if (thumbFile.status() == 0) { - if (dcraw_getThumbnail(QFile::encodeName(path), - QFile::encodeName(thumbFile.name())) == 0) + if (rawFileParser.getThumbnail(QFile::encodeName(path), + QFile::encodeName(thumbFile.name())) == 0) { image.load(thumbFile.name()); if (!image.isNull()) --- trunk/extragear/graphics/digikam/libs/dcraw/Makefile.am #489983:489984 @@ -2,6 +2,6 @@ noinst_LTLIBRARIES = libdcraw.la -libdcraw_la_SOURCES = parse.c +libdcraw_la_SOURCES = dcraw_parse.cpp libdcraw_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) --- trunk/extragear/graphics/digikam/libs/dimg/Makefile.am #489983:489984 @@ -17,7 +17,8 @@ INCLUDES = $(all_includes) -I$(top_srcdir)/digikam/libs/dimg/loaders \ -I$(top_srcdir)/digikam/libs/dimg/filters \ - -I$(top_srcdir)/digikam/digikam + -I$(top_srcdir)/digikam/libs/dcraw \ + -I$(top_srcdir)/digikam/digikam digikaminclude_HEADERS = dimg.h dimgloader.h icctransform.h dcolor.h digikamincludedir = $(includedir)/digikam --- trunk/extragear/graphics/digikam/libs/dimg/dimg.cpp #489983:489984 @@ -37,6 +37,7 @@ // Local includes. +#include "dcraw_parse.h" #include "jpegloader.h" #include "tiffloader.h" #include "pngloader.h" @@ -49,14 +50,6 @@ typedef uint64_t ullong; typedef int64_t llong; - -// From dcraw program (parse.c) to identify RAW files - -extern "C" -{ - int dcraw_getCameraModel(const char* infile, char* cameraConstructor, char* cameraModel); -} - namespace Digikam { @@ -298,6 +291,7 @@ fclose(f); + DcrawParse rawFileParser; unsigned short jpegID = 0xD8FF; unsigned short tiffBigID = 0x4d4d; unsigned short tiffLilID = 0x4949; @@ -328,7 +322,7 @@ } pclose (file); } - else if (dcraw_getCameraModel( QFile::encodeName(filePath), NULL, NULL) == 0) + else if (rawFileParser.getCameraModel( QFile::encodeName(filePath), NULL, NULL) == 0) { // RAW File test using dcraw. // Need to test it before TIFF because any RAW file --- trunk/extragear/graphics/digikam/libs/dimg/loaders/Makefile.am #489983:489984 @@ -9,5 +9,6 @@ $(LIBJPEG) $(LIB_TIFF) INCLUDES = $(all_includes) -I$(top_srcdir)/digikam/libs/dimg \ - -I$(top_srcdir)/digikam/digikam + -I$(top_srcdir)/digikam/libs/dcraw \ + -I$(top_srcdir)/digikam/digikam --- trunk/extragear/graphics/digikam/libs/dimg/loaders/rawloader.cpp #489983:489984 @@ -39,15 +39,9 @@ // Local includes. #include "dimg.h" +#include "dcraw_parse.h" #include "rawloader.h" -// From dcraw program (parse.c) to identify camera model and constructor - -extern "C" -{ - int dcraw_getCameraModel(const char* infile, char* cameraConstructor, char* cameraModel); -} - namespace Digikam { @@ -124,9 +118,10 @@ //---------------------------------------------------------- - char model[256], constructor[256]; - - if ( dcraw_getCameraModel(QFile::encodeName(filePath), &constructor[0], &model[0]) == 0 ) + char model[256], constructor[256]; + DcrawParse rawFileParser; + + if ( rawFileParser.getCameraModel(QFile::encodeName(filePath), &constructor[0], &model[0]) == 0 ) { imageSetCameraModel(QString::QString(model)); imageSetCameraConstructor(QString::QString(constructor)); @@ -204,8 +199,9 @@ //---------------------------------------------------------- char model[256], constructor[256]; - - if ( dcraw_getCameraModel(QFile::encodeName(filePath), constructor, model) == 0 ) + DcrawParse rawFileParser; + + if ( rawFileParser.getCameraModel(QFile::encodeName(filePath), constructor, model) == 0 ) { imageSetCameraModel(QString::QString(model)); imageSetCameraConstructor(QString::QString(constructor)); _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
Free forum by Nabble | Edit this page |