From 3a51bcd00a73e16b1fcda74955f9dc748b9ff650 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Fri, 9 Nov 2018 14:45:38 +0100 Subject: [PATCH] Use linearization table for Blackmagic DNG files, #4285 --- rtengine/dcraw.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index cdd80e306..31efe41da 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -1131,8 +1131,10 @@ void CLASS ljpeg_idct (struct jhead *jh) void CLASS lossless_dnglj92_load_raw() { BENCHFUN + tiff_bps = 16; + uint16_t *lincurve = !strncmp(make,"Blackmagic",10) ? curve : nullptr; tile_width = tile_length < INT_MAX ? tile_width : raw_width; size_t tileCount = raw_width / tile_width; @@ -1161,7 +1163,7 @@ void CLASS lossless_dnglj92_load_raw() lj92_open(&lj, &data[dataOffset[t]], data_length, &newwidth, &newheight, &newbps); uint16_t *target = (uint16_t*)malloc(newwidth * newheight * 2 * sizeof *target); - lj92_decode(lj, target, tile_width, 0, NULL, 0); + lj92_decode(lj, target, tile_width, 0, lincurve, 0x1000); for (int y = 0; y < height; ++y) { for(int x = 0; x < tile_width; ++x) { RAW(y, x + tcol) = target[y * tile_width + x];