-- $Date: 2004/03/05 07:40:04 $
-- $Revision: 1.1 $
-- $Author: jcrocholl $

with Ada.Unchecked_Deallocation;

package body Depixel is

   -- Create a bit buffer with a capacity of 8 * Byte_Count bits.
   function Create
     (Byte_Count : in Positive-- The number of bytes in the buffer.
     return Bit_Buffer_Access   -- The newly created bit buffer.
   is
      Result : Bit_Buffer_Access := new Bit_Buffer(Byte_Count);
   begin
      for Index in Natural_Triple loop
         Result.Internal(Index) := Bit_Buffers.Create(Byte_Count);
      end loop;

      for Index in Natural_Triple loop
         Clear(Result);
      end loop;

      return Result;
   end Create;