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

-- with Messages; use Messages;
-- with Integer_Strings; use Integer_Strings;

package body Gray_Images is

   -- Compare two gray pixels.
   function Darker
     (A, B : in Gray_Pixel-- Compare these pixels.
     return Boolean         -- A is darker than B.
   is
      use type Gray_Pixel;
      Int_A : Integer := Integer(A);
      Int_B : Integer := Integer(B);
   begin
      if Int_A < 0 then
         -- Debug("A < 0:" & To_String(Int_A));
         Int_A := Int_A + 256;
      end if;

      if Int_B < 0 then
         -- Debug("B < 0:" & To_String(Int_B));
         Int_B := Int_B + 256;
      end if;

      return Int_A < Int_B;
   end Darker;

   -- Solid color background fill.
   procedure Fill
     (This  : access Gray_Image-- Fill this image.
      Color : in Gray_Pixel) is  -- With this color.
   begin
      This.Pixels := (others => (others => 255));
   end Fill;

end Gray_Images;