From dee76d5884c6f079ea3a2387d07289534a51a0c1 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Tue, 28 Jan 2025 21:43:17 +1300 Subject: Revised Image subhierarchy, fixed data subprograms, added constructor for Pixmap --- body/fltk-images-rgb-pnm.adb | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'body/fltk-images-rgb-pnm.adb') diff --git a/body/fltk-images-rgb-pnm.adb b/body/fltk-images-rgb-pnm.adb index 362b8d6..be4ed29 100644 --- a/body/fltk-images-rgb-pnm.adb +++ b/body/fltk-images-rgb-pnm.adb @@ -12,6 +12,10 @@ with package body FLTK.Images.RGB.PNM is + ------------------------ + -- Functions From C -- + ------------------------ + function new_fl_pnm_image (F : in Interfaces.C.char_array) return Storage.Integer_Address; @@ -26,6 +30,10 @@ package body FLTK.Images.RGB.PNM is + ------------------- + -- Destructors -- + ------------------- + overriding procedure Finalize (This : in out PNM_Image) is begin @@ -39,7 +47,7 @@ package body FLTK.Images.RGB.PNM is -------------------- - -- Construction -- + -- Constructors -- -------------------- package body Forge is @@ -51,12 +59,7 @@ package body FLTK.Images.RGB.PNM is return This : PNM_Image do This.Void_Ptr := new_fl_pnm_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; @@ -65,3 +68,4 @@ package body FLTK.Images.RGB.PNM is end FLTK.Images.RGB.PNM; + -- cgit