with Interfaces; use Interfaces;
with System; use System;
package Scale_X is
pragma Pure;
-- Scales source 2x to destination.
--
-- dst : address of destination bitmap
-- dstXres : width in pixels of destination bitmap
-- src : address of source bitmap
-- srcXres : width in pixels of source bitmap
-- width : width of top left area in source bitmap to scale
-- height : height of top left area in source bitmap to scale
procedure Scale2x( dst : Address;
dstXres : Unsigned_32;
src : Address;
srcXres : Unsigned_32;
width,
height : Positive );
pragma Precondition( dst /= Null_Address );
pragma Precondition( src /= Null_Address );
pragma Precondition( Unsigned_32(width) <= srcXres );
pragma Precondition( dstXres >= Unsigned_32(width) * 2 );
-- Scales source 3x to destination.
--
-- dst : address of destination bitmap
-- dstXres : width in pixels of destination bitmap
-- src : address of source bitmap
-- srcXres : width in pixels of source bitmap
-- width : width of top left area in source bitmap to scale
-- height : height of top left area in source bitmap to scale
procedure Scale3x( dst : Address;
dstXres : Unsigned_32;
src : Address;
srcXres : Unsigned_32;
width,
height : Positive );
pragma Precondition( dst /= Null_Address );
pragma Precondition( src /= Null_Address );
pragma Precondition( Unsigned_32(width) <= srcXres );
pragma Precondition( dstXres >= Unsigned_32(width) * 3 );
-- Scales source 4x to destination, returning True on success. This function
-- essentially applies the scale2x function twice. The function could
-- possibly fail there isn't enough memory available for a temporary bitmap.
--
-- dst : address of destination bitmap
-- dstXres : width in pixels of destination bitmap
-- src : address of source bitmap
-- srcXres : width in pixels of source bitmap
-- width : width of top left area in source bitmap to scale
-- height : height of top left area in source bitmap to scale
function Scale4x( dst : Address;
dstXres : Unsigned_32;
src : Address;
srcXres : Unsigned_32;
width,
height : Positive ) return Boolean;
pragma Precondition( dst /= Null_Address );
pragma Precondition( src /= Null_Address );
pragma Precondition( Unsigned_32(width) <= srcXres );
pragma Precondition( dstXres >= Unsigned_32(width) * 4 );
-- Scales source 2x wide by 3x high to destination.
--
-- dst : address of destination bitmap
-- dstXres : width in pixels of destination bitmap
-- src : address of source bitmap
-- srcXres : width in pixels of source bitmap
-- width : width of top left area in source bitmap to scale
-- height : height of top left area in source bitmap to scale
procedure Scale2x3( dst : Address;
dstXres : Unsigned_32;
src : Address;
srcXres : Unsigned_32;
width,
height : Positive );
pragma Precondition( dst /= Null_Address );
pragma Precondition( src /= Null_Address );
pragma Precondition( Unsigned_32(width) <= srcXres );
pragma Precondition( dstXres >= Unsigned_32(width) * 2 );
-- Scales source 2x wide by 4x high to destination.
--
-- dst : address of destination bitmap
-- dstXres : width in pixels of destination bitmap
-- src : address of source bitmap
-- srcXres : width in pixels of source bitmap
-- width : width of top left area in source bitmap to scale
-- height : height of top left area in source bitmap to scale
procedure Scale2x4( dst : Address;
dstXres : Unsigned_32;
src : Address;
srcXres : Unsigned_32;
width,
height : Positive );
pragma Precondition( dst /= Null_Address );
pragma Precondition( src /= Null_Address );
pragma Precondition( Unsigned_32(width) <= srcXres );
pragma Precondition( dstXres >= Unsigned_32(width) * 2 );
end Scale_X;