home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / d / dmorf010.zip / DMORF.DOC next >
Text File  |  1992-12-21  |  8KB  |  186 lines

  1. DMORF Rel Alpha 0.09 (12/09/92)
  2. Copyright (c) 1992, by David K. Mason
  3.  
  4. This is just a brief intro to get you going with DMorf.  It's not
  5. a real document or anything.  Note: this is still a fairly early
  6. alpha version of this program... it's prone to crashing at
  7. inconvenient times, so save your warping meshes in files on
  8. a regular basis.  I haven't worked on this program in quite a
  9. while except to fix one last bug that had been sitting there since
  10. March, and I probably won't get back to it for another long while.
  11. Feel free to report bugs, but don't expect 'em to get fixed too
  12. soon.
  13.  
  14. To run DMorf, you MUST have:
  15.  1) A VGA monitor (regular VGA is sufficient... DMorf works only
  16.     in 640x480x16 mode)
  17.  2) At least a '286
  18.  3) A mouse with a microsoft-compatible driver
  19.  
  20. To accomplish any serious work with this program, you SHOULD have:
  21.  
  22.  1) A numeric coprocessor... it DRAGS without one
  23.  
  24.  2) Plenty of XMS or EMS unless you're working with teeny pictures.
  25.     During the warping process, DMorf creates a buffer
  26.     big enough to hold one entire picture, in RGBa (32-bit)
  27.     form.  That means 256000 bytes if you're working with
  28.     320x200 pictures, or 1,228,800 for 640x480, or 1,920,000
  29.     for 800x600, or 3,145,728 for 1024x768.
  30.  
  31. To get started with DMorf, type "DMORF <file1> <file2>".
  32. The files can be TGA (16, 24, or 32, compressed or uncompressed),
  33. Vivid IMG, or GIF.  The two files don't have to be in the same
  34. format, but they do have to have the same dimensions.
  35. DMorf doesn't currently check to make sure they have the same
  36. dimensions, so if you mix 'em up, you might get REAL odd results,
  37. run-time error, or both.
  38.  
  39. The only type of output DMorf creates is compressed Targa-32
  40. files.  VPIC and PICLAB have some trouble reading the output files,
  41. because the run-length packets span lines.
  42. DTA can read 'em okay, though.
  43.  
  44. DMorf will then read and display the two pictures in side-by-side
  45. windows.  If you only gave one filename, then it'll display
  46. that picture twice.
  47. It scales 'em so they'll fit in the windows.
  48.  
  49. Then, a mesh is laid over the two pictures.
  50. In this program, a mesh is represented by a bunch of horizontal
  51. and vertical lines.  The points where they intersect can be
  52. adjusted.
  53. Initially, there are lines on the four edges of the picture,
  54.  
  55. There are always the same number of mesh points defined in the
  56. two pictures, though they aren't always in the same places
  57. unless the meshes are locked.
  58.  
  59. To add a new line to the mesh, move the mouse cursor to the
  60. border around one of the pictures (which one doesn't particularly
  61. matter).  Click the button at the point where you want the line
  62. added.  (If the cursor is on the top or bottom border, a vertical
  63. line will be added, and if it's on one of the sides, a horizontal
  64. line will be added.)
  65.  
  66. To move a vertex, put the mouse cursor over the intersection
  67. of two lines, press the button, and move the mouse.
  68. Let go of the button when you've got the point where you want
  69. it.  DMorf will try to prevent you from overlapping lines.
  70. It's possible to defeat it with weird angles.  It's best if
  71. you don't, however.
  72.  
  73. Here's what the other controls on the screen do:
  74.  
  75.  Just Warp:  In Morph mode, the program will map points from
  76.    picture #1 toward picture #2, and from 2 toward 1, and
  77.    cross-fade.  In Warp mode, it'll just map points from
  78.    #1 toward #2, with no fade.
  79.    Not too surprisingly, Warp mode takes half the time
  80.    that Morph mode does.
  81.  
  82.  Spline meshes:
  83.    When your points are all located where you want them to be,
  84.    and you tell DMorf to go ahead and morph, DMorf figures out
  85.    which points to map where by drawing spine curves between
  86.    the vertices.
  87.    If you turn this control off, it'll draw straight lines instead.
  88.    Reasons to use slines instead of lines: the warp often looks
  89.    a whole lot better.
  90.    Reasons to use lines instead of splines:
  91.    (1) Splines sometimes go haywire, with curves going every which
  92.        way, overlapping, and (gasp) sometimes even passing beyond
  93.        of the picture borders
  94.    (2) You don't want something curved when it warps
  95.    (3) lines are faster than splines.
  96.  
  97.  Smooth resampling:  In smooth mode, DMorf interpolates
  98.    new pixel values from all source pixels that should
  99.    contribute... if you turn this control off, it just
  100.    grabs a the closest pixel value.
  101.    Nearest neighbor, in other words.  The results
  102.    in smooth mode look massively better than dumb mode.
  103.    But dumb mode is massively faster.  Dumb mode would be
  104.    useful in test runs, but don't use it for real stuff, 'cause
  105.    it looks like crap.
  106.  
  107.  The Mesh colors "R" control: sets the red component of the color
  108.    used to display the control mesh.
  109.  
  110.  The Mesh colors "G" control: sets the green component of the color
  111.    used to display the control mesh.
  112.  
  113.  The Mesh colors "B" control: sets the blue component of the color
  114.    used to display the control mesh.
  115.  
  116.  The Frames control: tells DMorf how many pictures to create.
  117.    If you're in Morph mode, then this represents how many tween
  118.    frames to create.  In warp mode, this number includes a
  119.    fully-warped final frame.
  120.  
  121.  The Swap button: swaps the meshes between the two windows.
  122.  
  123.  The Copy 1->2 button: copies the mesh from window 1 into
  124.    window 2.
  125.  
  126.  The Copy 2->1 button: copies the mesh from window 2 into
  127.    window 1.
  128.  
  129.  The Splines button: gives you a preview of what splines for the
  130.    current mesh points would look like.  If you're using
  131.    "Spline meshes" mode, make sure you use this button once in a
  132.    while to make sure the splines aren't going nuts.
  133.  
  134.  The Zoom buttons: display just one of the images, much larger.
  135.    This gives much finer control over the mesh control points.
  136.  
  137.  The Save button: saves your meshes and settings to a control file.
  138.  
  139.  The Load button: loads a control file.  Type the filename right the
  140.    first time or you'll get a run-time error and get dumped out to
  141.    DOS.
  142.  
  143.  The Go button: causes DMorf to start morphing.
  144.  
  145.  The Abort button: Changed my mind.  Get me out of this program NOW.
  146.    The escape key does the same thing.
  147.  
  148. If all this makes no sense, just start messing around with the
  149. program.  Once you figure out how to add new points to the mesh,
  150. the rest of the interface is pretty intuitive.
  151.  
  152. Credits:
  153.  
  154. The warping and morphing algorithms come from George
  155. Wolberg's book Digital Image Warping.
  156. The image scaling and spline code come virtually unchanged from the
  157. same book (except for translating it from C to Pascal).
  158. I ripped the line drawing routines off from PC Magazine's
  159. book Turbo Pascal 6.0 Techniques and Utilities, by Neil Rubenking.
  160. I don't remember what other places I stole stuff from.
  161. Much is actually my original work, though.
  162. Thanks to the Compuserve GRAPHDEV forum gang, and the Graphics
  163. Alternative BBS gang for their suggestions, and various bugs
  164. they've helped me identify.
  165.  
  166. Stuff I'm going to add or change (sooner or later):
  167.  
  168. 1) Deletion of mesh lines.
  169. 2) A better way of adding mesh lines.
  170. 3) Proper handling of the alpha channel.  Right now DMorf takes
  171.    the alpha byte from TGA-32s into account, but I haven't
  172.    bothered to make it work with them right.
  173.    Since I don't actually have any test files with real alpha
  174.    info in them.
  175.    I'm also going to have to write a little program to add alpha
  176.    info to pictures (a seed fill to alpha out the background
  177.    is a method suggested in Foley & Van Dam).
  178.    And write a program to do compositing (or add that capability
  179.    to DTA).
  180. 4) Or, forget that alpha stuff and add some kind of mechanism for
  181.    cropping out the background.
  182.  
  183. -- David K. Mason
  184.    P.O. Box 181015
  185.    Boston, MA 02118
  186.