-- $Date: 2003/12/30 04:54:08 $
-- $Revision: 1.6 $
-- $Author: jcrocholl $

with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO;

package PNM is

   -- A string of 2 characters. Used for magic numbers in PNM files.
   subtype String2 is String(1 .. 2);

   ----------------------
   -- Headers with Maxval
   ----------------------

   -- Read a PNM file header, with Maxval (for PGM and PPM).
   procedure Read_Header
     (Stream : in Stream_Access-- Read from this stream.
      Magic  : out String2;      -- Magic number for PNM file type.
      Width  : out Positive;     -- Width of the image in pixels.
      Height : out Positive;     -- Height of the image in pixels.
      Maxval : out Positive);    -- Maximum pixel component value.

   -- Write a PNM file header, with Maxval (for PGM and PPM).
   procedure Write_Header
     (Stream : in Stream_Access-- Write to this stream.
      Magic  : in String2;       -- Magic number for PNM file type.
      Width  : in Positive;      -- Width of the image in pixels.
      Height : in Positive;      -- Height of the image in pixels.
      Maxval : in Positive);     -- Maximum pixel component value.

   -------------------------
   -- Headers without Maxval
   -------------------------

   -- Read a PNM file header, without Maxval (for PBM).
   procedure Read_Header
     (Stream : in Stream_Access-- Read from this stream.
      Magic  : out String2;      -- Magic number for PNM file type.
      Width  : out Positive;     -- Width of the image in pixels.
      Height : out Positive);    -- Height of the image in pixels.

   -- Write a PNM file header, without Maxval (for PBM).
   procedure Write_Header
     (Stream : in Stream_Access-- Write to this stream.
      Magic  : in String2;       -- Magic number for PNM file type.
      Width  : in Positive;      -- Width of the image in pixels.
      Height : in Positive);     -- Height of the image in pixels.

end PNM;