summaryrefslogtreecommitdiff
path: root/src/fltk-images-rgb.ads
blob: 67518c313d4d3bda8b1132590bc9590efb369e51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125


with

    FLTK.Images.Pixmaps;


package FLTK.Images.RGB is


    -------------
    --  Types  --
    -------------

    type RGB_Image is new Image with private;

    type RGB_Image_Reference (Data : not null access RGB_Image'Class) is limited null record
        with Implicit_Dereference => Data;




    --------------------
    --  Construction  --
    --------------------

    package Forge is

        function Create
               (Data          : in Color_Component_Array;
                Width, Height : in Natural;
                Depth         : in Natural := 3;
                Line_Data     : in Natural := 0)
            return RGB_Image;

        function Create
               (Data       : in FLTK.Images.Pixmaps.Pixmap'Class;
                Background : in Color := Background_Color)
            return RGB_Image;

    end Forge;

    function Get_Max_Size
        return Natural;

    procedure Set_Max_Size
           (Value : in Natural);

    function Copy
           (This          : in RGB_Image;
            Width, Height : in Natural)
        return RGB_Image'Class;

    function Copy
           (This : in RGB_Image)
        return RGB_Image'Class;




    --------------
    --  Colors  --
    --------------

    procedure Color_Average
           (This   : in out RGB_Image;
            Col    : in     Color;
            Amount : in     Blend);

    procedure Desaturate
           (This : in out RGB_Image);




    ----------------
    --  Activity  --
    ----------------

    procedure Uncache
           (This : in out RGB_Image);




    ---------------
    --  Drawing  --
    ---------------

    procedure Draw
           (This : in RGB_Image;
            X, Y : in Integer);

    procedure Draw
           (This       : in RGB_Image;
            X, Y, W, H : in Integer;
            CX, CY     : in Integer := 0);


private


    type RGB_Image is new Image with null record;

    overriding procedure Finalize
           (This : in out RGB_Image);


    pragma Inline (Get_Max_Size);
    pragma Inline (Set_Max_Size);
    pragma Inline (Copy);


    pragma Inline (Color_Average);
    pragma Inline (Desaturate);


    pragma Inline (Uncache);


    pragma Inline (Draw);


end FLTK.Images.RGB;