diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2025-04-11 22:21:26 +1200 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2025-04-11 22:21:26 +1200 |
commit | fb4183c9244ee31aa5cb8bc9745c9242b1fafeeb (patch) | |
tree | a33c13dd090a1798a6638b9762dcc7187438f980 /doc | |
parent | 192b9538fcbe46649dccd44b499a0d52d17cf283 (diff) |
Moved Size_Type to FLTK and better incorporated it into Bitmaps and RGB_Images
Diffstat (limited to 'doc')
-rw-r--r-- | doc/fl.html | 10 | ||||
-rw-r--r-- | doc/fl_bitmap.html | 33 | ||||
-rw-r--r-- | doc/fl_draw.html | 12 | ||||
-rw-r--r-- | doc/fl_rgb_image.html | 25 |
4 files changed, 54 insertions, 26 deletions
diff --git a/doc/fl.html b/doc/fl.html index 9cefff7..96bb11d 100644 --- a/doc/fl.html +++ b/doc/fl.html @@ -51,6 +51,16 @@ <td>Menu_Flag</td> </tr> + <tr> + <td>size_t</td> + <td>Size_Type</td> + </tr> + + <tr> + <td>size_t</td> + <td>Positive_Size</td> + </tr> + </table> diff --git a/doc/fl_bitmap.html b/doc/fl_bitmap.html index 922b1b5..edaf6a4 100644 --- a/doc/fl_bitmap.html +++ b/doc/fl_bitmap.html @@ -62,31 +62,31 @@ const uchar * array; <td><pre> function Data_Size (This : in Bitmap) - return Natural; + return Size_Type; function Get_Datum (This : in Bitmap; - Place : in Positive) + Place : in Positive_Size) return Color_Component with Pre => Place <= This.Data_Size; procedure Set_Datum (This : in out Bitmap; - Place : in Positive; + Place : in Positive_Size; Value : in Color_Component) with Pre => Place <= This.Data_Size; function Slice (This : in Bitmap; - 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 Bitmap; - Place : in Positive; + Place : in Positive_Size; Values : in Color_Component_Array) with Pre => Place + Values'Length - 1 <= This.Data_Size; @@ -115,7 +115,24 @@ function Create (Data : in Color_Component_Array; Width, Height : in Natural) return Bitmap -with Pre => Data'Length = To_Next_Byte (Width) * Height; +with Pre => + Data'Length >= Size_Type (Bytes_Needed (Width)) * Size_Type (Height); +</pre></td> + </tr> + +</table> + + + +<table class="function"> + <tr><th colspan="2">Static Functions and Procedures</th></tr> + + <tr> +<td> </td> +<td><pre> +function Bytes_Needed + (Bits : in Natural) + return Natural; </pre></td> </tr> diff --git a/doc/fl_draw.html b/doc/fl_draw.html index 55b08bd..aca154a 100644 --- a/doc/fl_draw.html +++ b/doc/fl_draw.html @@ -419,8 +419,8 @@ procedure Draw_Image Flip_Horizontal : in Boolean := False; Flip_Vertical : in Boolean := False) with Pre => (if Line_Size = 0 - then Data'Length >= W * H * Depth - else Data'Length >= Line_Size * H); + then Data'Length >= Size_Type (W) * Size_Type (H) * Size_Type (Depth) + else Data'Length >= Size_Type (Line_Size) * Size_Type (H)); </pre></td> </tr> @@ -451,8 +451,8 @@ procedure Draw_Image_Mono Flip_Horizontal : Boolean := False; Flip_Vertical : Boolean := False) with Pre => (if Line_Size = 0 - then Data'Length >= W * H * Depth - else Data'Length >= Line_Size * H); + then Data'Length >= Size_Type (W) * Size_Type (H) * Size_Type (Depth) + else Data'Length >= Size_Type (Line_Size) * Size_Type (H)); </pre></td> </tr> @@ -916,8 +916,8 @@ function Read_Image return Color_Component_Array with Post => (if Alpha = 0 - then Read_Image'Result'Length = W * H * 3 - else Read_Image'Result'Length = W * H * 4); + then Read_Image'Result'Length = Size_Type (W) * Size_Type (H) * 3 + else Read_Image'Result'Length = Size_Type (W) * Size_Type (H) * 4); </pre></td> </tr> 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; <td><pre> 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; <tr> <td><pre> -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); </pre></td> <td><pre> 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; </pre></td> </tr> @@ -147,7 +148,7 @@ static void max_size(size_t size); </pre></td> <td><pre> procedure Set_Max_Size - (Value : in Natural); + (Value : in Size_Type); </pre></td> </tr> @@ -157,7 +158,7 @@ static size_t max_size(); </pre></td> <td><pre> function Get_Max_Size - return Natural; + return Size_Type; </pre></td> </tr> |