home *** CD-ROM | disk | FTP | other *** search
/ Really Useful CD 1 / ReallyUsefulCD1.iso / extras / progutils / _graphics / _help / readme < prev    next >
Encoding:
Text File  |  1991-05-24  |  3.8 KB  |  112 lines

  1. ========================================================
  2.  
  3.   Line draw algorithm, for 8 bpp modes, with clipping.
  4.  
  5.   This application directory contains the sources of a
  6.   very fast line draw algorithm with clipping. It will
  7.   work in any one byte per pixel mode (256 colours).
  8.  
  9.   Feel free to use this code in any program you like,
  10.   but be polite and mention my name when you do so!
  11.  
  12.   Both line draw and clipping algorithm use arithmical
  13.   shifts only, they don't need divides. Line draw code
  14.   is based on Bresenham's simple DDA. Clipping code is
  15.   partly based on Cohen & Sutherland's algorithm.
  16.  
  17.   Random line draw clipping has been optimised to
  18.   detect lines which need no clipping at all and lines
  19.   which are completely outside the screen first. Both
  20.   horizontal and vertical line draw have their own
  21.   clipping algorithm.
  22.  
  23.   If you want a graphical demonstration of how the
  24.   clipping algorithm operates run the 'Clip' program.
  25.   It operates almost exactly as the assembly version
  26.   but you can see it working step by step.
  27.  
  28.   Horizontal line draw was optimised to perform well
  29.   even for lines under 12 pixels (breakeven point).
  30.   It has seperate code to plot short and long lines.
  31.  
  32. --------------------------------------------------------
  33.  
  34.   Typical performance on a standard A310, with average
  35.   line sizes of 128 pixels and all IRQ's enabled:
  36.   
  37.     When no clipping is needed:
  38.  
  39.       Random lines     -  720 KPixels/sec
  40.       Diagonal lines   - 1100 KPixels/sec
  41.  
  42.     When line is clipped first:
  43.  
  44.       Random lines     -  670 KPixels/sec
  45.       Diagonal lines   - 1040 KPixels/sec
  46.       Vertical lines   - 1200 KPixels/sec
  47.       Horizontal lines - 4700 KPixels/sec
  48.       Single points    -   90 KPixels/sec
  49.  
  50.     When line can be rejected:
  51.  
  52.       Random lines     -   12 MPixels/sec
  53.       Diagonal lines   -   12 MPixels/sec
  54.       Vertical lines   -   17 MPixels/sec
  55.       Horizontal lines -   17 MPixels/sec
  56.       Single points    -  200 KPixels/sec
  57.  
  58.   Horizontal lines performance:
  59.  
  60.        1 pixel  -   90 KPixels/sec
  61.        2 pixels -  160 KPixels/sec
  62.        4 pixels -  300 KPixels/sec
  63.        8 pixels -  540 KPixels/sec
  64.       16 pixels -  870 KPixels/sec
  65.       32 pixels - 1600 KPixels/sec
  66.       64 pixels -  2.8 MPixels/sec
  67.      128 pixels -  4.7 MPixels/sec
  68.      256 pixels -  7.0 MPixels/sec
  69.      512 pixels -  9.2 MPixels/sec
  70.     1024 pixels - 10.7 MPixels/sec
  71.  
  72.   Maximum performance in pixels per processor cycle
  73.   and pixels per second for the plotting algorithm,
  74.   rating the ARM at 7 cycles/sec (average cycle time):
  75.  
  76.     Random lines     -    1 pixel(s)/7 cycles
  77.                           1 MPixels/sec
  78.     Diagonal lines   -    1 pixel(s)/4 cycles
  79.                        1750 KPixels/sec
  80.     Vertical lines   -    1 pixel(s)/4 cycles
  81.                        1750 KPixels/sec
  82.     Horizontal lines -   16 pixel(s)/7 cycles
  83.                          16 MPixels/sec
  84.  
  85.   Current efficiency (with clipping):
  86.  
  87.     Random lines     -  71% (at  128 pixels)
  88.     Diagonal lines   -  63% (at  128 pixels)
  89.     Vertical lines   -  69% (at  128 pixels)
  90.     Horizontal lines -  30% (at  128 pixels)
  91.                      -  44% (at  256 pixels)
  92.                      -  58% (at  512 pixels)
  93.                      -  67% (at 1024 pixels)
  94.  
  95. ========================================================
  96.  
  97.   This application is freeware. You may copy it freely
  98.   but only when you copy this application and all it's
  99.   related data files completely without omissions and
  100.   you do not gain any financial profit from doing so.
  101.  
  102.   If you have any comments or suggestions about this
  103.   program, please contact the author as :
  104.  
  105.   Jan-Herman Buining       Acorn BBS :    (020)6631849
  106.   Soendastraat 133          Huco BBS :    (01804)30785
  107.   9715 NP Groningen      La Luna BBS :    (02593)41891
  108.   (050)735228
  109.   The Netherlands              Eunet : jhb@neabbs.UUCP
  110.  
  111. ========================================================
  112.