PFM man page on YellowDog

Man page or keyword search:  
man Server   18644 pages
apropos Keyword Search (all sections)
Output format
YellowDog logo
[printable version]


				  PFM Format

   This	 document  describes the PFM graphic image file format as
understood by
   the Netpbm converters pamtopfm and pfmtopam.

   There are multiple similar formats known as PFM in the  world,
none of them
   authoritatively  documented.	 The format described here is one
that Bryan
   Henderson deduced from a program he found somewhere that dealt
with a "PFM"
   format.

   The PFM format is inspired by the Netpbm formats, and you will
see lots of
   similarity. It is not, however, an official Netpbm format. Its
goal is not
   consistent with those of Netpbm formats.

The format

   A  PFM  image  is  a stream of bytes. The stream consists of a
header followed
   immediately by a raster. These two  components  are	described
below. There are
   no delimeters before or after the sections as described.

  PFM header

   The	PFM  header is 3 consecutive "lines" of ASCII text. After
each line is a
   white space character. That character is typically  a  newline
character,
   hence the term "line," but doesn’t have to be.

   pamtopfm uses a newline in the PFM it generates.

    Identifier Line

   The	identifier  line contains the characters "PF" or "Pf". PF
means it’s a
   color PFM. Pf means it’s a grayscale PFM.

    Dimensions Line

   The dimensions line contains two  positive  decimal	integers,
separated by a
   blank.  The first is the width of the image; the second is the
height. Both
   are in pixels.

    Scale Factor / Endianness

   The Scale Factor / Endianness line is a queer line  that  jams
endianness
   information into an otherwise sane description of a scale. The
line consists
   of a nonzero decimal number, not necessarily	 an  integer.  If
the number is
   negative,  that  means the PFM raster is little endian. Other‐
wise, it is big
   endian. The absolute value of the number is the  scale  factor
for the image.

   The scale factor tells the units of the samples in the raster.
You use
   somehow it along with some separately understood unit informa‐
tion to turn a
   sample  value  into	something  meaningful,	such as watts per
square meter.

  PFM raster

   The	raster is a sequence of pixels, packed one after another,
with no
   delimiters  of  any kind. They are in standard Western reading
order: left to
   right and top to bottom within the image.

   Each pixel consists of 1 or 3 samples, packed one after anoth‐
er, with no
   delimiters of any kind. 1 sample for a grayscale PFM and 3 for
a color PFM
   (see the Identifier Line of the PFM header).

   Each sample consists of 4 consecutive bytes. The bytes  repre‐
sent a 32 bit
   string,  in	either big endian or little endian format, as de‐
termined by the
   Scale Factor / Endianness line of the PFM header. That  string
is an IEEE 32
   bit	floating  point number code. Since that’s the same format
that most CPUs
   and compiler use, you can usually just make a program use  the
bytes directly
   as  a  floating point number, after taking care of the endian‐
ness variation.

[top]

List of man pages available for YellowDog

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net