68
68
-- The drawable you intend to copy the RGB buffer to must use this visual
69
69
-- and this colormap. Therefore, before creating the widget, you need to do
71
-- - Gtk.Widget.Push_Visual (Gdk.Rgb.Get_Visual);
72
71
-- - Gtk.Widget.Push_Colormap (Gdk.Rgb.Get_Cmap);
73
72
-- - Gtk_New (....)
74
-- - Gtk.Widget.Pop_Visual;
75
73
-- - Gtk.Widget.Pop_Colormap;
77
type Rgb_Buffer is array (Natural) of Glib.Guchar;
78
pragma Convention (C, Rgb_Buffer);
75
type Rgb_Record is record
76
Red, Green, Blue : Glib.Guchar;
78
pragma Convention (C, Rgb_Record);
80
type Rgb_Buffer is array (Glib.Guint range <>) of Rgb_Record;
81
pragma Pack (Rgb_Buffer);
79
82
-- This is the buffer that will contain the image. You can manipulate each
80
83
-- byte in it independantly, although there is no high level routine
81
84
-- to draw lines, circles, ...
83
86
-- drawable on the screen, *if* the widget was created with the correct
84
87
-- visual and colormap (see above).
86
type Rgb_Buffer_Access is access all Rgb_Buffer;
89
type Unchecked_Rgb_Buffer is array (Glib.Guint) of Rgb_Record;
90
pragma Convention (C, Unchecked_Rgb_Buffer);
91
type Rgb_Buffer_Access is access all Unchecked_Rgb_Buffer;
87
92
pragma Convention (C, Rgb_Buffer_Access);
88
-- Type used By Gdk.Pixbufs.Get_Pixels below to return an array with no
89
-- bound checks that is comatible with C (also known as a flat array).
93
-- Type used By Gdk.Pixbufs.Get_Pixels to return an array with no
94
-- bound checks that is compatible with C (also known as a flat array).
91
96
type Gdk_Rgb_Dither is (Dither_None, Dither_Normal, Dither_Max);
92
97
-- The three kinds of dithering that are implemented in this package:
177
190
Rgb_Buf : Rgb_Buffer;
178
191
Rowstride : Glib.Gint;
179
192
Xdith, Ydith : Glib.Gint);
180
-- Same kind of function as above, but for different buffer types (???).
182
procedure Draw_Rgb_32_Image
183
(Drawable : Gdk.Drawable.Gdk_Drawable;
186
Width, Height : Glib.Gint;
187
Dith : Gdk_Rgb_Dither;
188
Rgb_Buf : Rgb_Buffer;
189
Rowstride : Glib.Gint);
190
-- Same kind of function as above, but for different buffer types (???).
192
procedure Draw_Rgb_32_Image_Dithalign
193
(Drawable : Gdk.Drawable.Gdk_Drawable;
196
Width, Height : Glib.Gint;
197
Dith : Gdk_Rgb_Dither;
198
Rgb_Buf : Rgb_Buffer;
199
Rowstride : Glib.Gint;
200
Xdith, Ydith : Glib.Gint);
201
-- Same kind of function as above, but for different buffer types (???).
203
procedure Draw_Gray_Image
204
(Drawable : Gdk.Drawable.Gdk_Drawable;
207
Width, Height : Glib.Gint;
208
Dith : Gdk_Rgb_Dither;
209
Rgb_Buf : Rgb_Buffer;
210
Rowstride : Glib.Gint);
211
-- Same kind of function as above, but for different buffer types (???).
213
procedure Draw_Indexed_Image
214
(Drawable : Gdk.Drawable.Gdk_Drawable;
217
Width, Height : Glib.Gint;
218
Dith : Gdk_Rgb_Dither;
219
Rgb_Buf : Rgb_Buffer;
193
procedure Draw_Rgb_Image_Dithalign
194
(Drawable : Gdk.Drawable.Gdk_Drawable;
197
Width, Height : Glib.Gint;
198
Dith : Gdk_Rgb_Dither;
199
Rgb_Buf : Unchecked_Rgb_Buffer;
200
Rowstride : Glib.Gint;
201
Xdith, Ydith : Glib.Gint);
202
-- Same kind of function as above, but for different buffer types (???).
204
procedure Draw_Rgb_32_Image
205
(Drawable : Gdk.Drawable.Gdk_Drawable;
208
Width, Height : Glib.Gint;
209
Dith : Gdk_Rgb_Dither;
210
Rgb_Buf : Rgb_Buffer;
211
Rowstride : Glib.Gint);
212
procedure Draw_Rgb_32_Image
213
(Drawable : Gdk.Drawable.Gdk_Drawable;
216
Width, Height : Glib.Gint;
217
Dith : Gdk_Rgb_Dither;
218
Rgb_Buf : Unchecked_Rgb_Buffer;
219
Rowstride : Glib.Gint);
220
-- Same kind of function as above, but for different buffer types (???).
222
procedure Draw_Rgb_32_Image_Dithalign
223
(Drawable : Gdk.Drawable.Gdk_Drawable;
226
Width, Height : Glib.Gint;
227
Dith : Gdk_Rgb_Dither;
228
Rgb_Buf : Rgb_Buffer;
229
Rowstride : Glib.Gint;
230
Xdith, Ydith : Glib.Gint);
231
procedure Draw_Rgb_32_Image_Dithalign
232
(Drawable : Gdk.Drawable.Gdk_Drawable;
235
Width, Height : Glib.Gint;
236
Dith : Gdk_Rgb_Dither;
237
Rgb_Buf : Unchecked_Rgb_Buffer;
238
Rowstride : Glib.Gint;
239
Xdith, Ydith : Glib.Gint);
240
-- Same kind of function as above, but for different buffer types (???).
242
procedure Draw_Gray_Image
243
(Drawable : Gdk.Drawable.Gdk_Drawable;
246
Width, Height : Glib.Gint;
247
Dith : Gdk_Rgb_Dither;
248
Rgb_Buf : Rgb_Buffer;
249
Rowstride : Glib.Gint);
250
procedure Draw_Gray_Image
251
(Drawable : Gdk.Drawable.Gdk_Drawable;
254
Width, Height : Glib.Gint;
255
Dith : Gdk_Rgb_Dither;
256
Rgb_Buf : Unchecked_Rgb_Buffer;
257
Rowstride : Glib.Gint);
258
-- Same kind of function as above, but for different buffer types (???).
260
procedure Draw_Indexed_Image
261
(Drawable : Gdk.Drawable.Gdk_Drawable;
264
Width, Height : Glib.Gint;
265
Dith : Gdk_Rgb_Dither;
266
Rgb_Buf : Rgb_Buffer;
267
Rowstride : Glib.Gint;
268
Cmap : Gdk_Rgb_Cmap);
269
procedure Draw_Indexed_Image
270
(Drawable : Gdk.Drawable.Gdk_Drawable;
273
Width, Height : Glib.Gint;
274
Dith : Gdk_Rgb_Dither;
275
Rgb_Buf : Unchecked_Rgb_Buffer;
220
276
Rowstride : Glib.Gint;
221
277
Cmap : Gdk_Rgb_Cmap);
222
278
-- Same kind of function as above, but for different buffer types (???).
233
289
pragma Import (C, Get, "ada_rgb_cmap_get");
234
290
pragma Import (C, Set, "ada_rgb_cmap_set");
235
291
pragma Import (C, Free, "gdk_rgb_cmap_free");
236
pragma Import (C, Draw_Rgb_Image, "gdk_draw_rgb_image");
237
pragma Import (C, Draw_Rgb_Image_Dithalign, "gdk_draw_rgb_image_dithalign");
238
pragma Import (C, Draw_Rgb_32_Image, "gdk_draw_rgb_32_image");
240
(C, Draw_Rgb_32_Image_Dithalign, "gdk_draw_rgb_32_image_dithalign");
241
pragma Import (C, Draw_Gray_Image, "gdk_draw_gray_image");
242
pragma Import (C, Draw_Indexed_Image, "gdk_draw_indexed_image");