From 1b98fe4d18d6df9bbb1e495595446332b86c61b0 Mon Sep 17 00:00:00 2001 From: torger Date: Wed, 16 Oct 2013 21:20:09 +0200 Subject: [PATCH] Issue 2008: fixed camconst.json parse bug; added iso-dependent white levels for Canon EOS 5D Mark II --- rtengine/camconst.cc | 2 +- rtengine/camconst.json | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/rtengine/camconst.cc b/rtengine/camconst.cc index c5e5d2f80..65b69dd4e 100644 --- a/rtengine/camconst.cc +++ b/rtengine/camconst.cc @@ -58,7 +58,7 @@ CameraConst::parseLevels(CameraConst *cc, int bw, void *ji_) } struct camera_const_levels lvl; if (js->type == cJSON_Number) { - lvl.levels[0] = lvl.levels[1] = lvl.levels[2] = lvl.levels[3] = ji->valueint; + lvl.levels[0] = lvl.levels[1] = lvl.levels[2] = lvl.levels[3] = js->valueint; } else if (js->type == cJSON_Array) { int i; for (js = js->child, i = 0; js != NULL && i < 4; js = js->next, i++) { diff --git a/rtengine/camconst.json b/rtengine/camconst.json index c685c0272..92f25884a 100644 --- a/rtengine/camconst.json +++ b/rtengine/camconst.json @@ -86,6 +86,39 @@ Examples: */ {"camera_constants": [ + { + "make_model": "Canon EOS 5D Mark II", + "dcraw_matrix": [ 4716,603,-830,-7798,15474,2480,-1496,1937,6651 ], + "ranges": { + // black levels are read from raw masked pixels + // white levels are same for all colors, but vary on ISO + "white": [ + { "iso": 50, "levels": 15760 }, + { "iso": 100, "levels": 15760 }, + { "iso": 125, "levels": 15760 }, + { "iso": 160, "levels": 12810 }, + { "iso": 200, "levels": 15760 }, + { "iso": 250, "levels": 15760 }, + { "iso": 320, "levels": 12810 }, + { "iso": 400, "levels": 15760 }, + { "iso": 500, "levels": 15760 }, + { "iso": 640, "levels": 12810 }, + { "iso": 800, "levels": 15760 }, + { "iso": 1000, "levels": 15760 }, + { "iso": 1250, "levels": 12810 }, + { "iso": 1600, "levels": 15760 }, + { "iso": 2000, "levels": 15760 }, + { "iso": 2500, "levels": 15760 }, + { "iso": 3200, "levels": 15760 }, + { "iso": 4000, "levels": 15760 }, + { "iso": 5000, "levels": 15760 }, + { "iso": 6400, "levels": 16383 }, + { "iso": 12800, "levels": 16383 }, + { "iso": 25600, "levels": 16383 } + ] + } + }, + // Phase One: color matrices borrowed from Adobe DNG Converter, black/white levels tested on actual raw files { "make_model": "Phase One P40+",