summaryrefslogtreecommitdiff
path: root/body/fltk-images-rgb-jpeg.adb
diff options
context:
space:
mode:
Diffstat (limited to 'body/fltk-images-rgb-jpeg.adb')
-rw-r--r--body/fltk-images-rgb-jpeg.adb26
1 files changed, 13 insertions, 13 deletions
diff --git a/body/fltk-images-rgb-jpeg.adb b/body/fltk-images-rgb-jpeg.adb
index 17debb5..da30529 100644
--- a/body/fltk-images-rgb-jpeg.adb
+++ b/body/fltk-images-rgb-jpeg.adb
@@ -12,6 +12,10 @@ with
package body FLTK.Images.RGB.JPEG is
+ ------------------------
+ -- Functions From C --
+ ------------------------
+
function new_fl_jpeg_image
(F : in Interfaces.C.char_array)
return Storage.Integer_Address;
@@ -33,6 +37,10 @@ package body FLTK.Images.RGB.JPEG is
+ -------------------
+ -- Destructors --
+ -------------------
+
overriding procedure Finalize
(This : in out JPEG_Image) is
begin
@@ -46,7 +54,7 @@ package body FLTK.Images.RGB.JPEG is
--------------------
- -- Construction --
+ -- Constructors --
--------------------
package body Forge is
@@ -58,15 +66,11 @@ package body FLTK.Images.RGB.JPEG is
return This : JPEG_Image do
This.Void_Ptr := new_fl_jpeg_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)
@@ -76,12 +80,7 @@ package body FLTK.Images.RGB.JPEG is
This.Void_Ptr := new_fl_jpeg_image2
(Interfaces.C.To_C (Name),
Storage.To_Integer (Data (Data'First)'Address));
- 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;
@@ -90,3 +89,4 @@ package body FLTK.Images.RGB.JPEG is
end FLTK.Images.RGB.JPEG;
+