Description
This package implements a client-side pixmap. As opposed to the pixmaps
found in
Gdk.Pixmap, this one simply implements a local buffer, which
can be manipulated at the pixel level easily. This buffer then needs to
be sent to the server.
The major efficiency difference is that the same amount of data needs
to be sent to the server no matter how much things were modified.
Gdk.Pixmaps requires one communication with the server per drawing
function.
Some X servers are also optimized so that the buffers in this package
can be implemented in shared memory with the server, which of course
makes it much faster to transfer the data.
This package is basically an implementation of XImage (on X-Window),
which means that it handles transparently different depths, byte
ordering,... It also provides some color dithering functions.
See the commands Get_Visual and Get_Cmap below on how to use the
colormaps and visual with this package
Dithering simulates a higher number of colors than what is available on
the current visual (only for 8-bit and 16-bit displays).
Types
-
-
type Gdk_Rgb_Dither is (Dither_None, Dither_Normal, Dither_Max);
-
type Rgb_Buffer is array (Glib.Guint range <>) of Rgb_Record;
-
type Rgb_Buffer_Access is access all Unchecked_Rgb_Buffer;
-
type Rgb_Cmap_Index is new Natural range 0 .. 255;
-
type Rgb_Item is Glib.Guint32;
-
type Rgb_Record is record
Red, Green, Blue : Glib.Guchar;
-
type Unchecked_Rgb_Buffer is array (Glib.Guint) of Rgb_Record;
Subprograms
-
function Get_Visual return Gdk.Visual.Gdk_Visual;
-
Color manipulation
-
function Xpixel_From_Rgb (Value : in Rgb_Item) return Glib.Gulong;
-
procedure GC_Set_Foreground
(GC :
Gdk.GC.Gdk_GC; Value : Rgb_Item);
-
procedure GC_Set_Background
(GC :
Gdk.GC.Gdk_GC; Value : Rgb_Item);
Colormap manipulation
-
function Get (Cmap : Gdk_Rgb_Cmap; Index : Rgb_Cmap_Index) return Rgb_Item;
-
procedure Set
(Cmap : Gdk_Rgb_Cmap; Index : Rgb_Cmap_Index; Value : Rgb_Item);
-
procedure Gdk_New (Cmap : out Gdk_Rgb_Cmap; Colors : Glib.Guint32_Array);
-
procedure Free (Cmap : Gdk_Rgb_Cmap);
Drawing Images
-
procedure Draw_Rgb_Image
(Drawable :
Gdk.Drawable.Gdk_Drawable;
GC :
Gdk.GC.Gdk_GC;
X, Y : Glib.Gint;
Width, Height : Glib.Gint;
Dith : Gdk_Rgb_Dither;
Rgb_Buf : Rgb_Buffer;
Rowstride : Glib.Gint);
procedure Draw_Rgb_Image
(Drawable :
Gdk.Drawable.Gdk_Drawable;
GC :
Gdk.GC.Gdk_GC;
X, Y : Glib.Gint;
Width, Height : Glib.Gint;
Dith : Gdk_Rgb_Dither;
Rgb_Buf : Unchecked_Rgb_Buffer;
Rowstride : Glib.Gint);
-
procedure Draw_Rgb_Image_Dithalign
(Drawable :
Gdk.Drawable.Gdk_Drawable;
GC :
Gdk.GC.Gdk_GC;
X, Y : Glib.Gint;
Width, Height : Glib.Gint;
Dith : Gdk_Rgb_Dither;
Rgb_Buf : Rgb_Buffer;
Rowstride : Glib.Gint;
Xdith, Ydith : Glib.Gint);
procedure Draw_Rgb_Image_Dithalign
(Drawable :
Gdk.Drawable.Gdk_Drawable;
GC :
Gdk.GC.Gdk_GC;
X, Y : Glib.Gint;
Width, Height : Glib.Gint;
Dith : Gdk_Rgb_Dither;
Rgb_Buf : Unchecked_Rgb_Buffer;
Rowstride : Glib.Gint;
Xdith, Ydith : Glib.Gint);
-
procedure Draw_Rgb_32_Image
(Drawable :
Gdk.Drawable.Gdk_Drawable;
GC :
Gdk.GC.Gdk_GC;
X, Y : Glib.Gint;
Width, Height : Glib.Gint;
Dith : Gdk_Rgb_Dither;
Rgb_Buf : Rgb_Buffer;
Rowstride : Glib.Gint);
procedure Draw_Rgb_32_Image
(Drawable :
Gdk.Drawable.Gdk_Drawable;
GC :
Gdk.GC.Gdk_GC;
X, Y : Glib.Gint;
Width, Height : Glib.Gint;
Dith : Gdk_Rgb_Dither;
Rgb_Buf : Unchecked_Rgb_Buffer;
Rowstride : Glib.Gint);
-
procedure Draw_Rgb_32_Image_Dithalign
(Drawable :
Gdk.Drawable.Gdk_Drawable;
GC :
Gdk.GC.Gdk_GC;
X, Y : Glib.Gint;
Width, Height : Glib.Gint;
Dith : Gdk_Rgb_Dither;
Rgb_Buf : Rgb_Buffer;
Rowstride : Glib.Gint;
Xdith, Ydith : Glib.Gint);
procedure Draw_Rgb_32_Image_Dithalign
(Drawable :
Gdk.Drawable.Gdk_Drawable;
GC :
Gdk.GC.Gdk_GC;
X, Y : Glib.Gint;
Width, Height : Glib.Gint;
Dith : Gdk_Rgb_Dither;
Rgb_Buf : Unchecked_Rgb_Buffer;
Rowstride : Glib.Gint;
Xdith, Ydith : Glib.Gint);
-
procedure Draw_Gray_Image
(Drawable :
Gdk.Drawable.Gdk_Drawable;
GC :
Gdk.GC.Gdk_GC;
X, Y : Glib.Gint;
Width, Height : Glib.Gint;
Dith : Gdk_Rgb_Dither;
Rgb_Buf : Rgb_Buffer;
Rowstride : Glib.Gint);
procedure Draw_Gray_Image
(Drawable :
Gdk.Drawable.Gdk_Drawable;
GC :
Gdk.GC.Gdk_GC;
X, Y : Glib.Gint;
Width, Height : Glib.Gint;
Dith : Gdk_Rgb_Dither;
Rgb_Buf : Unchecked_Rgb_Buffer;
Rowstride : Glib.Gint);
-
procedure Draw_Indexed_Image
(Drawable :
Gdk.Drawable.Gdk_Drawable;
GC :
Gdk.GC.Gdk_GC;
X, Y : Glib.Gint;
Width, Height : Glib.Gint;
Dith : Gdk_Rgb_Dither;
Rgb_Buf : Rgb_Buffer;
Rowstride : Glib.Gint;
Cmap : Gdk_Rgb_Cmap);
procedure Draw_Indexed_Image
(Drawable :
Gdk.Drawable.Gdk_Drawable;
GC :
Gdk.GC.Gdk_GC;
X, Y : Glib.Gint;
Width, Height : Glib.Gint;
Dith : Gdk_Rgb_Dither;
Rgb_Buf : Unchecked_Rgb_Buffer;
Rowstride : Glib.Gint;
Cmap : Gdk_Rgb_Cmap);