Pnm.xml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <?xml-stylesheet type="text/xsl" href="../Xsl/doc2html.xsl"?>
  3. <doc>
  4. <title>Portable Maps</title>
  5. <chapter>
  6. <title>Portable Maps</title>
  7. <par>
  8. <b>Portable Maps</b> or <b>AnyMaps</b> (<b>PNM</b>) is collective
  9. name refering to family
  10. of very similar raster file formats. Their format is very simple
  11. and most of them contain just two-byte Id, Width, Height, and raster data.
  12. Data can be stored in binary format or in text format (whick produces
  13. very large files). Most formats can store images with 8 or 16 bit channels
  14. but not all viewer and editor programs support 16 bit PNMs (or binary ones).
  15. Imaging supports five PNM formats where <b>PBM</b>, <b>PGM</b>, and <b>PPM</b>
  16. are quite common
  17. but <b>PAM</b> and <b>PFM</b> are somewhat rare.
  18. </par>
  19. <blist>
  20. <li>
  21. <par>
  22. <keyword>PBM - Portable Bit Map</keyword>
  23. stores monochrome 1bit images. Raster data
  24. can be saved as text or binary data. Either way value of 0 represents white
  25. and 1 is black. As Imaging does not have support for 1bit data formats
  26. PBM images can be loaded but not saved. Loaded images are returned in
  27. ifGray8 format (witch pixel values scaled from 1bit to 8bit).
  28. </par>
  29. </li>
  30. <li>
  31. <par>
  32. <keyword>PBM - Portable Gray Map</keyword>
  33. stores grayscale 8bit or 16bit images. Raster data can be
  34. saved as text or binary data.
  35. </par>
  36. </li>
  37. <li>
  38. <par>
  39. <keyword>PPM - Portable Pixel Map</keyword>
  40. stores RGB images with 8bit or 16bit channels.
  41. Raster data can be saved as text or binary data.
  42. </par>
  43. </li>
  44. <li>
  45. <par>
  46. <keyword>PAM - Portable Arbitrary Map</keyword>
  47. is more complex format that can store image data formats
  48. of PBM, PGM, and PPM formats with optional alpha channel. Raster data
  49. can be stored only in binary format.
  50. </par>
  51. </li>
  52. <li>
  53. <par>
  54. <keyword>PFM - Portable Float Map</keyword>
  55. is unofficial extension of PNM format family which
  56. can store images with floating point pixels. Raster data is saved in
  57. binary format as array of IEEE 32 bit floating point numbers. One channel
  58. or RGB images are supported by PFM format (so no alpha).
  59. </par>
  60. </li>
  61. </blist>
  62. <par>
  63. There is a complete list of data formats supported by PNM file formats,
  64. their Imaging equivalents, and load/cave capability.
  65. </par>
  66. <table>
  67. <title>Portable Maps File Format Support</title>
  68. <row>
  69. <th>Format</th>
  70. <th>TImageFormat equivalent</th>
  71. <th>Loading</th>
  72. <th>Saving</th>
  73. <th>Supported By Map Format</th>
  74. </row>
  75. <row>
  76. <td>1 bit mono</td>
  77. <td><icode>ifGray8</icode></td>
  78. <td>Yes</td><td>No</td>
  79. <td>PBM, PAM</td>
  80. </row>
  81. <row>
  82. <td>1bit mono + alpha</td>
  83. <td><icode>ifA8Gray8</icode></td>
  84. <td>Yes</td><td>No</td>
  85. <td>PAM</td>
  86. </row>
  87. <row>
  88. <td>8 bit grayscale</td>
  89. <td><icode>ifGray8</icode></td>
  90. <td>Yes</td><td>Yes</td>
  91. <td>PGM, PAM</td>
  92. </row>
  93. <row>
  94. <td>16 bit grayscale</td>
  95. <td><icode>ifGray16</icode></td>
  96. <td>Yes</td><td>Yes</td>
  97. <td>PGM, PAM</td>
  98. </row>
  99. <row>
  100. <td>8 bit grayscale + alpha</td>
  101. <td><icode>ifA8Gray8</icode></td>
  102. <td>Yes</td><td>Yes</td>
  103. <td>PAM</td>
  104. </row>
  105. <row>
  106. <td>16 bit grayscale + alpha</td>
  107. <td><icode>ifA16Gray16</icode></td>
  108. <td>Yes</td><td>Yes</td>
  109. <td>PAM</td>
  110. </row>
  111. <row>
  112. <td>24 bit RGB</td>
  113. <td><icode>ifR8G8B8</icode></td>
  114. <td>Yes</td><td>Yes</td>
  115. <td>PPM, PAM</td>
  116. </row>
  117. <row>
  118. <td>48 bit RGB</td>
  119. <td><icode>ifR16G16B16</icode></td>
  120. <td>Yes</td><td>Yes</td>
  121. <td>PPM, PAM</td>
  122. </row>
  123. <row>
  124. <td>32 bit ARGB</td>
  125. <td><icode>ifA8R8G8B8</icode></td>
  126. <td>Yes</td><td>Yes</td>
  127. <td>PAM</td>
  128. </row>
  129. <row>
  130. <td>64 bit ARGB</td>
  131. <td><icode>ifA16R16G16B16</icode></td>
  132. <td>Yes</td><td>Yes</td>
  133. <td>PAM</td>
  134. </row>
  135. <row>
  136. <td>32 bit R FP32</td>
  137. <td><icode>ifR32F</icode></td>
  138. <td>Yes</td><td>Yes</td>
  139. <td>PFM</td>
  140. </row>
  141. <row>
  142. <td>96 bit RGB FP32</td>
  143. <td><icode>ifA32R32G32B32F</icode></td>
  144. <td>Yes</td><td>Yes</td>
  145. <td>PFM</td>
  146. </row>
  147. </table>
  148. <par>
  149. When working with PNM files you can find useful some options
  150. which can be set by <ref>SetOption</ref> function and their current values
  151. can be get by <ref>GetOption</ref> function.
  152. Or you can set them by modifying properties of <ref>TPGMFileFormat</ref>
  153. and <ref>TPPMFileFormat</ref> classes.
  154. </par>
  155. <table>
  156. <title>Options Related to PNM Files</title>
  157. <row>
  158. <th>OptionId</th>
  159. <th>Allowed Values</th>
  160. <th>Usage</th>
  161. </row>
  162. <row>
  163. <td><ref>ImagingPGMSaveBinary</ref></td>
  164. <td><b>0 (false)</b> or <b>1 (true)</b></td>
  165. <td>If set to True PGM images will be saved in binary format, otherwise
  166. they will be saved in text format (which could result in 5-10x bigger file).
  167. Default value is <b>1 (true)</b>. </td>
  168. </row>
  169. <row>
  170. <td><ref>ImagingPPMSaveBinary</ref></td>
  171. <td><b>0 (false)</b> or <b>1 (true)</b></td>
  172. <td>If set to True PPM images will be saved in binary format, otherwise
  173. they will be saved in text format (which could result in 5-10x bigger file).
  174. Default value is <b>1 (true)</b>. </td>
  175. </row>
  176. </table>
  177. </chapter>
  178. </doc>