about summary refs log tree commit diff
path: root/pamendian.html
blob: 74f928acc10afad3ef225d00190ee3d8d0470749 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML><HEAD><TITLE>Pamendian User Manual</TITLE></HEAD>
<BODY>
<H1>pamendian</H1>
Updated: 16 March 2002
<BR>
<A HREF="#index">Table Of Contents</A>

<H2>NAME</H2>

pamendian - reverse endianness of a Netpbm image

<H2 id="synopsis">SYNOPSIS</H2>

<B>pamendian</B>

<H2 id="description">DESCRIPTION</H2>

<p>This program is part of <a href="index.html">Netpbm</a>.

<p>All Netpbm formats that have samples in pure binary format with multiple
bytes are defined to have them in big endian (most significant byte first)
order.  However, there exist variations on these formats, primarily developed
before official multibyte Netpbm formats existed, that are identical to 
Netpbm formats in every respect except that samples are in little endian
(least signficant byte first) order.

<P><B>pamendian</B> reverses the byte order of the sample to convert
between the two formats.  If the input is true PAM, PGM, or PPM, the
output is the little endian variation on that format, and vice versa.

<p>The X Window System viewer <b>xv</b> expects the little endian variation
of PGM and PPM.

<P>Programs that come with the Independent Jpeg Group's JPEG library
are known to use the little endian variation of PGM and PPM.

<p>The reason some programs use this variant is that at one time
during Netpbm's <a
href="http://netpbm.sourceforge.net/history.html">dark age</a>, there
was a version of Netpbm around that used it.  But it was never
formally specified.

<P>This program takes input only on Standard Input.  Its output is
always on Standard Output.

<P>You should never have to use this program with images generated by
programs in the Netpbm package or programs that use the Netpbm
libraries.  If you do, that probably means something needs to be fixed
in those programs.  The Netpbm converter for any graphics format that
represents numbers in little endian form should properly reverse the
bytes to create correct Netpbm output.

<P>If you create a Netpbm image from a generic stream of samples,
using <B>rawtopgm</B> or <B>rawtoppm</B>, use options on those
programs to declare the endianness of your input, thus creating
correct endianness in your PGM or PPM output.

<H2 id="seealso">SEE ALSO</H2>

<B><A HREF="pamdepth.html">pamdepth</A></B>,
<B><A HREF="rawtopgm.html">rawtopgm</A></B>,
<B><A HREF="rawtoppm.html">rawtoppm</A></B>,
<B><A HREF="pnm.html">pnm</A></B>

<HR>
<H2 id="index">Table Of Contents</H2>
<UL>
<LI><A HREF="#synopsis">SYNOPSIS</A>
<LI><A HREF="#description">DESCRIPTION</A>
<LI><A HREF="#seealso">SEE ALSO</A>
</UL>
</BODY>
</HTML>