home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / tt / raysh402 / guide.tex / node8_mn.html < prev    next >
Text File  |  1992-02-09  |  5KB  |  116 lines

  1.  
  2. <H1><A ID="SECTION00420000000000000000">
  3. Images</A>
  4. </H1>
  5.  
  6. <P>
  7. The end result of running <#107#><#1769#><EM>rayshade</EM><#1769#><#107#> is an image file.  Depending upon
  8. how it was installed, <#108#><#1771#><EM>rayshade</EM><#1771#><#108#> writes images in either the Utah Raster
  9. <#109#><EM>RLE</EM><#109#> format or a generic but easily-manipulated <#110#><EM>mtv</EM><#110#> format
  10. used by Mark VandeWettering in his <#111#><EM>mtv</EM><#111#> ray tracer.  The <#112#><EM>mtv</EM><#112#>
  11. format consists of a header giving the resolution of the image followed
  12. by interleaved red-green-blue values for each pixel.  The <#113#><EM>RLE</EM><#113#> format
  13. supports an arbitrary number of color channels,
  14. an alpha channel, comments, a history field, and the ability
  15. to treat images as windows into a larger image.  As a result of this
  16. flexibility, a number of <#114#><#1773#><EM>rayshade</EM><#1773#><#114#>'s features
  17. are not
  18. supported if the <#115#><EM>mtv</EM><#115#> format is being used. You are thus strongly
  19. encouraged to obtain a copy of the Utah Raster Toolkit.
  20.  
  21. <P>
  22. If the <#116#><EM>mtv</EM><#116#>
  23. format is used, the image will (and must) consist of three eight-bit
  24. color channels.
  25. If the <#117#><EM>RLE</EM><#117#> format is used, the image file consists of three
  26. eight-bit color channels plus an eight-bit alpha channel.  <#118#><#1775#><EM>Rayshade</EM><#1775#><#118#>
  27. also documents in the <#119#><EM>RLE</EM><#119#> header the command line and <#120#><EM>gamma</EM><#120#>
  28. value used in creating the image.
  29.  
  30. <P>
  31. If more than one frame is rendered, the resulting images are appended
  32. in turn
  33. to the image file.  The various utilities provided by the
  34. Utah Raster Toolkit can be used to manipulate the resulting ``movie''
  35. files.
  36. If the Toolkit is not being used, you will probably need to write
  37. utility programs to handle the decidedly non-standard multi-image <#121#><EM>mtv</EM><#121#>
  38. format files.
  39.  
  40. <P>
  41. By default, <#122#><#1777#><EM>rayshade</EM><#1777#><#122#> writes the computed image to the standard output.
  42. The image file may be written to a file instead by specifying a file name
  43. in the input stream.
  44.  
  45. <P>
  46. <DL>
  47. <DT><STRONG><#4616#><#4616#></STRONG></DT>
  48. <DD><#1157#><TT>outfile</TT><#1157#> <#1158#><EM>filename</EM><#1158#> 
  49. <BR>    Write the computed image to the named file.
  50. </DD>
  51. </DL>The output file name may also be specified on the command line by
  52. using the <#127#><TT>-O</TT><#127#> option.
  53.  
  54. <P>
  55. The size of the output image is measured in pixels.  The <#128#><EM>x</EM><#128#> size
  56. is the number of pixels left-to-right, while the <#129#><EM>y</EM><#129#> size is
  57. the number of pixels bottom-to-top.
  58.  
  59. <P>
  60. <DL>
  61. <DT><STRONG><#4617#><#4617#></STRONG></DT>
  62. <DD><#1161#><TT>screen</TT><#1161#> <#1162#><EM>xsize ysize</EM><#1162#> 
  63. <BR>    Use a screen <#133#><EM>xsize</EM><#133#> pixels wide by <#134#><EM>ysize</EM><#134#> pixels high.
  64. </DD>
  65. </DL>The screen size may also be set on the command line through
  66. the <#136#><TT>-R</TT><#136#> option.
  67. The default
  68. screen size is 512 by 512 pixels.
  69.  
  70. <P>
  71. When rendering an image, it is often advantageous to split the image
  72. into a number of disjoint windows, each of which is rendered
  73. on a different machine.  One then combines the images corresponding to
  74. the windows into a final image.
  75.  
  76. <P>
  77. <DL>
  78. <DT><STRONG><#4618#><#4618#></STRONG></DT>
  79. <DD><#1165#><TT>window</TT><#1165#> <#1166#><EM>minx maxx miny maxy</EM><#1166#> 
  80. <BR>    Render the image in the given window.
  81. </DD>
  82. </DL>The window must be properly
  83. contained within the screen, i.e., <#141#><EM>minx</EM><#141#> and <#142#><EM>miny</EM><#142#> must
  84. be greater than or equal to zero, while <#143#><EM>maxx</EM><#143#> and
  85. <#144#><EM>maxy</EM><#144#> must be less than <#145#><EM>xsize</EM><#145#> and <#146#><EM>ysize</EM><#146#>, respectively.
  86. The Utah Raster tool
  87. <#147#><EM>rlecomp</EM><#147#> is useful for reconstructing the full image from
  88. sub-images.
  89. By default, the window
  90. is equivalent to the entire screen.
  91.  
  92. <P>
  93. It is also convenient to be able to render a small portion
  94. of the window by specifying a subregion using normalized coordinates.
  95.  
  96. <P>
  97. <DL>
  98. <DT><STRONG><#4619#><#4619#></STRONG></DT>
  99. <DD><#1169#><TT>crop</TT><#1169#> <#1170#><EM>left right bottom top</EM><#1170#> 
  100. <BR>    Crop the rendering window.
  101. </DD>
  102. </DL>The rendering window is cropped by rendering the screen
  103. area that falls within <tex2html_verbatim_mark>#math47#<I>minx</I> + <I>left</I>(<I>maxx</I> - <I>minx</I>) and
  104. <tex2html_verbatim_mark>#math48#<I>minx</I> + <I>right</I>(<I>maxx</I> - <I>minx</I>) in the <I>X</I> direction, and similarly
  105. for the <I>Y</I> direction.
  106. <#152#><EM>Left</EM><#152#> and <#153#><EM>bottom</EM><#153#> must be greater than or equal to zero.
  107. <#154#><EM>Right</EM><#154#> and <#155#><EM>top</EM><#155#> must be less than or equal to one.
  108. If <#156#><EM>left</EM><#156#> is greater than <#157#><EM>right</EM><#157#>, the two values are
  109. swapped, and similarly for <#158#><EM>bottom</EM><#158#> and <#159#><EM>top</EM><#159#>.
  110.  
  111. <P>
  112. <#160#><EM>Gamma correction</EM><#160#> may also be applied to the three output color
  113. channels.  See Appendix A for more details.
  114.  
  115. <P>
  116.