Hosted by
|
with Ada.Exceptions; use Ada.Exceptions;
with PNM; use PNM;
package body PBM is
PBM_Magic : constant String := "P4";
procedure Read_Header
(Stream : in Stream_Access;
Width : out Positive;
Height : out Positive)
is
Magic : String2;
begin
Read_Header(Stream, Magic, Width, Height);
if Magic /= PBM_Magic then
Raise_Exception(Expect_P4'Identity,
"not a PBM file: expected """ & PBM_Magic &
""" but found """ & Magic & """");
end if;
end Read_Header;
procedure Write_Header
(Stream : in Stream_Access;
Width : in Positive;
Height : in Positive) is
begin
Write_Header(Stream, PBM_Magic, Width, Height);
end Write_Header;
end PBM;
|