aboutsummaryrefslogtreecommitdiff
path: root/test/animated.adb
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2025-04-11 22:21:26 +1200
committerJedidiah Barber <contact@jedbarber.id.au>2025-04-11 22:21:26 +1200
commitfb4183c9244ee31aa5cb8bc9745c9242b1fafeeb (patch)
treea33c13dd090a1798a6638b9762dcc7187438f980 /test/animated.adb
parent192b9538fcbe46649dccd44b499a0d52d17cf283 (diff)
Moved Size_Type to FLTK and better incorporated it into Bitmaps and RGB_Images
Diffstat (limited to 'test/animated.adb')
-rw-r--r--test/animated.adb19
1 files changed, 11 insertions, 8 deletions
diff --git a/test/animated.adb b/test/animated.adb
index 4a5b570..4f6f590 100644
--- a/test/animated.adb
+++ b/test/animated.adb
@@ -34,7 +34,8 @@ is
Dimension : constant Integer := 256;
- subtype Image_Data is FLTK.Color_Component_Array (1 .. Dimension ** 2 * Channels);
+ subtype Image_Data is FLTK.Color_Component_Array
+ (1 .. FLTK.Size_Type (Dimension ** 2 * Channels));
type Image_Data_Array is array (Positive range <>) of Image_Data;
@@ -43,7 +44,7 @@ is
begin
for X in Integer range 0 .. 9 loop
for Y in Integer range 0 .. 9 loop
- Store (Y * Dimension * Channels + X * Channels + 4) := 255;
+ Store (FLTK.Size_Type (Channels * (Y * Dimension + X) + 4)) := 255;
end loop;
end loop;
end Black_Box_Corner;
@@ -82,10 +83,10 @@ is
My_Alpha := FLTK.Color_Component (Float (My_Alpha) * (1.0 - Fill) * 10.0);
end if;
- Store (Y * Dimension * Channels + X * Channels + 1) := Grey;
- Store (Y * Dimension * Channels + X * Channels + 2) := Grey;
- Store (Y * Dimension * Channels + X * Channels + 3) := Grey;
- Store (Y * Dimension * Channels + X * Channels + 4) := My_Alpha;
+ Store (FLTK.Size_Type (Channels * (Y * Dimension + X) + 1)) := Grey;
+ Store (FLTK.Size_Type (Channels * (Y * Dimension + X) + 2)) := Grey;
+ Store (FLTK.Size_Type (Channels * (Y * Dimension + X) + 3)) := Grey;
+ Store (FLTK.Size_Type (Channels * (Y * Dimension + X) + 4)) := My_Alpha;
end if;
end loop;
end loop;
@@ -106,8 +107,10 @@ is
if (X + X_Offset >= 0) and (X + X_Offset < Dimension) then
for Y in Integer range Y_Offset - W .. Y_Offset + W - 1 loop
Grey := FLTK.Color_Component (abs (Y - Y_Offset));
- Store (Y * Dimension * Channels + (X + X_Offset) * Channels + 3) := Grey;
- Store (Y * Dimension * Channels + (X + X_Offset) * Channels + 4) := 127;
+ Store (FLTK.Size_Type
+ (Channels * (Y * Dimension + (X + X_Offset)) + 3)) := Grey;
+ Store (FLTK.Size_Type
+ (Channels * (Y * Dimension + (X + X_Offset)) + 4)) := 127;
end loop;
end if;
end loop;