From 0b5a6ec430c73160e6c9886f64176f059ee57ca7 Mon Sep 17 00:00:00 2001 From: cgilles Date: Sun, 15 Mar 2009 13:05:34 +0000 Subject: [PATCH] update internal LibRaw to official 0.7.0 release... git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/KDE/kdegraphics@939632 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- libs/libkdcraw/NEWS | 12 +++++++--- libs/libkdcraw/libraw/internal/dcraw_common.cpp | 31 +++++++++++++++++-------- libs/libkdcraw/libraw/internal/dcraw_fileio.cpp | 10 ++++---- libs/libkdcraw/libraw/internal/defines.h | 2 +- libs/libkdcraw/libraw/internal/foveon.cpp | 12 +++++----- libs/libkdcraw/libraw/libraw/libraw_version.h | 4 ++-- libs/libkdcraw/libraw/samples/4channels.cpp | 1 + libs/libkdcraw/libraw/src/libraw_cxx.cpp | 2 +- 8 files changed, 46 insertions(+), 28 deletions(-) diff --git a/libs/libkdcraw/NEWS b/libs/libkdcraw/NEWS index 42d20d21..1cbcf552 100644 --- a/libs/libkdcraw/NEWS +++ b/libs/libkdcraw/NEWS @@ -1,8 +1,14 @@ 0.5.0 - Released with KDE 4.3.0 ------------------------------------------------------------------------ -- Updated to LibRaw 0.7.0-beta5. - See http://www.libraw.org/download#changelog-beta for details. - +- Updated to LibRaw 0.7.0 : Black (masked) pixels data extracted from RAW and avaliable in application. + Application can turn off RAW data filtering (black level subtraction, + zero pixels removal and raw tone curve). + New 'input framewrok' released. Reading raw data from file and memory buffer supported from scratch. + LibRaw-using application can implement own data reading functions (e.g. reading from network stream). + Fuji SuperCCD: raw data extracted without 45-degree rotation. + New sample applications: 4channels and unprocessed_raw + Imported (subsequentally) new dcraw versions from 8.89 to 8.93 (up to date) + 0.4.0 - Released with KDE 4.2.0 ------------------------------------------------------------------------ - Updated to LibRaw 0.6.5 : Fixed file descriptor and buffer memory leak when thumbnail extractor is called, diff --git a/libs/libkdcraw/libraw/internal/dcraw_common.cpp b/libs/libkdcraw/libraw/internal/dcraw_common.cpp index 41bf4f84..9c5f1983 100644 --- a/libs/libkdcraw/libraw/internal/dcraw_common.cpp +++ b/libs/libkdcraw/libraw/internal/dcraw_common.cpp @@ -1,6 +1,6 @@ /* GENERATED FILE, DO NOT EDIT - Generated from dcraw/dcraw.c at Fri Mar 13 22:27:06 2009 + Generated from dcraw/dcraw.c at Sun Mar 15 13:33:55 2009 Look into original file (probably http://cybercom.net/~dcoffin/dcraw/dcraw.c) for copyright information. */ @@ -1233,6 +1233,7 @@ void CLASS fuji_load_raw() free (pixel); #else int row,col; + int wide, r, c; pixel = (ushort *) calloc (raw_width, sizeof *pixel); merror (pixel, "fuji_load_raw()"); for (row=0; row < raw_height; row++) { @@ -1241,7 +1242,17 @@ void CLASS fuji_load_raw() if(col >= left_margin && col < width+left_margin && row >= top_margin && row < height+top_margin) { - BAYER(row-top_margin,col-left_margin) = pixel[col]; + int rrow = row-top_margin; + int ccol = col-left_margin; + if (fuji_layout) { + r = fuji_width - 1 - ccol + (rrow >> 1); + c = ccol + ((rrow+1) >> 1); + } else { + r = fuji_width - 1 + rrow - (ccol >> 1); + c = rrow + ((ccol+1) >> 1); + } + + image[((row-top_margin) >> shrink)*iwidth + ((col-left_margin) >> shrink)][FC(r,c)] = pixel[col]; } else { @@ -1253,7 +1264,7 @@ void CLASS fuji_load_raw() free (pixel); #endif } -#line 1545 "dcraw/dcraw.c" +#line 1556 "dcraw/dcraw.c" void CLASS ppm_thumb (FILE *tfp) { char *thumb; @@ -1751,7 +1762,7 @@ void CLASS leaf_hdr_load_raw() } } -#line 2046 "dcraw/dcraw.c" +#line 2057 "dcraw/dcraw.c" void CLASS sinar_4shot_load_raw() { ushort *pixel; @@ -2979,7 +2990,7 @@ void CLASS smal_v9_load_raw() smal_decode_segment (seg+i, holes); if (holes) fill_holes (holes); } -#line 4147 "dcraw/dcraw.c" +#line 4158 "dcraw/dcraw.c" void CLASS pseudoinverse (double (*in)[3], double (*out)[3], int size) { @@ -4247,7 +4258,7 @@ void CLASS parse_thumb_note (int base, unsigned toff, unsigned tlen) } } -#line 5418 "dcraw/dcraw.c" +#line 5429 "dcraw/dcraw.c" void CLASS parse_makernote (int base, int uptag) { static const uchar xlat[2][256] = { @@ -4779,7 +4790,7 @@ void CLASS parse_kodak_ifd (int base) } } -#line 5953 "dcraw/dcraw.c" +#line 5964 "dcraw/dcraw.c" int CLASS parse_tiff_ifd (int base) { unsigned entries, tag, type, len, plen=16, save; @@ -5941,7 +5952,7 @@ void CLASS parse_cine() data_offset = (INT64) get4() + 8; data_offset += (INT64) get4() << 32; } -#line 7218 "dcraw/dcraw.c" +#line 7229 "dcraw/dcraw.c" #ifdef LIBRAW_LIBRARY_BUILD void CLASS adobe_coeff (const char *p_make, const char *p_model) #else @@ -7844,7 +7855,7 @@ notraw: RUN_CALLBACK(LIBRAW_PROGRESS_IDENTIFY,1,2); #endif } -#line 9212 "dcraw/dcraw.c" +#line 9223 "dcraw/dcraw.c" void CLASS convert_to_rgb() { int row, col, c, i, j, k; @@ -8100,7 +8111,7 @@ void CLASS gamma_lut (ushort lut[0x10000]) } -#line 9492 "dcraw/dcraw.c" +#line 9503 "dcraw/dcraw.c" void CLASS tiff_set (ushort *ntag, ushort tag, ushort type, int count, int val) { diff --git a/libs/libkdcraw/libraw/internal/dcraw_fileio.cpp b/libs/libkdcraw/libraw/internal/dcraw_fileio.cpp index df88597d..b2d26d61 100644 --- a/libs/libkdcraw/libraw/internal/dcraw_fileio.cpp +++ b/libs/libkdcraw/libraw/internal/dcraw_fileio.cpp @@ -1,18 +1,18 @@ /* GENERATED FILE, DO NOT EDIT - Generated from dcraw/dcraw.c at Fri Mar 13 22:27:08 2009 + Generated from dcraw/dcraw.c at Sun Mar 15 13:33:57 2009 Look into original file (probably http://cybercom.net/~dcoffin/dcraw/dcraw.c) for copyright information. */ -#line 3996 "dcraw/dcraw.c" +#line 4007 "dcraw/dcraw.c" #define CLASS LibRaw:: #include "libraw/libraw_types.h" #define LIBRAW_LIBRARY_BUILD #include "libraw/libraw.h" #include "internal/defines.h" #include "internal/var_defines.h" -#line 4006 "dcraw/dcraw.c" +#line 4017 "dcraw/dcraw.c" /* Seach from the current directory up to the root looking for @@ -30,7 +30,7 @@ void CLASS bad_pixels (char *fname) #endif if (fname) fp = fopen (fname, "r"); -#line 4049 "dcraw/dcraw.c" +#line 4060 "dcraw/dcraw.c" if (!fp) { #ifdef LIBRAW_LIBRARY_BUILD @@ -126,7 +126,7 @@ void CLASS subtract (char *fname) RUN_CALLBACK(LIBRAW_PROGRESS_DARK_FRAME,1,2); #endif } -#line 9123 "dcraw/dcraw.c" +#line 9134 "dcraw/dcraw.c" #ifndef NO_LCMS void CLASS apply_profile (char *input, char *output) diff --git a/libs/libkdcraw/libraw/internal/defines.h b/libs/libkdcraw/libraw/internal/defines.h index 775ee012..d9cb2aed 100644 --- a/libs/libkdcraw/libraw/internal/defines.h +++ b/libs/libkdcraw/libraw/internal/defines.h @@ -1,6 +1,6 @@ /* GENERATED FILE, DO NOT EDIT - Generated from dcraw/dcraw.c at Fri Mar 13 22:27:06 2009 + Generated from dcraw/dcraw.c at Sun Mar 15 13:33:55 2009 Look into original file (probably http://cybercom.net/~dcoffin/dcraw/dcraw.c) for copyright information. */ diff --git a/libs/libkdcraw/libraw/internal/foveon.cpp b/libs/libkdcraw/libraw/internal/foveon.cpp index 805add78..61a939a5 100644 --- a/libs/libkdcraw/libraw/internal/foveon.cpp +++ b/libs/libkdcraw/libraw/internal/foveon.cpp @@ -1,11 +1,11 @@ /* GENERATED FILE, DO NOT EDIT - Generated from dcraw/dcraw.c at Fri Mar 13 22:27:06 2009 + Generated from dcraw/dcraw.c at Sun Mar 15 13:33:56 2009 Look into original file (probably http://cybercom.net/~dcoffin/dcraw/dcraw.c) for copyright information. */ -#line 3275 "dcraw/dcraw.c" +#line 3286 "dcraw/dcraw.c" #define CLASS LibRaw:: #include "libraw/libraw_types.h" #define LIBRAW_IO_REDEFINED @@ -17,7 +17,7 @@ #define SRC_USES_CURVE #include "internal/var_defines.h" #define sget4(s) sget4((uchar *)s) -#line 3288 "dcraw/dcraw.c" +#line 3299 "dcraw/dcraw.c" /* RESTRICTED code starts here */ @@ -277,12 +277,12 @@ int CLASS foveon_apply_curve (short *curve, int i) return i < 0 ? -curve[1-i] : curve[1+i]; } -#line 3550 "dcraw/dcraw.c" +#line 3561 "dcraw/dcraw.c" #ifdef image #undef image #endif #define image ((short(*)[4]) imgdata.image) -#line 3557 "dcraw/dcraw.c" +#line 3568 "dcraw/dcraw.c" void CLASS foveon_interpolate() { @@ -719,7 +719,7 @@ void CLASS foveon_interpolate() #undef image /* RESTRICTED code ends here */ -#line 7117 "dcraw/dcraw.c" +#line 7128 "dcraw/dcraw.c" char * CLASS foveon_gets (int offset, char *str, int len) { int i; diff --git a/libs/libkdcraw/libraw/libraw/libraw_version.h b/libs/libkdcraw/libraw/libraw/libraw_version.h index df3cf9b6..d973a2b0 100644 --- a/libs/libkdcraw/libraw/libraw/libraw_version.h +++ b/libs/libkdcraw/libraw/libraw/libraw_version.h @@ -1,5 +1,5 @@ /* -*- C++ -*- - * File: version.h + * File: libraw_version.h * Copyright 2008-2009 Alex Tutubalin * Created: Mon Sept 8, 2008 * @@ -27,7 +27,7 @@ #define LIBRAW_MAJOR_VERSION 0 #define LIBRAW_MINOR_VERSION 7 #define LIBRAW_PATCH_VERSION 0 -#define LIBRAW_VERSION_TAIL Beta5 +#define LIBRAW_VERSION_TAIL Release #define _LIBRAW_VERSION_MAKE(a,b,c,d) #a"."#b"."#c"-"#d #define LIBRAW_VERSION_MAKE(a,b,c,d) _LIBRAW_VERSION_MAKE(a,b,c,d) diff --git a/libs/libkdcraw/libraw/samples/4channels.cpp b/libs/libkdcraw/libraw/samples/4channels.cpp index 60f16f92..d266c53c 100644 --- a/libs/libkdcraw/libraw/samples/4channels.cpp +++ b/libs/libkdcraw/libraw/samples/4channels.cpp @@ -148,6 +148,7 @@ int main(int ac, char *av[]) else printf("Black level (unscaled)=%d\n",C.black); + // hack to make dcraw tiff writer happy int isrgb=(P1.colors==4?0:1); P1.colors = 1; diff --git a/libs/libkdcraw/libraw/src/libraw_cxx.cpp b/libs/libkdcraw/libraw/src/libraw_cxx.cpp index 70878e93..5a6e020f 100644 --- a/libs/libkdcraw/libraw/src/libraw_cxx.cpp +++ b/libs/libkdcraw/libraw/src/libraw_cxx.cpp @@ -1400,7 +1400,7 @@ int LibRaw::rotate_fuji_raw(void) c = row + ((col+1) >> 1); } newimage[((r) >> IO.shrink)*fiwidth + ((c) >> IO.shrink)][FC(r,c)] = - imgdata.image[((row) >> IO.shrink)*S.iwidth + ((col) >> IO.shrink)][FC(row,col)]; + imgdata.image[((row) >> IO.shrink)*S.iwidth + ((col) >> IO.shrink)][FC(r,c)]; } } // restore fuji sizes! -- 2.11.4.GIT