From f18ea4474bb4905a00e0b39e7205c177ee994196 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Tue, 20 Feb 2024 18:04:23 +1300 Subject: Improved binding for the FLTK.Images package subtree --- doc/fl_bitmap.html | 21 ++++--- doc/fl_image.html | 142 ++++++++++++++++++++++++++++++++++++------- doc/fl_jpeg_image.html | 7 ++- doc/fl_pixmap.html | 9 ++- doc/fl_png_image.html | 10 +++- doc/fl_rgb_image.html | 64 ++++++++++++++------ doc/fl_shared_image.html | 153 ++++++++++++++++++++++++++--------------------- 7 files changed, 281 insertions(+), 125 deletions(-) (limited to 'doc') diff --git a/doc/fl_bitmap.html b/doc/fl_bitmap.html index 54f2ae1..57d8a2a 100644 --- a/doc/fl_bitmap.html +++ b/doc/fl_bitmap.html @@ -52,15 +52,15 @@
 Fl_Bitmap(const uchar *bits, int W, int H);
-
-  - - -
 Fl_Bitmap(const char *bits, int W, int H);
 
-  +
+function Create
+       (Data          : in Color_Component_Array;
+        Width, Height : in Natural)
+    return Bitmap;
+
@@ -113,21 +113,24 @@ procedure Draw
 virtual void label(Fl_Widget *w);
 
-  +Not applicable as the original is marked as obsolete
 virtual void label(Fl_Menu_Item *m);
 
-  +Not applicable as the original is marked as obsolete
 virtual void uncache();
 
-  +
+procedure Uncache
+       (This : in out Bitmap);
+
diff --git a/doc/fl_image.html b/doc/fl_image.html index 4addc4e..7838289 100644 --- a/doc/fl_image.html +++ b/doc/fl_image.html @@ -56,6 +56,55 @@ + + + + + + + + + + + + + + + + + + +
Errors
ERR_FILE_ACCESSFile_Access_Error
ERR_FORMATFormat_Error
ERR_NO_IMAGENo_Image_Error
+ + + + + + + + + + + + + + + + +
Static Functions and Procedures
+static void RGB_scaling(Fl_RGB_Scaling);
+
+procedure Set_Copy_Algorithm
+       (To : in Scaling_Kind);
+
+static Fl_RGB_Scaling RGB_scaling();
+
+function Get_Copy_Algorithm
+    return Scaling_Kind;
+
+ + + @@ -109,7 +158,20 @@ function Copy + + + + + @@ -127,7 +189,53 @@ function Get_D - + @@ -142,7 +250,8 @@ procedure Desaturate - + - + - - - - - - - - - - diff --git a/doc/fl_jpeg_image.html b/doc/fl_jpeg_image.html index a3f42f6..0bc768d 100644 --- a/doc/fl_jpeg_image.html +++ b/doc/fl_jpeg_image.html @@ -64,7 +64,12 @@ function Create - +
Functions and Procedures
 int count() const;
 
+function Get_Data_Count
+       (This : in Image)
+    return Natural;
+
 
+function Get_Data_Size
+       (This : in Image)
+    return Natural;
+
 const char * const * data() const;
 
 
+function Get_Datum
+       (This     : in Image;
+        Data     : in Positive;
+        Position : in Positive)
+    return Color_Component
+with Pre =>
+        Data <= Get_Data_Count (This) and
+        Position <= Get_Data_Size (This);
+
+procedure Set_Datum
+       (This     : in out Image;
+        Data     : in     Positive;
+        Position : in     Positive;
+        Value    : in     Color_Component)
+with Pre =>
+        Data <= Get_Data_Count (This) and
+        Position <= Get_Data_Size (This);
+
+function Get_Data
+       (This     : in Image;
+        Data     : in Positive;
+        Position : in Positive;
+        Count    : in Natural)
+    return Color_Component_Array
+with Pre =>
+        Data <= Get_Data_Count (This) and
+        Position <= Get_Data_Size (This) and
+        Count <= Get_Data_Size (This) - Position + 1;
+
+function All_Data
+       (This : in Image;
+        Data : in Positive)
+    return Color_Component_Array
+with Pre =>
+        Data <= Get_Data_Count (This);
+
+procedure Update_Data
+       (This     : in out Image;
+        Data     : in     Positive;
+        Position : in     Positive;
+        Values   : in     Color_Component_Array)
+with Pre =>
+        Data <= Get_Data_Count (This) and
+        Position <= Get_Data_Size (This) and
+        Values'Length <= Get_Data_Size (This) - Position + 1;
+
-virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0);
+virtual void draw(int X, int Y, int W, int H,
+    int cx=0, int cy=0);
 
 procedure Draw
