diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2025-01-28 21:43:17 +1300 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2025-01-28 21:43:17 +1300 |
commit | dee76d5884c6f079ea3a2387d07289534a51a0c1 (patch) | |
tree | 528b5d06ce81d48560b5c9e6836855d392e95ab0 /body/fltk-images-rgb-png.adb | |
parent | f5f624fd78421dbeb15fdda489caed6f210c730f (diff) |
Diffstat (limited to 'body/fltk-images-rgb-png.adb')
-rw-r--r-- | body/fltk-images-rgb-png.adb | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/body/fltk-images-rgb-png.adb b/body/fltk-images-rgb-png.adb index 67befe3..84dc9af 100644 --- a/body/fltk-images-rgb-png.adb +++ b/body/fltk-images-rgb-png.adb @@ -12,6 +12,10 @@ with package body FLTK.Images.RGB.PNG is + ------------------------ + -- Functions From C -- + ------------------------ + function new_fl_png_image (F : in Interfaces.C.char_array) return Storage.Integer_Address; @@ -34,6 +38,10 @@ package body FLTK.Images.RGB.PNG is + ------------------- + -- Destructors -- + ------------------- + overriding procedure Finalize (This : in out PNG_Image) is begin @@ -47,7 +55,7 @@ package body FLTK.Images.RGB.PNG is -------------------- - -- Construction -- + -- Constructors -- -------------------- package body Forge is @@ -59,15 +67,11 @@ package body FLTK.Images.RGB.PNG is return This : PNG_Image do This.Void_Ptr := new_fl_png_image (Interfaces.C.To_C (Filename)); - case fl_image_fail (This.Void_Ptr) is - when 1 => raise No_Image_Error; - when 2 => raise File_Access_Error; - when 3 => raise Format_Error; - when others => null; - end case; + Raise_Fail_Errors (This); end return; end Create; + function Create (Name : in String := ""; Data : in Color_Component_Array) @@ -78,12 +82,7 @@ package body FLTK.Images.RGB.PNG is (Interfaces.C.To_C (Name), Storage.To_Integer (Data (Data'First)'Address), Data'Length); - case fl_image_fail (This.Void_Ptr) is - when 1 => raise No_Image_Error; - when 2 => raise File_Access_Error; - when 3 => raise Format_Error; - when others => null; - end case; + Raise_Fail_Errors (This); end return; end Create; @@ -92,3 +91,4 @@ package body FLTK.Images.RGB.PNG is end FLTK.Images.RGB.PNG; + |