home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / XDUMP.ZIP / DUMPS.DOC next >
Encoding:
Text File  |  1988-07-28  |  13.0 KB  |  274 lines

  1.                   Some notes about screen dumps
  2.  
  3.                Written by Michael Day 25 July 1988
  4.  
  5.  
  6.  
  7.      First, display screens are less accurate than printers.  The 
  8. sizes  can  vary even when the screen is specified  as  the  same 
  9. size. Further, the adjustments of the screen can affect size  and 
  10. aspect ratio.
  11.  
  12.      A  standard 12 inch monitor will provide a display  area  of 
  13. around 20cm by 15cm (or 8" by 6"). This provides an aspect  ratio 
  14. of 4:3. In order for the printout to look the same as the screen, 
  15. it is important that the aspect ratio on the printer be the  same 
  16. as the screen. 
  17.  
  18.      Although  the  overall screen aspect  ratio  normally  stays 
  19. around  4:3, the pixel aspect ratio can change depending  on  the 
  20. mode  selected.  As  an example, consider a  CGA  color  graphics 
  21. screen  which displays 320x200 pixels. This means that there  are 
  22. 40  pixels  per  inch horizontally, and  33.33  pixels  per  inch 
  23. vertically.  This  gives  the pixels an aspect  ratio  of  2.5:3. 
  24. Meaning that if we were to magnify a single pixel large enough it 
  25. would be 2.5 inches wide by 3 inches tall.
  26.  
  27.      When we switch the screen to the monochrome graphics mode we 
  28. get  640x200  pixels  on the screen. This means  that  the  pixel 
  29. aspect  ratio is now 1.25:3. The pixel has shrunk in half in  the 
  30. horizontal  direction,  but  remained the same  in  the  vertical 
  31. direction. 
  32.  
  33.      The pixel aspect ratio is also affected when other modes  or 
  34. displays  are used, such as 640x350 for EGA, 640x480 for VGA,  or 
  35. 720x348 for Hercules.
  36.  
  37. Note:  When we say that the pixel aspect ratio is 2.5:3, that  is 
  38. describing the area allocated on the screen to the pixel, and not 
  39. the actual spot size of the electron beam. Case in point, on  the 
  40. CGA display, the pixel definition is crowded so close together in 
  41. the horizontal direction that on most displays the dots  overlap, 
  42. but  in  the  vertical direction the spot size is  too  small  to 
  43. completely fill in the area between the dots. On the VGA  display 
  44. this is corrected by double scanning (scanning two display  lines 
  45. for  every CGA line). This effectively doubles the spot  size  in 
  46. the vertical direction to fill in the gaps between the CGA lines. 
  47.  
  48.  
  49.      The  spot  size  on  a display is  usually  referred  to  as 
  50. "pitch", and the allocated display area is usually referred to as 
  51. a "pixel". The pitch size is a function of the monitor. The pixel 
  52. size is a function of the display card.
  53.  
  54.  
  55.  
  56. The printer:
  57.  
  58.      On  the  printer  we have similar  problems.  The  printer's 
  59. aspect  ratio  is usually not the same as  the  display's  aspect 
  60. ratio, so some correction must be done if proper aspect ratio  is 
  61. to  be  maintained. Without proper aspect ratio, circles  on  the 
  62. display will come out as ovals on the printer.
  63.  
  64.      The  Epson  printer  is  the most  common  printer  used  in 
  65. conjunction  with the PC. This is because it is the printer  that 
  66. IBM  selected  to provide with their computer. 
  67.  
  68.      In it's "normal" graphics mode the Epson printer will  print 
  69. 60  dots per inch horizontally, and 72 dots per inch  vertically. 
  70. The resolution of 72 dots per inch vertically was chosen  because 
  71. character size is measured in "points" and a point is defined  as 
  72. being  1/72  inch. 
  73.  
  74.      The  position of the wires in the print head  determine  the 
  75. vertical resolution, and since they are fixed at 1/72 inch apart, 
  76. the vertical resolution is fixed at 1/72 inch. 
  77.  
  78.      It is possible to simulate a higher resolution by moving the 
  79. paper slightly and printing a second pass over the line that  was 
  80. just printed. The Epson provides for this with the ESC 3  command 
  81. which  causes the printer to advance the paper by  the  specified 
  82. n/216 inch increment when a line feed is received. However,  this 
  83. means that three passes for each line must be used to obtain this 
  84. resolution, which slows printing down by a factor of three.  Thus 
  85. it is not often used.
  86.  
  87.      Another  alternative is to use a 24 pin printer  which  uses 
  88. three rows of 8 pins to achieve the same effect on a single pass.
  89.  
  90.      In  the  horizontal  direction the  printer  resolution  can 
  91. change depending on the mode selected. In normal graphics mode on 
  92. the Epson this is set to 60 dots per inch. The reason behind this 
  93. is quite simple, the normal resolution of a character printed  in 
  94. 10  pitch  on the Epson is 6 dots horizontally  (discounting  the 
  95. half  dot fudging Epson uses to boost apparent  resolution).  The 
  96. paper  used  is  usually eight inches wide,  and  to  fit  eighty 
  97. characters onto the line at 6 dots per character area you end  up 
  98. with 480 dots on the line, or 60 dots per inch.
  99.  
  100.      Six  (five active pixels plus one separator) is the  minimum 
  101. number of pixels wide that can be used to fully represent all the 
  102. ASCII characters. 
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.      As  was  mentioned,  the Epson has a half  dot  fudge  which 
  112. allows  it  to put twice as many dots on the same line.  It  does 
  113. this by simply moving the head only half as far to print the next 
  114. dot.  By selecting double density mode you can get 120  dots  per 
  115. inch  which  gives you a resolution of 1/120 inch.  This  doesn't 
  116. come  free. In order to print twice as many dots on a  line,  the 
  117. printer has to print twice as many dots. That means that it  will 
  118. be slower. 
  119.  
  120.      The reason it is slower is because it takes a finite  period 
  121. of time to move the print wires in the head. Enough time must  be 
  122. allowed  for  the wires to retract in preparation  for  the  next 
  123. print.  The 'fudge' in character mode printing is that  the  dots 
  124. are  specified  in such a way that there are no  two  consecutive 
  125. half  dots  in  a row, thus giving enough time for  the  wire  to 
  126. retract  without  having to slow the printer down. But  since  in 
  127. graphics mode the printer can't know ahead of time whether  there 
  128. will be any consecutive half dots, it must assume that there will 
  129. be if you select the double density mode.
  130.  
  131.      Selecting double density mode does not mean that the printer 
  132. will slow down to half print speed, there are other factors  that 
  133. come into play that control this, including head return time, and 
  134. line feed time.
  135.  
  136.      In later model printers there is also an added super density 
  137. mode  which allows four dots to be printed in the space  of  one. 
  138. And  on some 24 pin printers there is even a "hex" density  mode, 
  139. allowing  for 360 dots per inch resolution. The  printer  handles 
  140. this by adding some intelligence in the printing. If the previous 
  141. dot was printed then it will not print the next one even if  told 
  142. to. That way there is enough time for the wire to be retracted in 
  143. preparation  for  the following dot. This allows the  printer  to 
  144. print  240 dots per inch resolution or more while running at  120 
  145. dots per inch speed. Since most programs try to be compatible  to 
  146. the  original  Epson  MX-80 printer, the super  density  mode  is 
  147. seldom used.
  148.  
  149.  
  150. Printer aspect ratio:
  151.  
  152.      As was previously mentioned, the Epson printer does not have 
  153. the  same  aspect ratio as the display, though there  are  tricks 
  154. that can be used to restore the over all image aspect ratio. This 
  155. is  performed  by printing additional dots at  certain  times  to 
  156. change  the apparent pixel aspect ratio of the printer. With  the 
  157. exception  of  the CGA display, the translation  is  usually  not 
  158. perfect.
  159.  
  160.      There  are  two ways in which the display  can  be  printed. 
  161. normal  'upright'  mode, in which the display's  horizontal  axis 
  162. appears  on the printer's horizontal axis. And  'landscape'  mode 
  163. where the display is printed out sideways.
  164.  
  165.  
  166.      A normal upright printout will provide an image that is  the 
  167. same   size  and  orientation  as  the  display,  but   has   the 
  168. disadvantage  of  requiring a lot of fiddling with  the  dots  to 
  169. produce the printout.
  170.  
  171.      The  landscape  (or sideways) printout does not  require  as 
  172. much  fiddling, but causes the picture to grow slightly  in  size 
  173. (8.9"  x  6.7" instead of 8" x 6"). A real big advantage is  with 
  174. the  CGA display mode. When printing a CGA display  sideways  all 
  175. that needs to be done is to double the display's horizontal  scan 
  176. lines  on  the  printer for 640x200 mode, or double  it  in  both 
  177. directions  in 320x200 mode. The printout will come out with  the 
  178. proper aspect ratio. 
  179.  
  180.      The  CGA  display could be printed upright without  any  bit 
  181. twiddling  at all, but the aspect ratio will be way off, and  the 
  182. picture  would  be smaller. By bit twiddling it  is  possible  to 
  183. restore the picture to the same size as the display (8"x6"),  but 
  184. there will be some distortion at the pixel level of the printout.
  185.  
  186.      With Hercules, EGA, and VGA type displays it is normally not 
  187. possible to perform a screen dump without some distortion. 
  188.  
  189.      If  it is important that the picture fit the  8"x6"  display 
  190. format  then the upright display method should be used,  but  you 
  191. should  realize that there will be significant distortion at  the 
  192. pixel level to keep the aspect ratio the same.
  193.  
  194.      If  minimal distortion at the pixel level is  desired,  then 
  195. the landscape method should be used. The primary disadvantage  is 
  196. that the picture size will grow slightly (8.9"x6.7") in order  to 
  197. achieve  the  reduced  distortion. Also note  that  the  Hercules 
  198. display will grow even further, expanding to 10"x7.5" to  achieve 
  199. the reduced pixel distortion. 
  200.  
  201.      While it is possible to achieve the same display size in the 
  202. landscape mode, there is no reason to do so since it would end up 
  203. being  even  more distorted at the pixel level than  the  upright 
  204. mode. 
  205.  
  206.      The amount of pixel level distortion is a trade off of speed 
  207. verses  distortion. It is possible to achieve minimal  distortion 
  208. by selecting the super resolution mode and using six print passes 
  209. per line. However that will cause the print time to be  increased 
  210. by  a  factor of six. This is seldom acceptable  given  that  the 
  211. print time in normal mode is too slow as it is. 
  212.  
  213.      One final note on speed. The print time for a given mode  is 
  214. based entirely on how much data there is to print. The larger the 
  215. picture, the longer it will take to print it.
  216.  
  217.  
  218.  
  219.  
  220.  
  221. Scaling distortion:
  222.  
  223.      When  scaling occurs, there will be trade-offs as a  result. 
  224. And since in the normal course of events when doing a screen dump 
  225. scaling  will  occur,  you will normally  be  encountering  these 
  226. trade-offs.   The trade-offs cause distortion of the  picture  in 
  227. one form or another. 
  228.  
  229.      The two main forms of distortion are aspect ratio, and pixel 
  230. distortion.  When  scaling  down  there  is  also  an  additional 
  231. degradation caused by screen pixel data being lost.
  232.  
  233.      Aspect  ratio distortion is where the overall picture  ratio 
  234. on  the printer does not match the ratio provided on the  screen. 
  235. Sometimes this is intentional, but usually it is not desired. For 
  236. engineering  graphs,  aspect  ratio errors greater  than  2%  are 
  237. considered unacceptable. For business charts aspect ratio  errors 
  238. greater than 5% begin to become unacceptable. In all cases aspect 
  239. ratio errors greater than 10% usually are considered unacceptable 
  240. as the picture will be noticeably distorted. 
  241.  
  242.      There  are  times when it might be desirable to  exceed  the 
  243. aspect ratio error factor. This might be done if the pixel  level 
  244. distortion is considered unacceptable. 
  245.  
  246.      Pixel  level distortion is most noticeable in the  printer's  
  247. Y  (vertical)  direction.   This   is  because  each   distortion  
  248. increment   is  1/72 inch. This is readily noticeable.  Sometimes 
  249. for  the  sake of clarity it is desirable to  forgo  the  overall 
  250. aspect ratio in order to obtain a minimal pixel level distortion. 
  251. There  is  no  easy  way to determine what  is  best,  it  is  an 
  252. individual thing.
  253.  
  254.      Pixel level distortion is caused by the inability to  evenly 
  255. divide  the  screen pixels into the same number  or  multiple  of 
  256. pixels on the printer. The usual end result is that  occasionally 
  257. there  will be additional pixels added in the picture  causing  a 
  258. slight  pixel  level distortion to maintain the  overall  picture 
  259. aspect  ratio.  By  slightly changing the  aspect  ratio  of  the 
  260. printout you can sometimes eliminate the distortion, or at  least 
  261. cause  the  distortion  to  occur in  a  pattern  which  is  more 
  262. acceptable. 
  263.  
  264.      When scaling up (expanding) a screen picture the  distortion 
  265. can  be  noticeable,  but no data is lost, it  is  just  slightly 
  266. distorted  due to the added pixels. When scaling  down  decisions 
  267. must  be made by the program on what data to retain and  what  to 
  268. discard. This is usually handled on a priority basis. The  colors 
  269. are each assigned a priority. When two or more screen pixels must 
  270. be  placed in the position of one printer pixel then  the  screen 
  271. pixel  with the highest priority color will take precedence,  and 
  272. the rest will be discarded.
  273.  
  274.