with Allegro.Bitmaps; use Allegro.Bitmaps;
package Scaling is
type Filter_Type is
(
Filter_Nearest, -- effectively no filter
Filter_Quality, -- choose best looking filter
Filter_HQX,
Filter_2xSaI,
Filter_Eagle,
Filter_ScaleX
);
INIT_EXCEPTION : exception;
----------------------------------------------------------------------------
-- Raises INIT_EXCEPTION with message if not successful.
procedure Initialize( color_depth : Integer );
procedure Finalize;
-- Scales the upper left corner of the source bitmap onto the upper left
-- corner of the destination bitmap. The filter type is used to do the
-- scale if it is available for the given magnification. If the requested
-- filter can't scale to the requested magnification, the default filter
-- is used. Note: This procedure is not thread-safe.
procedure Scale( src,
dst : not null A_Bitmap;
src_width,
src_height : Positive;
magnification : Float;
filter : Filter_Type := Filter_Nearest );
-- Filter names are Filter_Type members without the Filter_ prefix. If the
-- name doesn't match a filter, 'default' will be returned.
function To_Filter( name : String;
default : Filter_Type := Filter_Type'First
) return Filter_Type;
end Scaling;