From: Udi F. <udi...@us...> - 2006-07-31 23:20:00
|
Update of /cvsroot/ufraw/ufraw In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv12483 Modified Files: Tag: dcraw-original-branch dcraw.cc Log Message: dcraw original 8.28 (1.338). Index: dcraw.cc =================================================================== RCS file: /cvsroot/ufraw/ufraw/dcraw.cc,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** dcraw.cc 30 Jul 2006 16:47:39 -0000 1.1.2.1 --- dcraw.cc 31 Jul 2006 23:19:55 -0000 1.1.2.2 *************** *** 24,28 **** */ ! #define VERSION "8.26" #define _GNU_SOURCE --- 24,28 ---- */ ! #define VERSION "8.28" #define _GNU_SOURCE *************** *** 6576,6608 **** int CLASS flip_index (int row, int col) { ! if (flip & 1) col = width - 1 - col; ! if (flip & 2) row = height - 1 - row; ! return (flip & 4) ? col * height + row ! : row * width + col; ! } ! ! void CLASS flip_image() ! { ! int row, col, soff=0, doff, rstep, cstep; ! INT64 *src, *dest; ! ! if (verbose) ! fprintf (stderr, "Flipping image %c:%c:%c...\n", ! flip & 1 ? 'H':'0', flip & 2 ? 'V':'0', flip & 4 ? 'T':'0'); ! src = (INT64 *) image; ! dest = (INT64 *) calloc (height * width, sizeof *dest); ! merror (dest, "flip_image()"); ! doff = flip_index (0, 0); ! cstep = flip_index (0, 1) - doff; ! rstep = flip_index (1, 0) - flip_index (0, width); ! for (row=0; row < height; row++, doff += rstep) ! for (col=0; col < width; col++, doff += cstep) ! dest[doff] = src[soff++]; ! image = (ushort (*)[4]) dest; ! free (src); ! if (flip & 4) { ! SWAP (height, width); ! SWAP (ymag, xmag); ! } } --- 6576,6583 ---- int CLASS flip_index (int row, int col) { ! if (flip & 4) SWAP(row,col); ! if (flip & 2) row = iheight - 1 - row; ! if (flip & 1) col = iwidth - 1 - col; ! return row * iwidth + col; } *************** *** 6675,6680 **** uchar *ppm, lut[0x10000]; ushort *ppm2; ! int i, c, row, col, psize=0; ppm = (uchar *) calloc (width, colors*xmag*output_bps/8); ppm2 = (ushort *) ppm; --- 6650,6661 ---- uchar *ppm, lut[0x10000]; ushort *ppm2; ! int i, c, row, col, psize=0, soff, rstep, cstep; + iheight = height; + iwidth = width; + if (flip & 4) { + SWAP(height,width); + SWAP(ymag,xmag); + } ppm = (uchar *) calloc (width, colors*xmag*output_bps/8); ppm2 = (ushort *) ppm; *************** *** 6733,6742 **** if (output_bps == 8) gamma_lut (lut); ! for (row=0; row < height; row++) { ! for (col=0; col < width; col++) FORCC for (i=0; i < xmag; i++) if (output_bps == 8) ! ppm [(col*xmag+i)*colors+c] = lut[image[row*width+col][c]]; ! else ppm2[(col*xmag+i)*colors+c] = image[row*width+col][c]; if (output_bps == 16 && !output_tiff && th.order == 0x4949) swab (ppm2, ppm2, xmag*width*colors*2); --- 6714,6726 ---- if (output_bps == 8) gamma_lut (lut); ! soff = flip_index (0, 0); ! cstep = flip_index (0, 1) - soff; ! rstep = flip_index (1, 0) - flip_index (0, width); ! for (row=0; row < height; row++, soff += rstep) { ! for (col=0; col < width; col++, soff += cstep) FORCC for (i=0; i < xmag; i++) if (output_bps == 8) ! ppm [(col*xmag+i)*colors+c] = lut[image[soff][c]]; ! else ppm2[(col*xmag+i)*colors+c] = image[soff][c]; if (output_bps == 16 && !output_tiff && th.order == 0x4949) swab (ppm2, ppm2, xmag*width*colors*2); *************** *** 6958,6962 **** iwidth *= xmag; if (flip & 4) ! SWAP (iheight, iwidth); printf ("Image size: %4d x %d\n", width, height); printf ("Output size: %4d x %d\n", iwidth, iheight); --- 6942,6946 ---- iwidth *= xmag; if (flip & 4) ! SWAP(iheight,iwidth); printf ("Image size: %4d x %d\n", width, height); printf ("Output size: %4d x %d\n", iwidth, iheight); *************** *** 7017,7021 **** #endif convert_to_rgb(); - if (flip) flip_image(); thumbnail: if (write_fun == &CLASS jpeg_thumb) --- 7001,7004 ---- |