📄 1172-1173.html
字号:
<HTML>
<HEAD>
<TITLE>Linux Complete Command Reference:File Formats:EarthWeb Inc.-</TITLE>
</HEAD>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!-- ISBN=0672311046 //-->
<!-- TITLE=Linux Complete Command Reference//-->
<!-- AUTHOR=Red Hat//-->
<!-- PUBLISHER=Macmillan Computer Publishing//-->
<!-- IMPRINT=Sams//-->
<!-- CHAPTER=05 //-->
<!-- PAGES=1103-1208 //-->
<!-- UNASSIGNED1 //-->
<!-- UNASSIGNED2 //-->
<P><CENTER>
<a href="1168-1171.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="1174-1175.html">Next</A></CENTER></P>
<A NAME="PAGENUM-1172"><P>Page 1172</P></A>
<P><B>
DESCRIPTION
</B></P>
<P>The portable graymap format is a lowest common denominator grayscale file format. The definition is as follows:
</P>
<P>A "magic number" for identifying the file type. A
pgm file's magic number is the two characters P2.
</P>
<P>Whitespace (blanks, Tabs, CRs, LFs).
</P>
<P>A width, formatted as ASCII characters in decimal.
</P>
<P>Whitespace.
</P>
<P>A height, again in ASCII decimal.
</P>
<P>Whitespace.
</P>
<P>The maximum gray value, again in ASCII decimal.
</P>
<P>Whitespace.
</P>
<P>Width * height gray values, each in ASCII decimal, between
0 and the specified maximum value, separated by
whitespace, starting at the top-left corner of the graymap, proceeding in normal English reading order. A value of
0 means black, and the maximum value means white.
</P>
<P>Characters from a # to the next end-of-line are ignored (comments).
</P>
<P>No line should be longer than 70 characters.
</P>
<P>Here is an example of a small graymap in this format:
</P>
<!-- CODE //-->
<PRE>
P2
# feep.pgm
24 7
15
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 3 3 3 3 0 0 7 7 7 7 0 0 11 11 1111 0 0 15 1515 15 0
0 3 0 0 0 0 0 7 0 0 0 0 0 11 0 0 0 0 0 15 0 0 150
0 3 3 3 0 0 0 7 7 7 0 0 0 11 11 110 0 0 15 15 15 150
0 3 0 0 0 0 0 7 0 0 0 0 0 11 0 0 0 0 0 15 0 0 0 0
0 3 0 0 0 0 0 7 7 7 7 0 0 11 11 1111 0 0 15 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
</PRE>
<!-- END CODE //-->
<P>Programs that read this format should be as lenient as possible, accepting anything that looks remotely like a graymap.
</P>
<P>There is also a variant on the format, available by setting the
RAWBITS option at compile time. This variant is different in
the following ways:
</P>
<P>The "magic number" is P5 instead of
P2.
</P>
<P>The gray values are stored as plain bytes, instead of ASCII decimal.
</P>
<P>No whitespace is allowed in the grays section, and only a single character of whitespace (typically a newline) is allowed
after the maxval.
</P>
<P>The files are smaller and many times faster to read and write.
</P>
<P>Note that this raw format can only be used for maxvals less than or equal to
255. If you use the pgm library and try to write a file with a larger maxval, it will automatically fall back on the slower but more general plain format.
</P>
<P><B>
SEE ALSO
</B></P>
<!-- CODE //-->
<PRE>
fitstopgm(1), fstopgm(1), hipstopgm(1), lispmtopgm(1), psidtopgm(1), rawtopgm(1), pgmbentley(1), pgmcrater(1), pgmedge(1),
pgmenhance(1), pgmhist(1), pgmnorm(1), pgmoil(1), pgmramp(1), pgmtexture(1), pgmtofits(1), pgmtofs(1), pgmtolispm(1),
pgmtopbm(1), pnm(5), pbm(5), ppm(5)
</PRE>
<!-- END CODE //-->
<P><B>
AUTHOR
</B></P>
<P>Copyright 1989, 1991 by Jef Poskanzer.
</P>
<P>12 November 1991
</P>
<A NAME="PAGENUM-1173"><P>Page 1173</P></A>
<H3><A NAME="ch05_ 46">
pnm
</A></H3>
<P>pnm—Portable anymap file format.
</P>
<P><B>
DESCRIPTION
</B></P>
<P>The pnm programs operate on portable bitmaps, graymaps, and pixmaps produced by the
pbm, pgm, and ppm segments. There is no file format associated with
pnm itself.
</P>
<P><B>
SEE ALSO
</B></P>
<!-- CODE //-->
<PRE>
anytopnm(1), rasttopnm(1), tifftopnm(1),xwdtopnm(1), pnmtops(1), pnmtorast(1), pnmtotiff(1), pnmtoxwd(1), pnmarith(1),
pnmcat(1), pnmconvol(1), pnmcrop(1), pnmcut(1), pnmdepth(1), pnmenlarge(1), pnmfile(1), pnmflip(1), pnmgamma(1), pnmindex(1),
pnminvert(1), pnmmargin(1), pnmnoraw(1), pnmpaste(1), pnmrotate(1), pnmscale(1), pnmshear(1), pnmsmooth(1), pnmtile(1),
ppm(5), pgm(5), pbm(5)
</PRE>
<!-- END CODE //-->
<P><B>
AUTHOR
</B></P>
<P>Copyright 1989, 1991 by Jef Poskanzer.
</P>
<P>27 September 1991
</P>
<H3><A NAME="ch05_ 47">
ppm
</A></H3>
<P>ppm—Portable pixmap file format.
</P>
<P><B>
DESCRIPTION
</B></P>
<P>The portable pixmap format is a lowest common denominator color image file format. The definition is as follows:
</P>
<P>A "magic number" for identifying the file type. A
ppm file's magic number is the two characters P3.
</P>
<P>Whitespace (blanks, Tabs, CRs, LFs).
</P>
<P>A width, formatted as ASCII characters in decimal.
</P>
<P>Whitespace.
</P>
<P>A height, again in ASCII decimal.
</P>
<P>Whitespace.
</P>
<P>The maximum color-component value, again in ASCII decimal.
</P>
<P>Whitespace.
</P>
<P>Width * height pixels, each three ASCII decimal values between
0 and the specified maximum value, starting at the
top-left corner of the pixmap, proceeding in normal English reading order. The three values for each pixel represent red, green,
and blue; a value of 0 means that color is off, and the maximum value means that color is maxed out.
</P>
<P>Characters from a # to the next end-of-line are ignored (comments).
</P>
<P>No line should be longer than 70 characters.
</P>
<P>Here is an example of a small pixmap in this format:
</P>
<!-- CODE //-->
<PRE>
P3
# feep.ppm
4 4
15
0 0 0 0 0 0 0 0 0 15 0 15
0 0 0 0 15 7 0 0 0 0 0 0
0 0 0 0 0 0 0 15 7 0 0 0
15 0 150 0 0 00 0 0 0 0
</PRE>
<!-- END CODE //-->
<P>Programs that read this format should be as lenient as possible, accepting anything that looks remotely like a pixmap.
</P>
<P><CENTER>
<a href="1168-1171.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="1174-1175.html">Next</A></CENTER></P>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -