-- $Date: 2004/03/08 11:09:21 $
-- $Revision: 1.17 $
-- $Author: jcrocholl $

with Images; use Images;

package Gray_Images is

   -- A gray pixel, represented by an octet (values 0 .. 255).
   type Gray_Pixel is mod 256;

   Black : constant Gray_Pixel := 0;
   Gray  : constant Gray_Pixel := 128;
   White : constant Gray_Pixel := 255;

   -- Compare two gray pixels.
   function Darker
     (A, B : in Gray_Pixel-- Compare these pixels.
     return Boolean;        -- True if A is darker than B.

   -- An unconstrained one-dimensional array of gray pixels.
   type Gray_Pixel_Array is
     array(Positive range <>) of Gray_Pixel;
   pragma Pack(Gray_Pixel_Array);

   -- An unconstrained two-dimensional array of gray pixels.
   type Gray_Pixel_Array_2 is
     array(Positive range <>, Positive range <>) of Gray_Pixel;
   pragma Pack(Gray_Pixel_Array_2);

   -- A gray image of the size specified by Width and Height.
   type Gray_Image(Width, Height : Positive) is
     new Image(Width, Height) with
      record
         Pixels : Gray_Pixel_Array_2(1 .. Height, 1 .. Width);
      end record;

   -- Access type for Gray_Image_Record and all inherited types.
   type Gray_Image_Access is access all Gray_Image'Class;

   -- Solid color background fill.
   procedure Fill
     (This  : access Gray_Image-- Fill this image.
      Color : in Gray_Pixel);    -- With this color.

end Gray_Images;