summaryrefslogtreecommitdiff
path: root/src/fltk-images-rgb-png.adb
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2017-04-27 10:40:48 +1000
committerJed Barber <jjbarber@y7mail.com>2017-04-27 10:40:48 +1000
commit0d842f0423ba0754fb3675c7468397a8da5f6e1b (patch)
treed5da172bc7af2f7f48a3415eceac67ed67542787 /src/fltk-images-rgb-png.adb
parent5d88963cd203f30b79433e34e5c89bfcf8abfe60 (diff)
Organising source
Diffstat (limited to 'src/fltk-images-rgb-png.adb')
-rw-r--r--src/fltk-images-rgb-png.adb49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/fltk-images-rgb-png.adb b/src/fltk-images-rgb-png.adb
new file mode 100644
index 0000000..ecb2f5e
--- /dev/null
+++ b/src/fltk-images-rgb-png.adb
@@ -0,0 +1,49 @@
+
+
+with Interfaces.C;
+with System;
+use type System.Address;
+
+
+package body FLTK.Images.RGB.PNG is
+
+
+ function new_fl_png_image
+ (F : in Interfaces.C.char_array)
+ return System.Address;
+ pragma Import (C, new_fl_png_image, "new_fl_png_image");
+
+ procedure free_fl_png_image
+ (P : in System.Address);
+ pragma Import (C, free_fl_png_image, "free_fl_png_image");
+
+
+
+
+ overriding procedure Finalize
+ (This : in out PNG_Image) is
+ begin
+ Finalize (RGB_Image (This));
+ if This.Void_Ptr /= System.Null_Address then
+ if This in PNG_Image then
+ free_fl_png_image (This.Void_Ptr);
+ end if;
+ end if;
+ end Finalize;
+
+
+
+
+ function Create
+ (Filename : in String)
+ return PNG_Image is
+ begin
+ return This : PNG_Image do
+ This.Void_Ptr := new_fl_png_image
+ (Interfaces.C.To_C (Filename));
+ end return;
+ end Create;
+
+
+end FLTK.Images.RGB.PNG;
+