Skip to content

Commit

Permalink
Move noiseprofiles to external JSON file
Browse files Browse the repository at this point in the history
TODO: all the stuff under tools/
  • Loading branch information
houz committed Feb 19, 2015
1 parent 275dd5a commit 91b989c
Show file tree
Hide file tree
Showing 9 changed files with 4,143 additions and 3,025 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ option(USE_GEO "Build geotagging parts" ON)
option(USE_LUA "Build lua scripting support" ON)
option(DONT_USE_INTERNAL_LUA "Never fall back to the intree copy of lua" ON)
option(USE_FLICKR "Enable Flickr support" ON)
option(USE_GLIBJSON "Enable GlibJson support" ON)
option(USE_KWALLET "Build kwallet password storage back-end" ON)
option(USE_LIBSECRET "Build libsecret password storage back-end" ON)
option(USE_GNOME_KEYRING "Build gnome-keyring password storage back-end" ON)
Expand Down
5 changes: 5 additions & 0 deletions data/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ install(FILES ${WATERMARKS} DESTINATION ${SHARE_INSTALL}/darktable/watermarks)
#
install(FILES gdb_commands DESTINATION ${SHARE_INSTALL}/darktable)

#
# Install noiseprofiles
#
install(FILES noiseprofiles.json DESTINATION ${SHARE_INSTALL}/darktable)

#
# Transform darktableconfig.xml into darktablerc
#
Expand Down
3,749 changes: 3,749 additions & 0 deletions data/noiseprofiles.json

Large diffs are not rendered by default.

11 changes: 2 additions & 9 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ FILE(GLOB SOURCE_FILES
"common/interpolation.c"
"common/metadata.c"
"common/mipmap_cache.c"
"common/noiseprofiles.c"
"common/pdf.c"
"common/styles.c"
"common/selection.c"
Expand Down Expand Up @@ -178,7 +179,7 @@ if(USE_WEBP)
else(USE_WEBP)
endif(USE_WEBP)

foreach(lib ${OUR_LIBS} LensFun GIO GThread GModule PangoCairo PThread Rsvg2 LibXml2 Sqlite3 Exiv2 CURL PNG JPEG TIFF LCMS2)
foreach(lib ${OUR_LIBS} LensFun GIO GThread GModule PangoCairo PThread Rsvg2 LibXml2 Sqlite3 Exiv2 CURL PNG JPEG TIFF LCMS2 JsonGlib)
find_package(${lib} REQUIRED)
include_directories(SYSTEM ${${lib}_INCLUDE_DIRS})
list(APPEND LIBS ${${lib}_LIBRARIES})
Expand Down Expand Up @@ -206,14 +207,6 @@ if(USE_FLICKR)
endif(FLICKCURL_FOUND)
endif(USE_FLICKR)

if(USE_GLIBJSON)
find_package(JsonGlib)
if(JsonGlib_FOUND)
include_directories(SYSTEM ${JsonGlib_INCLUDE_DIRS})
list(APPEND LIBS ${JsonGlib_LIBRARIES})
endif(JsonGlib_FOUND)
endif(USE_GLIBJSON)

if(USE_OPENJPEG)
find_package(OpenJPEG)
if(OPENJPEG_FOUND)
Expand Down
3 changes: 3 additions & 0 deletions src/common/darktable.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include "common/image_cache.h"
#include "common/imageio_module.h"
#include "common/mipmap_cache.h"
#include "common/noiseprofiles.h"
#include "common/opencl.h"
#include "common/points.h"
#include "develop/imageop.h"
Expand Down Expand Up @@ -816,6 +817,8 @@ int dt_init(int argc, char *argv[], const int init_gui, lua_State *L)
darktable.points = (dt_points_t *)calloc(1, sizeof(dt_points_t));
dt_points_init(darktable.points, dt_get_num_threads());

darktable.noiseprofile_parser = dt_noiseprofile_init();

// must come before mipmap_cache, because that one will need to access
// image dimensions stored in here:
darktable.image_cache = (dt_image_cache_t *)calloc(1, sizeof(dt_image_cache_t));
Expand Down
2 changes: 2 additions & 0 deletions src/common/darktable.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include <sqlite3.h>
#include <glib/gi18n.h>
#include <glib.h>
#include <json-glib/json-glib.h>
#include <math.h>
#include <sys/types.h>
#include <unistd.h>
Expand Down Expand Up @@ -176,6 +177,7 @@ typedef struct darktable_t
GList *iop;
GList *collection_listeners;
GList *capabilities;
JsonParser *noiseprofile_parser;
struct dt_conf_t *conf;
struct dt_develop_t *develop;
struct dt_lib_t *lib;
Expand Down
Loading

0 comments on commit 91b989c

Please sign in to comment.