@@ -210,48 +319,35 @@ procedure Inactive
 
 virtual void label(Fl_Widget *w);
 
 Not applicable as the original is marked as obsolete
 virtual void label(Fl_Menu_Item *m);
 
 Not applicable as the original is marked as obsolete
 int ld() const;
 
 
-static void RGB_scaling(Fl_RGB_Scaling);
-
-procedure Set_Copy_Algorithm
-       (To : in Scaling_Kind);
+function Get_Line_Data
+       (This : in Image)
+    return Natural;
 
-static Fl_RGB_Scaling RGB_scaling();
-
-function Get_Copy_Algorithm
-    return Scaling_Kind;
+virtual void uncache();
 
-virtual void uncache();
+procedure Uncache
+       (This : in out Image);
 
 
 Fl_JPEG_Image(const char *name, const unsigned char *data);
 
 
+function Create
+       (Name : in String := "";
+        Data : in Color_Component_Array)
+    return JPEG_Image;
+
diff --git a/doc/fl_pixmap.html b/doc/fl_pixmap.html index 50c8cb8..81d3cc5 100644 --- a/doc/fl_pixmap.html +++ b/doc/fl_pixmap.html @@ -131,21 +131,24 @@ procedure Draw
 virtual void label(Fl_Widget *w);
 
-  +Not applicable as the original is marked as obsolete
 virtual void label(Fl_Menu_Item *m);
 
-  +Not applicable as the original is marked as obsolete
 virtual void uncache();
 
-  +
+procedure Uncache
+       (This : in out Pixmap);
+
diff --git a/doc/fl_png_image.html b/doc/fl_png_image.html index c064ffe..7905098 100644 --- a/doc/fl_png_image.html +++ b/doc/fl_png_image.html @@ -62,9 +62,15 @@ function Create
-Fl_PNG_Image(const char *name, const unsigned char *buffer, int datasize);
+Fl_PNG_Image(const char *name, const unsigned char *buffer,
+    int datasize);
+
+
+function Create
+       (Name : in String := "";
+        Data : in Color_Component_Array)
+    return PNG_Image;
 
-  diff --git a/doc/fl_rgb_image.html b/doc/fl_rgb_image.html index 3ab1b01..f85686e 100644 --- a/doc/fl_rgb_image.html +++ b/doc/fl_rgb_image.html @@ -46,6 +46,33 @@ + + + + + + + + + + + + + +
Static Functions and Procedures
+static void max_size(size_t size);
+
+procedure Set_Max_Size
+       (Value : in Natural);
+
+static size_t max_size();
+
+function Get_Max_Size
+    return Natural;
+
+ + + @@ -53,14 +80,26 @@ - + - + @@ -135,35 +174,24 @@ procedure Draw - + - + - - - - - - - - - -
Functions and Procedures
 Fl_RGB_Image(const uchar *bits, int W, int H, int D=3, int LD=0);
 
 
+function Create
+       (Data          : in Color_Component_Array;
+        Width, Height : in Natural;
+        Depth         : in Natural := 3;
+        Line_Data     : in Natural := 0)
+    return RGB_Image;
+
 Fl_RGB_Image(const Fl_Pixmap *pxm, Fl_Color bg=FL_GRAY);
 
 
