home *** CD-ROM | disk | FTP | other *** search
/ The Best of the Best / _.img / 01061 / dmorf.doc next >
Text File  |  1993-08-09  |  23KB  |  644 lines

  1. DMORF Rel 1.1.2 (08/09/93) Documentation
  2. Copyright (c) 1992, 1993, by David K. Mason.
  3. All Right Reserved.
  4.  
  5. DMorf (Dave's Morphing program) is a small morphing program
  6. that runs in DOS graphics mode.  It operates on TGA, GIF,
  7. and IMG files, and produces a bunch of TGA files as output.
  8. You can compile these TGA files using my other program, DTA,
  9. or dump 'em straight out to video if you've got the
  10. hardware.
  11.  
  12. (note: also take a look at WHATSNEW.DMO... that file is
  13. sometimes more up-to-date than this one is)
  14.  
  15.  
  16. ---------------------------------------------------------------------
  17. Hardware requirements:
  18.  
  19. To run DMorf, you MUST have:
  20.  1) A VGA monitor
  21.  2) At least a '286
  22.  3) A mouse with a microsoft-compatible driver
  23.  4) *some* extended memory (expanded memory is not useful).
  24.  
  25. To accomplish any serious work with this program, you SHOULD
  26. have:
  27.         1) SVGA board with VESA in BIOS or with a VESA driver.
  28. By default, DMorf will use the 640x480x256 mode.  If you use
  29. the /800 command-line switch it'll use 800x600 mode instead.
  30. The /1024 command-line switch tells DMorf to use 1024x768
  31. mode instead.
  32.         2) A fast processor *and* numeric coprocessor... DMorf
  33. DRAGS without a copro.  Right now the 486DX is the best chip
  34. to have because the coprocessor is integrated on the same
  35. chip.  (When the Pentium comes out, it should be fantastic
  36. because of its optimized floating point instructions.)
  37.         3) *Lots* of extended memory, unless you're working
  38. with teeny pictures.
  39.  
  40.         This program runs in '286 protected mode, and allows
  41. access to up to 16M of extended memory.
  42.  
  43.         ( During the warping process, DMorf creates a buffer
  44. big enough to hold one entire picture, in RGBa (32-bit)
  45. form.  That means 256000 bytes if you're working with
  46. 320x200 pictures, or 1,228,800 for 640x480, or 1,920,000 for
  47. 800x600, or 3,145,728 for 1024x768. )
  48.  
  49.     You can speed DMorf up quite a bit using the /PRELOAD
  50. command-line switch... it loads copies of both pictures into
  51. memory at startup thus when displaying, editing, or
  52. morphing, it won't have to read the pitures from disk.
  53. Also, it causes some intermediate pictures to be stored in
  54. memory instead of saved and loaded from disk.
  55.     This can save significant time, but uses a *lot* of
  56. memory....   multiply the numbers in the previous paragraph
  57. by 3 or 4.
  58.  
  59.  
  60. ---------------------------------------------------------------------
  61. DOS-Extender Files
  62.  
  63. The DOS-Extender Files from the Borland Pascal compiler
  64. (DPMI16BI.OVL, RTM.EXE, and DPMIINST.EXE) must exist
  65. somewhere in your DOS path, or in the same directory where
  66. you keep DMORF.EXE.... or DMORF will not work at all.  These
  67. files are in the DMorf archive.
  68.  
  69. If you've got an unsupported 286 processor (you'll know,
  70. because DMORF will complain loudly), then you'll have to:
  71.  
  72.         (1) disable any memory management software you have
  73. running (like HIMEM.SYS) and reboot your system.
  74.         (2) run the other program in this archive, DPMIINST,
  75. which will configure RTM.EXE for your system
  76.         and then
  77.         (3) turn any disabled memory managment stuff back on
  78. and reboot your system again.
  79.  
  80.  
  81. ---------------------------------------------------------------------
  82. Multiple versions:
  83.  
  84. DMorf 1.1 comes in two varieties: DMORF.EXE and DMORFNC.EXE.
  85. Both versions can run in systems that either have or don't
  86. have math coprocessors, but DMORF.EXE will run much faster
  87. on systems with coprocessors, and DMORFNC will run faster
  88. on systems that DON'T have coprocessors.
  89.  
  90. If you have a choice, use DMORF.EXE and a coprocessor.
  91.  
  92. Sorry, but because it uses a different method of
  93. representing floating point numbers, DMORFNC.EXE will not be
  94. able to read mesh files created with versions 1.0 and
  95. earlier of DMorf.  You could get around this by loading a
  96. mesh file into DMORF.EXE, saving it in the 1.1 mesh file
  97. format, and then loading the new mesh into DMORFNC.EXE.
  98.  
  99.  
  100. ---------------------------------------------------------------------
  101. Credits
  102.  
  103. The warping, morphing, image scaling, and spline algorithms
  104. all come (with modification) from George Wolberg's excellent
  105. book Digital Image Warping. The user interface stuff is all
  106. mine.
  107.  
  108. Thanks to Michael Day (Knight Software) for making his VESA
  109. BGI graphics driver (BGI256) available.
  110.  
  111. Thanks to Lutz Kretzschmar for letting me use his SVGA
  112. mouse-handling code, and for all his great ideas for
  113. enhancements.
  114.  
  115. Thanks to Eric Deren for his neat ideas on manipulating
  116. meshes, and for his contributions to this documentation.
  117.  
  118. Thanks to all of the Compuserve GRAPHDEV forum gang, and
  119. the Graphics Alternative BBS gang for their suggestions,
  120. and various bugs they've helped me identify.
  121.  
  122.  
  123. ---------------------------------------------------------------------
  124. Disclaimer
  125.  
  126. If you use DMorf, you do so at your own risk.  I won't be
  127. held responsible if it screws anything up.
  128.  
  129.  
  130. ---------------------------------------------------------------------
  131. Support
  132.  
  133. If you've got any requests/bug reports/suggestions, send a
  134. message to:
  135.  
  136.         "David Mason" on the "You Can Call Me Ray" BBS, (708)
  137. 358-5611, and on "The Graphics Alternative", (510) 524-2780,
  138. and on "Channel 1" BBS, (617) 354-8873.
  139.         "76546,1321" on Compuserve.
  140.         From the Internet, it's "76546,1321@compuserve.com"
  141.  
  142. You'll probably get some kind of a response (maybe sooner,
  143. maybe later).
  144.  
  145. You could also send paper mail to the address listed a bit
  146. later in this document, but I'm *terrible* at answering my
  147. mail.  I much prefer electronic mail.
  148.  
  149.  
  150. ---------------------------------------------------------------------
  151. The Rules
  152.  
  153. Feel free to re-upload this program to other bulletin board
  154. systems in its *original, unmodified* form.  Don't change
  155. the name of the ZIP file... it's supposed to be called
  156. DMORF111.ZIP (except on Compuserve, where it's called
  157. DMORF.ZIP).  You may not repackage it with other software.
  158. You may not repackage it with your own tutorial.  I feel
  159. like an idiot having to make these demands, but people have
  160. been doing these things.
  161.  
  162.         Do not include this on a disk along with any magazine,
  163. book, hardware product, or other software product without my
  164. permission.
  165.  
  166.  
  167. ---------------------------------------------------------------------
  168. Money matters
  169.  
  170. DMorf is a shareware program.  If you think this program is
  171. worth it, send some money or some computer hardware or
  172. something to:
  173.  
  174.         David K. Mason
  175.         P.O. Box 181015
  176.         Boston, MA 02118
  177.  
  178.         I think $35 is an appropriate amount, but feel free to
  179. send more or less.
  180.  
  181.  
  182. ---------------------------------------------------------------------
  183. How to use DMorf:
  184.  
  185. To get started with DMorf, type "DMORF <file1> <file2>"
  186.  
  187.         The files can be TGA (16, 24, or 32, compressed or
  188. uncompressed), Vivid IMG, or GIF.  The two files don't have
  189. to be in the same format, but they do have to share the same
  190. dimensions.
  191.         DMorf will then read and display the two pictures in
  192. side-by-side windows.  If you only supplied one filename,
  193. then it'll display that picture twice. It scales them so
  194. they'll fit in the windows.
  195.         Then, it lays a mesh over the two pictures.  In this
  196. program, a mesh is represented by a bunch of horizontal and
  197. vertical lines.  The points where they intersect can be
  198. adjusted.  Initially, there are lines on the four edges of
  199. the picture.  There are always the same number of mesh
  200. points defined in the two pictures, though they aren't
  201. always in the same places.
  202.  
  203.         To add a new line to the mesh, move the mouse cursor to
  204. the border around one of the pictures (which one doesn't
  205. particularly matter).  Click the *right* mouse button at the
  206. point where you want the line added.  (If the cursor is on
  207. the top or bottom border, a vertical line will be added, and
  208. if it's on one of the sides, a horizontal line will be
  209. added.)
  210.  
  211.         To move a vertex, put the mouse cursor over the
  212. intersection of two lines, press the button, and move the
  213. mouse.  Let go of the button when you've got the point where
  214. you want it.  DMorf will try to prevent you from overlapping
  215. lines.  It's possible to defeat it with weird angles.
  216. Don't do that...  it's bad.
  217.  
  218.         The point of these meshes is to define the shapes of
  219. the objects in the pictures.  The lines should match the
  220. contours of any objects in the scenes.
  221.         Move the vertices of the lines so that the lines match
  222. the curves of the objects in the pictures.  When you've got
  223. meshes that you're satisfied with, click on the "Go" button
  224. and watch.
  225.  
  226.         After you've saved a your mesh in a .MSH file (using
  227. the Save or SaveAs button), you could start DMorf by just
  228. typing "DMORF MESHFILE.MSH".  DMorf will remember the names
  229. of your picture files and any settings particular to your
  230. morph sequence.
  231.  
  232. ---------------------------------------------------------------------
  233. Command Line Options:
  234.  
  235. Usage:
  236.  
  237.         Dmorf [file 1] [file 2] [meshfile.msh] [options]
  238.  
  239. Options:
  240.  
  241.         /800            sets display to 800x600
  242.         /1024           sets display to 1024x768
  243.         /Go             tells DMorf to begin morphing immeadiately.
  244.                         (Note: Requires a meshfile.)
  245.         /Preload        loads images into memory for quicker access
  246.  
  247.         Except for the fact that [file 1] must come somewhere
  248. before [file 2], the order of parameters doesn't matter.
  249. "dmorf x.tga y.tga xy.msh /800" is identical to
  250. "dmorf /800 x.tga xy.msh y.tga", as far as DMorf is concerned.
  251.  
  252.         If you specify a meshfile on the commandline, then you
  253. don't *have* to type the names of your picture files too because
  254. the picture file names are stored in the meshfile along with all
  255. of the other settings.  You only have to type the picture file
  256. names in addition to the meshfile name if you want to load
  257. pictures that are different from the ones that the meshfile
  258. points to.
  259.  
  260.  
  261. ---------------------------------------------------------------------
  262. DMorf Command Listing
  263.  
  264. Main Menu
  265.  
  266. File Dialog
  267.         This dialog box consists of all the picture and file
  268. manipulation options and features.
  269.  
  270. Go
  271.         Causes DMorf to start morphing or warping.
  272.  
  273. Quit
  274.         Changed my mind.  Get me out of this program NOW.  The
  275. escape key does the same thing.
  276.  
  277. Save
  278.         Saves your meshes and settings to the current control
  279. file.  It doesn't prompt for a filename unless the mesh is
  280. unsaved.
  281.  
  282. Save As
  283.         Saves your meshes and settings to a user specified
  284. control file.  Always prompts for a filename.  If no
  285. extension is specified ".MSH" is assumed.
  286.  
  287. Load
  288.         Loads a control file.  Updates morph images, meshes and
  289. all DMorf parameters to the ones saved in the control file.
  290. Always prompts for a filename.  If no extension is specified
  291. ".MSH" is assumed.
  292.  
  293. Reload
  294.         Re-loads the current control file.  It doesn't prompt
  295. for a filename unless the mesh is unsaved.
  296.  
  297. About
  298.         Displays DMorf copyright information.
  299.  
  300. Settings
  301.         This displays the Settings dialog.
  302.  
  303. Settings/Morph Switches dialog
  304.         This dialog box consists of the options that control
  305. the Image Warper and the way it handles the image warping
  306. for both morphs and warps.
  307.  
  308. Settings/Spline Mesh
  309.         Tells the Image Warper to use spline curves instead of
  310. lines when generating the morph or warp files.
  311.  
  312. Reasons to use splines instead of lines:
  313.         (1) The bent image has smooth curves and gradients.
  314.         (2) The morph or warp often looks a whole lot more
  315. fluid and lifelike.
  316.  
  317. Reasons to use lines instead of splines:
  318.         (1) Splines sometimes go haywire, with curves going
  319. every which way, overlapping, and (gasp) sometimes even
  320. passing beyond of the picture borders.
  321.         (2) You don't want something curved when it warps
  322.         (3) lines are faster than splines.
  323.  
  324. Settings/Spline Intervals
  325.         When activated, the Image Warper remaps intervals
  326. between mesh lines using splines instead of linear
  327. interpolation.  The result is a more natural looking warp,
  328. and pros and cons are similar to the ones for the Spline
  329. Mesh setting.
  330.  
  331. Settings/Spline Always
  332.         Uses splines for all mesh editing operations, as
  333. opposed to the default lines.  Ideally this would be
  334. automatic whenever "Spline Mesh" is selected, but it works
  335. way too slowly except on the fastest of machines.
  336.  
  337. Settings/Smooth Resampling
  338.         With Smooth Resampling activated, DMorf interpolates
  339. new pixel values from all source pixels that should
  340. contribute... if you turn this control off, it just grabs a
  341. the closest pixel value.  Nearest neighbor or dumb mode, in
  342. other words.  The results in smooth resampling mode look
  343. massively better than dumb mode.
  344.         The tradeoff is that dumb mode is massively faster.
  345. Dumb mode is useful in test runs, but don't use it for real
  346. stuff, 'cause it looks like crap.
  347.  
  348. Settings/Just Warp
  349.         In the default morph mode, the DMorf will map points
  350. from the shape of the mesh picture #1 toward the shape of
  351. the mesh on picture #2, and then from 2 toward 1, and cross-
  352. fade.  With the Just Warp option activated, it'll just map
  353. points from mesh #1 toward mesh #2, with no fade.
  354.         Not too surprisingly, Just Warp mode takes half the
  355. time that Morph mode does.
  356.  
  357. Settings/Show In-Betweens
  358.         DMorf usually displays, while morphing, all the
  359. intermediate pictures it creates.  If you turn off this
  360. switch, it won't, and it'll finish quicker.
  361.  
  362. Settings/Verbose Status
  363.         DMorf usually displays the frame number it's working
  364. on, plus the percentage of the warp that it's finished.
  365. With verbose status switched off, it lists only the frame
  366. number.
  367.  
  368. Settings/Frame Info dialog
  369.         This dialog box consists of options that control the
  370. choreography for the Image Warper.
  371.  
  372. Settings/Frames
  373.         This tells DMorf how many pictures to create.  If
  374. you're in Morph mode, then this represents how many tween
  375. frames to create.  In Just Warp mode, this number includes a
  376. fully-warped final frame.
  377.  
  378. Settings/First Frame
  379.         First Frame specifies the first frame to render in the
  380. range 0 to Last.  Useful if you only need part of a morph.
  381.  
  382. Settings/Last Frame
  383.         Specifies the final frame to render in the range First
  384. to Frames.
  385.  
  386. Settings/Warp 1/2
  387.         This setting determines the speed of the warping mesh.
  388. Specifically, the number determines at which percent of the
  389. morph the mesh should be warped halfway between the before
  390. and after meshes.
  391.  
  392. Settings/Fade 1/2
  393.         This setting determines the speed of the crossfade
  394. during a morph.  Specifically, the number determines at
  395. which percent of the morph the fade should be halfway
  396. between the before and after images.
  397.         This setting has no effect if the Just Warp option is
  398. active.
  399.  
  400. Colors
  401.         This displays the Colors dialog.
  402.  
  403. Colors/Mesh
  404.         The three sliders in the Mesh dialog box control the
  405. red, green, and blue component colors of the warp meshes.
  406.  
  407. Colors/Alpha
  408.         The three sliders in the Alpha dialog box control the
  409. red, green, and blue component colors of the color used to
  410. represent pixels that are more than 50% transparent.
  411.  
  412. Colors/Gamma Settings
  413.         Color values in computer graphic images are based on
  414. linear intensity values.  In programs that deal with 24 bit
  415. color, each pixel color is stored as one byte for each
  416. component color of red, green, and blue.  A pixel value of
  417. (127,127,127) has half the intensity of a pixel value of
  418. (254,254,254).  However, video equipment and the human eye
  419. responds non linearly to intensity.  So the color
  420. (254,254,254) will not appear twice as intense as the color
  421. (127,127,127).  To fix this phenomena, especially when
  422. outputting to video, the image can be Gamma Corrected.  The
  423. gamma correction is calculated for every pixel using the
  424. gamma value, which represents the non linearity of the
  425. monitor.  Typical values of gamma are usually around 2.0.
  426. Using an excessively large gamma will make your image very
  427. bright and will reduce the contrast.  A small gamma will
  428. usually result in a dark image.  NTSC standard gamma
  429. correction is 2.2.  Gamma should not be applied to a
  430. computer image more than once.
  431.  
  432. Colors/Gamma Settings/File
  433.         This value specifies the gamma correction value that's
  434. already been applied to the picture.
  435.  
  436. Colors/Gamma Settings/Disp
  437.         This value specifies the new gamma correction value for
  438. the screen.
  439.  
  440. Pictures
  441.         This displays the pictures dialog.
  442.  
  443. Pictures/Input Files dialog
  444.         This dialog box allows user specification of the input
  445. files.
  446.  
  447. Pictures/Before
  448.         Specifies the name of the picture to morph from.
  449.  
  450. Pictures/After
  451.         Specifies the name of the picture to morph to.
  452.  
  453. Pictures/Background
  454.         Specifies the name of the picture to overlay the
  455. morphed frames onto assuming the morph pictures have
  456. transparency.  (NOTE: this option currently has no effect.
  457. In the future, when DMorf shells out to DTA, it'll use this
  458. value to build the DTA command-line.)
  459.  
  460. Pictures/TGA Switches dialog
  461.         This dialog box allows the user to specify what flavor
  462. of TGA files DMorf creates.
  463.  
  464. Pictures/Bottom Up
  465.         Tells DMorf whether to create TGA files that begin at
  466. the bottom of the screen, or at the top of the screen.  Some
  467. programs can only read one or the other variety.  (DTA can
  468. read both, but prefers bottom-to top)  Not to be confused
  469. with "bottoms up!"
  470.  
  471. Pictures/32-bit
  472.         Tells DMorf whether to create 24-bit or 32-bit TGA
  473. files.  The only reason you might want to use 32-bit TGA
  474. files is if you're planning to do compositing.  Some
  475. programs can only read 24-bit TGA files.  (DTA can read
  476. either)
  477.  
  478. Pictures/RLE
  479.         Tells DMorf whether or not to create run-length encoded
  480. (compressed) TGA files.  Compressed TGA files are almost
  481. always smaller than non-compressed, but some programs can't
  482. read them. (DTA can)
  483.  
  484. Pictures/Output Files dialog
  485.         This dialog box allows the user to specify options for
  486. the output files.
  487.  
  488. Pictures/Prefix
  489.         Prefix specifies the prefix for the saved TGA files.
  490. Default for morphs is MORF and for warps is WARP.
  491.  
  492. Max (maximize)
  493.         Displays just the selected image much larger on the
  494. screen and switches to the Maximize dialog.  This gives
  495. finer control over the mesh control points.
  496.  
  497. Max/Other
  498.         This option toggles the display between the Before and
  499. after pictures.
  500.  
  501. Max/Zoom In
  502.         This allows you to further zoom the display for
  503. detailed adjustment of the mesh control points.  To use,
  504. select Zoom In, then move the mouse cursor to a corner of
  505. the section you want to magnify.  Click and drag the mouse
  506. to place the opposite corner.  The display will then show
  507. the selected area in the aspect you selected; no aspect
  508. ratio correction is done.
  509.  
  510. Max/Zoom In/Colors
  511.         This displays the colors dialog.  See description under
  512. the Main Menu.
  513.  
  514. Max/Zoom In/Zoom Out
  515.         This unzooms the view and returns you to the Maximize
  516. dialog.
  517.  
  518. Max/Zoom In/Settings
  519.         This displays the settings dialog.  See description
  520. under the Main Menu.
  521.  
  522. Max/Zoom In/Spline
  523.         This gives you a preview of what splines for the
  524. current mesh points would look like.  It converts the lines
  525. on the screen to splines temporarily.  Press and hold.
  526.  
  527. Max/Main
  528.         This returns you to the Main Menu.
  529.  
  530. Max/Colors
  531.         This displays the colors dialog.  See description under
  532. the Main Menu.
  533.  
  534. Max/Settings
  535.         This displays the settings dialog.  See description
  536. under the Main Menu.
  537.  
  538. Max/Spline
  539.         This gives you a preview of what splines for the
  540. current mesh points would look like.  It converts the lines
  541. on the screen to splines temporarily.  Press and hold.
  542.  
  543. Edit
  544.         Displays just the selected image much larger on the
  545. screen and switches to the Edit dialog.  This gives finer
  546. control over the mesh control points.
  547.  
  548. Edit/Other
  549.         This option toggles the display between the Before and
  550. after pictures.
  551.  
  552. Edit/Main
  553.         This returns you to the Main Menu.
  554.  
  555. Edit/Colors
  556.         This displays the colors dialog.  See description under
  557. the Main Menu.
  558.  
  559. Edit/Flip H
  560.         This flips the current image horizontally. (vertical
  561. mirror)
  562.  
  563. Edit/Save
  564.         This saves the current image into a 32-bit TGA file
  565. (so the alpha information is saved) using the original
  566. filename with a .TGA extension.  It changes the filename in
  567. the Pictures dialog to this new name, as well.
  568.  
  569. Edit/Save As
  570.         This has the same features as Edit/Save, but saves to a
  571. user-specified filename.  The .TGA extension is assumed.
  572.  
  573. Edit/Alpha Blur
  574.         Alpha Blur performs a weighted blur filter against just
  575. the alpha channel. This helps a bit since DMorf's
  576. rudimentary alpha editing doesn't support fractional values.
  577.  
  578. Edit/Zoom In
  579.         This allows you to further zoom the display for
  580. detailed adjustment of the mesh control points.  To use,
  581. select Zoom In, then move the mouse cursor to a corner of
  582. the section you want to magnify.  Click and drag the mouse
  583. using the left mouse button to place the opposite corner.
  584. The display will then show the selected area in the aspect
  585. you selected; no aspect ratio correction is done.
  586.  
  587. Edit/Zoom In/Colors
  588.         This displays the colors dialog.  See description under
  589. the Main Menu.
  590.  
  591. Edit/Zoom In/Zoom out
  592.         This unzooms the view and returns you to the Edit
  593. dialog.
  594.  
  595. Edit/Key
  596.         This allows the user to key out certain colors and give
  597. them complete alpha transparency.  To use, select the Key
  598. button, then place the mouse cursor over the color in the
  599. picture that you wish to be given full transparency.  Press
  600. the left mouse button, and that color will assume the color
  601. set for alpha in the Colors dialog.
  602.  
  603. Edit/Tolerance
  604.         This tells DMorf how close a pixel's color has to be to
  605. the Key color.
  606.  
  607. Mesh dialog
  608.         This dialog box consists of all the mesh manipulation
  609. options and features.
  610.  
  611. Hide
  612.         Temporarily removes the mesh display from the images.
  613. Useful for image inspection.
  614.  
  615. Spline
  616.         Spline gives you a preview of what splines for the
  617. current mesh points would look like.  It converts the lines
  618. on the screen to splines temporarily.  Press and hold.
  619.  
  620. Swap
  621.         Swaps the meshes between the two windows.
  622.  
  623. FlipHz
  624.         Flips one of the meshes horizontally.
  625.  
  626. 1->2
  627.         Copies the mesh from window 1 (before) to window 2
  628. (after).  Replaces whatever mesh was in window 2.
  629.  
  630. 2->1
  631.         Copies the mesh from window 2 (after) to window 1
  632. (before).  Replaces whatever mesh was in window 1.
  633.  
  634. Del
  635.         Lets you delete a line from the meshes.  To use, select
  636. Del, then click on the border of the picture where the line
  637. you want to remove is, as with adding a line.  Press the
  638. left mouse button to delete.
  639.  
  640. Select
  641.         The two radio buttons shown here allow you to choose
  642. which mesh is currently selected for mesh and image options
  643. such as Max, Edit, FlipHz and others.
  644.