209 lines
5.5 KiB
Diff
209 lines
5.5 KiB
Diff
0a1,10
|
|
> /*RT*/#include <glib.h>
|
|
> /*RT*/#include <glib/gstdio.h>
|
|
> /*RT*/#undef MAX
|
|
> /*RT*/#undef MIN
|
|
> /*RT*/#undef ABS
|
|
> /*RT*/#define NO_LCMS
|
|
> /*RT*/#define NO_JPEG
|
|
> /*RT*/#define LOCALTIME
|
|
> /*RT*/#define DJGPP
|
|
>
|
|
98a109
|
|
> #include "dcraw.h"
|
|
103c114
|
|
< */
|
|
---
|
|
>
|
|
131,132c142,143
|
|
< float cam_mul[4], pre_mul[4], cmatrix[3][4], rgb_cam[3][4];
|
|
< const double xyz_rgb[3][3] = { /* XYZ from RGB */
|
|
---
|
|
> float cam_mul[4], pre_mul[4], cmatrix[3][4], rgb_cam[3][4];*/
|
|
> const double xyz_rgb[3][3] = { // XYZ from RGB
|
|
137c148
|
|
< int histogram[4][0x2000];
|
|
---
|
|
> /*int histogram[4][0x2000];
|
|
155,156c166,167
|
|
<
|
|
< #define CLASS
|
|
---
|
|
> */
|
|
> #define CLASS DCraw::
|
|
273a285
|
|
> /*RT*/ longjmp (failure, 1);
|
|
347c359
|
|
< swab (pixel, pixel, count*2);
|
|
---
|
|
> swab ((char*)pixel, (char*)pixel, count*2);
|
|
539c551
|
|
< unsigned CLASS getbithuff (int nbits, ushort *huff)
|
|
---
|
|
> unsigned CLASS getbithuff_t::operator() (int nbits, ushort *huff)
|
|
541,542c553,554
|
|
< static unsigned bitbuf=0;
|
|
< static int vbits=0, reset=0;
|
|
---
|
|
> /*RT static unsigned bitbuf=0; */
|
|
> /*RT static int vbits=0, reset=0; */
|
|
1255c1267
|
|
< fseek (ifp, -sizeof tail, SEEK_END);
|
|
---
|
|
> fseek (ifp, -(int)sizeof tail, SEEK_END);
|
|
1291c1303
|
|
< void CLASS jpeg_thumb();
|
|
---
|
|
> /*RT void CLASS jpeg_thumb(); */
|
|
1567c1579
|
|
< unsigned CLASS ph1_bithuff (int nbits, ushort *huff)
|
|
---
|
|
> unsigned CLASS ph1_bithuff_t::operator() (int nbits, ushort *huff)
|
|
1569,1570c1581,1582
|
|
< static UINT64 bitbuf=0;
|
|
< static int vbits=0;
|
|
---
|
|
> /*RT static UINT64 bitbuf=0; */
|
|
> /*RT static int vbits=0; */
|
|
1696c1708
|
|
< void CLASS unpacked_load_raw();
|
|
---
|
|
> /*RT void CLASS unpacked_load_raw(); */
|
|
1837c1849
|
|
< unsigned CLASS pana_bits (int nbits)
|
|
---
|
|
> unsigned CLASS pana_bits_t::operator() (int nbits)
|
|
1839,1840c1851,1852
|
|
< static uchar buf[0x4000];
|
|
< static int vbits;
|
|
---
|
|
> /*RT static uchar buf[0x4000]; */
|
|
> /*RT static int vbits;*/
|
|
2129c2141
|
|
< static uchar jpeg_buffer[4096];
|
|
---
|
|
> /*RT static uchar jpeg_buffer[4096]; */
|
|
2133c2145
|
|
< swab (jpeg_buffer, jpeg_buffer, nbytes);
|
|
---
|
|
> swab ((char*)jpeg_buffer, (char*)jpeg_buffer, nbytes);
|
|
2405c2417
|
|
< void CLASS sony_decrypt (unsigned *data, int len, int start, int key)
|
|
---
|
|
> void CLASS sony_decrypt_t::operator()(unsigned *data, int len, int start, int key)
|
|
2407c2419
|
|
< static unsigned pad[128], p;
|
|
---
|
|
> /*RT static unsigned pad[128], p;*/
|
|
2654c2666
|
|
< static unsigned huff[1024];
|
|
---
|
|
> /*RT static unsigned huff[1024];*/
|
|
4338c4350
|
|
< int CLASS parse_tiff_ifd (int base);
|
|
---
|
|
> /*RT int CLASS parse_tiff_ifd (int base);*/
|
|
4466,4471c4478,4483
|
|
< if (tag == 0xd && type == 7 && get2() == 0xaaaa) {
|
|
< fread (buf97, 1, sizeof buf97, ifp);
|
|
< i = (uchar *) memmem (buf97, sizeof buf97,"\xbb\xbb",2) - buf97 + 10;
|
|
< if (i < 70 && buf97[i] < 3)
|
|
< flip = "065"[buf97[i]]-'0';
|
|
< }
|
|
---
|
|
> // if (tag == 0xd && type == 7 && get2() == 0xaaaa) {
|
|
> // fread (buf97, 1, sizeof buf97, ifp);
|
|
> // i = (uchar *) memmem ((char*) buf97, sizeof buf97,"\xbb\xbb",2) - buf97 + 10;
|
|
> // if (i < 70 && buf97[i] < 3)
|
|
> // flip = "065"[buf97[i]]-'0';
|
|
> // }
|
|
4854,4855c4866,4867
|
|
< void CLASS parse_minolta (int base);
|
|
< int CLASS parse_tiff (int base);
|
|
---
|
|
> /*RT void CLASS parse_minolta (int base); */
|
|
> /*RT int CLASS parse_tiff (int base);*/
|
|
4869c4881
|
|
< FILE *sfp;
|
|
---
|
|
> /*RT*/ IMFILE *sfp;
|
|
4885a4898,4900
|
|
> case 14: case 15: case 16:
|
|
> maximum = get2();
|
|
> break;
|
|
5289,5291c5304,5307
|
|
< if ((ifp = tmpfile())) {
|
|
< fwrite (buf, sony_length, 1, ifp);
|
|
< fseek (ifp, 0, SEEK_SET);
|
|
---
|
|
> /*RT*/ ifp = fopen (buf, sony_length);
|
|
> // if ((ifp = tmpfile())) {
|
|
> // fwrite (buf, sony_length, 1, ifp);
|
|
> // fseek (ifp, 0, SEEK_SET);
|
|
5293,5294c5309,5310
|
|
< fclose (ifp);
|
|
< }
|
|
---
|
|
> // fclose (ifp);
|
|
> // }
|
|
5318a5335,5336
|
|
> /*RT*/ if (exif_base == -1) exif_base = base;
|
|
>
|
|
5493c5511
|
|
< FILE *save=ifp;
|
|
---
|
|
> /*RT*/ IMFILE *save=ifp;
|
|
5521c5539,5540
|
|
< if ((ifp = fopen (jname, "rb"))) {
|
|
---
|
|
> /*RT*/ if ((ifp = fopen (jname))) {
|
|
> // if ((ifp = fopen (jname, "rb"))) {
|
|
5860c5879,5883
|
|
< parse_ciff (save+hlen, len-hlen);
|
|
---
|
|
> /*RT*/ {
|
|
> /*RT*/ ciff_base = save+hlen;
|
|
> /*RT*/ ciff_len = len-hlen;
|
|
> parse_ciff (save+hlen, len-hlen);
|
|
> /*RT*/ }
|
|
6668,6671c6691,6694
|
|
< { "SONY NEX-3", 138, 0, /* DJC */
|
|
< { 6907,-1256,-645,-4940,12621,2320,-1710,2581,6230 } },
|
|
< { "SONY NEX-5", 116, 0, /* DJC */
|
|
< { 6807,-1350,-342,-4216,11649,2567,-1089,2001,6420 } },
|
|
---
|
|
> // { "SONY NEX-3", 138, 0, /* DJC */
|
|
> // { 6907,-1256,-645,-4940,12621,2320,-1710,2581,6230 } },
|
|
> // { "SONY NEX-5", 116, 0, /* DJC */
|
|
> // { 6807,-1350,-342,-4216,11649,2567,-1089,2001,6420 } },
|
|
6918a6942,6947
|
|
>
|
|
> /*RT*/ if (fsize<100000) {
|
|
> is_raw = 0;
|
|
> return;
|
|
> }
|
|
>
|
|
6925a6955,6956
|
|
> /*RT*/ ciff_base = hlen;
|
|
> /*RT*/ ciff_len = fsize - hlen;
|
|
6968a7000
|
|
> /*RT*/ exif_base = thumb_offset+12;
|
|
7051c7083
|
|
< { width = 4309; filters = 0x16161616; }
|
|
---
|
|
> /*RT*/ { width = 4308; filters = 0x16161616; }
|
|
8650c8682
|
|
< swab (ppm2, ppm2, width*colors*2);
|
|
---
|
|
> swab ((char*)ppm2, (char*)ppm2, width*colors*2);
|
|
8656c8688
|
|
< int CLASS main (int argc, const char **argv)
|
|
---
|
|
> /*int CLASS main (int argc, const char **argv)
|
|
8769c8801
|
|
< case 'h': half_size = 1; /* "-h" implies "-f" */
|
|
---
|
|
> case 'h': half_size = 1; // "-h" implies "-f"
|
|
9031a9064
|
|
> */
|