From fb4183c9244ee31aa5cb8bc9745c9242b1fafeeb Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Fri, 11 Apr 2025 22:21:26 +1200 Subject: Moved Size_Type to FLTK and better incorporated it into Bitmaps and RGB_Images --- doc/fl_rgb_image.html | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'doc/fl_rgb_image.html') diff --git a/doc/fl_rgb_image.html b/doc/fl_rgb_image.html index 061b07a..6d5427d 100644 --- a/doc/fl_rgb_image.html +++ b/doc/fl_rgb_image.html @@ -62,31 +62,31 @@ const uchar * array;
 function Data_Size
        (This : in RGB_Image)
-    return Natural;
+    return Size_Type;
 
 function Get_Datum
        (This  : in RGB_Image;
-        Place : in Positive)
+        Place : in Positive_Size)
     return Color_Component
 with Pre => Place <= This.Data_Size;
 
 procedure Set_Datum
        (This  : in out RGB_Image;
-        Place : in     Positive;
+        Place : in     Positive_Size;
         Value : in     Color_Component)
 with Pre => Place <= This.Data_Size;
 
 function Slice
        (This : in RGB_Image;
-        Low  : in Positive;
-        High : in Natural)
+        Low  : in Positive_Size;
+        High : in Size_Type)
     return Color_Component_Array
 with Pre => High <= This.Data_Size,
-    Post => Slice'Result'Length = Integer'Max (0, High - Low + 1);
+    Post => Slice'Result'Length = Size_Type'Max (0, High - Low + 1);
 
 procedure Overwrite
        (This   : in out RGB_Image;
-        Place  : in     Positive;
+        Place  : in     Positive_Size;
         Values : in     Color_Component_Array)
 with Pre => Place + Values'Length - 1 <= This.Data_Size;
 
@@ -106,7 +106,8 @@ with Post => All_Data'Result'Length = This.Data_Size;
 
   
 
-Fl_RGB_Image(const uchar *bits, int W, int H, int D=3, int LD=0);
+Fl_RGB_Image(const uchar *bits, int W, int H,
+    int D=3, int LD=0);
 
 function Create
@@ -116,8 +117,8 @@ function Create
         Line_Size     : in Natural := 0)
     return RGB_Image
 with Pre => (if Line_Size = 0
-    then Data'Length = Width * Height * Depth
-    else Data'Length = Line_Size * Height)
+    then Data'Length >= Size_Type (Width) * Size_Type (Height) * Size_Type (Depth)
+    else Data'Length >= Size_Type (Line_Size) * Size_Type (Height))
     and Data'Length <= Get_Max_Size;
 
@@ -147,7 +148,7 @@ static void max_size(size_t size);
 procedure Set_Max_Size
-       (Value : in Natural);
+       (Value : in Size_Type);
 
@@ -157,7 +158,7 @@ static size_t max_size();
 function Get_Max_Size
-    return Natural;
+    return Size_Type;
 
-- cgit