home *** CD-ROM | disk | FTP | other *** search
/ Internet File Formats / InternetFileFormatsCD.bin / graphics / tiff / unix / archive.z / archive / text0027.txt < prev    next >
Encoding:
Text File  |  1995-09-20  |  2.5 KB  |  66 lines

  1.  
  2. A couple of routines used for working out the size of tiles and strips
  3. don't work for YCbCr if extra samples are present.  The mods are only
  4. trivial, and apologies if it's already been fixed.  I'm currently
  5. using:
  6. VERSION        3.3beta
  7. tiff.alpha    define ALPHA 015
  8.  
  9. The mods are to tif_strip.c and tif_tile.c:
  10.  
  11. diff -c OLD/tif_strip.c NEW/tif_strip.c
  12. *** OLD/tif_strip.c Tue Oct 11 17:37:30 1994
  13. --- NEW/tif_strip.c Fri Dec  9 13:59:51 1994
  14. ***************
  15. *** 98,104 ****
  16.                     td->td_ycbcrsubsampling[0]*td->td_ycbcrsubsampling[1];
  17.                 nrows = roundup(nrows, td->td_ycbcrsubsampling[1]);
  18.                 /* NB: don't need howmany here 'cuz everything is rounded */
  19. !               return (nrows*scanline + 2*(nrows*scanline / samplingarea));
  20.         } else
  21.   #endif
  22.                 return (nrows * TIFFScanlineSize(tif));
  23. --- 98,104 ----
  24.                     td->td_ycbcrsubsampling[0]*td->td_ycbcrsubsampling[1];
  25.                 nrows = roundup(nrows, td->td_ycbcrsubsampling[1]);
  26.                 /* NB: don't need howmany here 'cuz everything is rounded */
  27. !               return (nrows*scanline*(td->td_samplesperpixel-2) + 2*(nrows*scanline / samplingarea));
  28.         } else
  29.   #endif
  30.                 return (nrows * TIFFScanlineSize(tif));
  31.  
  32.  
  33.  
  34.  
  35. diff -c OLD/tif_tile.c NEW/tif_tile.c
  36. *** OLD/tif_tile.c Mon Dec  5 10:46:22 1994
  37. --- NEW/tif_tile.c Fri Dec  9 13:59:53 1994
  38. ***************
  39. *** 175,181 ****
  40.                     td->td_ycbcrsubsampling[0]*td->td_ycbcrsubsampling[1];
  41.                 nrows = roundup(nrows, td->td_ycbcrsubsampling[1]);
  42.                 /* NB: don't need howmany here 'cuz everything is rounded */
  43. !               tilesize = nrows*rowsize + 2*(nrows*rowsize / samplingarea);
  44.         } else
  45.   #endif
  46.                 tilesize = nrows * TIFFTileRowSize(tif);
  47. --- 175,182 ----
  48.                     td->td_ycbcrsubsampling[0]*td->td_ycbcrsubsampling[1];
  49.                 nrows = roundup(nrows, td->td_ycbcrsubsampling[1]);
  50.                 /* NB: don't need howmany here 'cuz everything is rounded */
  51. !               tilesize = nrows*rowsize*(td->td_samplesperpixel-2)
  52. !                               + 2*(nrows*rowsize / samplingarea);
  53.         } else
  54.   #endif
  55.                 tilesize = nrows * TIFFTileRowSize(tif);
  56.  
  57.  
  58.  
  59. - gordon
  60. ---
  61.     Never keep a dog and bark for yourself.            -- harrison
  62. Gordon Clare                                 Net: gordon@research.canon.oz.au
  63. Canon Information Systems Research Australia  Ph: +61 2 805 2738
  64. P.O. Box 313 North Ryde, NSW, Australia 2113 Fax: +61 2 805 2929
  65.  
  66.