+function Create
+       (Data       : in FLTK.Images.Pixmaps.Pixmap;
+        Background : in Color := Background_Color)
+    return RGB_Image;
+
 virtual void label(Fl_Widget *w);
 
 Not applicable as the original is marked as obsolete
 virtual void label(Fl_Menu_Item *m);
 
 Not applicable as the original is marked as obsolete
-static void max_size(size_t size);
-
 
-static size_t max_size();
+virtual void uncache();
 
 
-virtual void uncache();
+procedure Uncache
+       (This : in out RGB_Image);
 
 
diff --git a/doc/fl_shared_image.html b/doc/fl_shared_image.html index 1dd8943..0c43ff7 100644 --- a/doc/fl_shared_image.html +++ b/doc/fl_shared_image.html @@ -47,31 +47,93 @@ - + - + + - + + + + + + + + + + + + + + + + + + + + + + + +
Functions and Procedures
Static Functions and Procedures
-Fl_Shared_Image();
+static void add_handler(Fl_Shared_Handler f);
 
 Documentation lacking, claims to be a test function yet used for adding extra formats?
-Fl_Shared_Image(const char *n, Fl_Image *img=0);
+static Fl_Shared_Image * find(const char *name, int W=0, int H=0);
+
+function Find
+       (Name : in String;
+        W, H : in Integer := 0)
+    return Shared_Image;
 
 
-static void add_handler(Fl_Shared_Handler f);
+static Fl_Shared_Image * get(const char *name, int W=0, int H=0);
+
+function Create
+       (Filename : in String;
+        W, H     : in Integer)
+    return Shared_Image;
+
+static Fl_Shared_Image * get(Fl_RGB_Image *rgb, int own_it=1);
+
+function Create
+       (From : in FLTK.Images.RGB.RGB_Image'Class)
+    return Shared_Image;
+
+static Fl_Shared_Image ** images();
 
 
+static int num_images();
+
+function Number_Of_Images
+    return Natural;
+
+static void remove_handler(Fl_Shared_Handler f);
+
Documentation lacking, claims to be a test function yet used for adding extra formats?
+static void scaling_algorithm(Fl_RGB_Scaling algorithm);
+
+procedure Set_Scaling_Algorithm
+       (To : in Scaling_Kind);
+
+ + + + + + + + - - - - - - - - - - - - - - - - - - - - + - - + @@ -224,14 +252,8 @@ procedure Reload - - - - - - - - - -
Functions and Procedures
 virtual void color_average(Fl_Color c, float i);
 
@@ -140,48 +202,6 @@ procedure Draw
 
   
-static Fl_Shared_Image * find(const char *name, int W=0, int H=0);
-
-function Find
-       (Name : in String;
-        W, H : in Integer := 0)
-    return Shared_Image;
-
-static Fl_Shared_Image * get(const char *name, int W=0, int H=0);
-
-function Create
-       (Filename : in String;
-        W, H     : in Integer)
-    return Shared_Image;
-
-static Fl_Shared_Image * get(Fl_RGB_Image *rgb, int own_it=1);
-
-function Create
-       (From : in FLTK.Images.RGB.RGB_Image'Class)
-    return Shared_Image;
-
-static Fl_Shared_Image ** images();
-
 
 const char * name();
 
@@ -193,16 +213,24 @@ function Name
 
   
-static int num_images();
+int original();
+
+function Original
+       (This : in Shared_Image)
+    return Boolean;
 
 
 int refcount();
 
 
+function Reference_Count
+       (This : in Shared_Image)
+    return Natural;
+
-static void remove_handler(Fl_Shared_Handler f);
-
 
-void scale(int width, int height, int proportional=1, int can_expand=0);
+void scale(int width, int height,
+    int proportional=1, int can_expand=0);
 
 procedure Scale
@@ -244,19 +266,12 @@ procedure Scale
 
   
-static void scaling_algorithm(Fl_RGB_Scaling algorithm);
-
-procedure Set_Scaling_Algorithm
-       (To : in Scaling_Kind);
+virtual void uncache();
 
-virtual void uncache();
+procedure Uncache
+       (This : in out Shared_Image);
 
 
-- cgit