home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / FAQSYS18.ZIP / FAQS.DAT / BIFF.INF < prev    next >
Text File  |  1995-10-13  |  3KB  |  76 lines

  1. Here are a few lines about the "BIFF" file format, the format used in
  2. the XITE system. XITE - X-based Image processing Tools and Environment
  3. - is a free system from dept. of informatics, university of Oslo,
  4. Norway.  The format is quite simple, and I see no point in describing
  5. it in detail, but I would like to mention a few features that we are
  6. satisfied with.
  7.  
  8. First of all, the format is only 3D (unfortunately, it should be
  9. N-dim.).  It defines an image to be a sequence of 2D bands. Every band
  10. may have its own size and pixel type, which even allows the pyramide
  11. representation to be used. There are also separate parameters for
  12. positioning and magnification of each band. Any amount of ascii text
  13. may also be stored on the same file.  The whole structure is read from
  14. file in one call, and represented in one data structure, something
  15. like (in C):
  16.  
  17.   IMAGE i;
  18.   i = read_image(filename);
  19.  
  20. Then the image i may be asked for number of bands:
  21.  
  22.   fprintf("Number of bands: %d\n", nbands(i));
  23.  
  24. It may also be indexed:
  25.  
  26.   fprintf("Pixel value: %d\n", i[band][y][x]);
  27.  
  28. The bands may be handled separately:
  29.  
  30.   BAND b;
  31.   b = i[1];  /* pointer to first band */
  32.   fprintf("Size of band: %d x %d\n", xsize(b), ysize(b));
  33.   fprintf("Pixel value: %d\n", b[y][x]);
  34.  
  35. The data structures represent pixel values as well as corresponding
  36. information, thus only one parameter must be transferred to functions.
  37.  
  38. The format defines a number of pixel types, but most functions are
  39. only implemented for the byte pixel type. The function can test the
  40. arriving band to see if it has correct pixel type, something like:
  41.  
  42.   if (pixeltype(b) != unsigned_byte) ...
  43.  
  44. A final feature is the sub-band mechanism. A sub-band is a _pointer_
  45. to a rectangular subset of a band. When transferred to a function, the
  46. function does not have to distingwish between "normal" bands, and
  47. sub-bands. To negate some rectangular part of a band b1:
  48.  
  49.   BAND b2;
  50.   b2 = sub-band(b1, x1, x2, y1, y2); /* define the rectangular subset of b1 */
  51.   negate(b2, b2);   /* two parameters because in general different  
  52.                        input and output are used, in this case
  53.                        identical parameters are allowed.
  54.                        If b1 is now displayed, we see that the subset
  55.                        is negated. */ 
  56.  
  57.  
  58.  
  59. To conclude: the file format allows some important flexibility
  60. (different size and pixel type in each band), and it is very easy to
  61. write programs using the format, as a "memory-format" is, defined and
  62. the neccessary functions are written.
  63.  
  64. I will be glad to answer any questions.
  65.  
  66. Sincerely,
  67. Tor Lonnestad
  68. Dept. of Informatics
  69. University of Oslo
  70. Norway
  71. e-mail: tor@ifi.uio.no
  72.  
  73.  
  74.  
  75.  
  76.