type Gdk_Pixbuf_Record is new Glib.Object.GObject_Record with private;
type Gdk_Pixbuf is access all Gdk_Pixbuf_Record'Class;
type Gdk_Pixbuf_Animation_Iter is new Glib.C_Proxy;
type Alpha_Mode is (Alpha_Bilevel, Alpha_Full);
type Gdk_Colorspace is (Colorspace_RGB);
type Gdk_Interp_Type is (Interp_Nearest, -- Nearest neighbor. It is the fastest and lowest quality. Interp_Tiles, -- Accurate simulation of the Postscript image operator -- without any interpolation enabled; each pixel is rendered as a tiny -- parallelogram of solid color, the edges of which are implemented -- with anti-aliasing. It resembles nearest neighbor for enlargement, -- and bilinear for reduction. Interp_Bilinear, -- Bilinear interpolation. For enlargement, it is equivalent to -- point-sampling the ideal bilinear-interpolated image. For reduction, -- it is equivalent to laying down small tiles and integrating over the -- coverage area. Interp_Hyper -- Filter_Hyper is the highest quality reconstruction function. It is -- derived from the hyperbolic filters in Wolberg's "Digital Image -- Warping," and is formally defined as the hyperbolic-filter sampling -- the ideal hyperbolic-filter interpolated image (the filter is -- designed to be idempotent for 1:1 pixel mapping). It is the slowest -- and highest quality. );
type Image_Quality is range 0 .. 100;
Null_Pixbuf : constant Gdk_Pixbuf := null;
function Get_Type return Glib.GType;
function Get_Colorspace
( | Pixbuf | : Gdk_Pixbuf) return Gdk_Colorspace; |
function Get_N_Channels
( | Pixbuf | : Gdk_Pixbuf) return Gint; |
function Get_Has_Alpha
( | Pixbuf | : Gdk_Pixbuf) return Boolean; |
function Get_Bits_Per_Sample
( | Pixbuf | : Gdk_Pixbuf) return Gint; |
function Get_Pixels
( | Pixbuf | : Gdk_Pixbuf) return Gdk.Rgb.Rgb_Buffer_Access; |
function Get_Width
( | Pixbuf | : Gdk_Pixbuf) return Gint; |
function Get_Height
( | Pixbuf | : Gdk_Pixbuf) return Gint; |
function Get_Rowstride
( | Pixbuf | : Gdk_Pixbuf) return Gint; |
function Gdk_New
( | Colorspace | : Gdk_Colorspace := Colorspace_RGB; |
Has_Alpha | : Boolean := False; | |
Bits_Per_Sample | : Gint := 8; | |
Width | : Gint; | |
Height | : Gint) return Gdk_Pixbuf; |
function Gdk_New_Subpixbuf
( | Src_Pixbuf | : Gdk_Pixbuf; |
Src_X | : Gint; | |
Src_Y | : Gint; | |
Width | : Gint; | |
Height | : Gint) return Gdk_Pixbuf; |
procedure Gdk_New_From_File
( | Pixbuf | : out Gdk_Pixbuf; |
Filename | : String; | |
Error | : out GError); |
function Gdk_New_From_Data
( | Data | : Guchar_Array_Access; |
Colorspace | : Gdk_Colorspace := Colorspace_RGB; | |
Has_Alpha | : Boolean := False; | |
Bits_Per_Sample | : Gint := 8; | |
Width | : Gint; | |
Height | : Gint; | |
Rowstride | : Gint; | |
Auto_Destroy_Data | : Boolean := True) return Gdk_Pixbuf; |
function Gdk_New_From_Xpm_Data
( | Data | : Interfaces.C.Strings.chars_ptr_array) return Gdk_Pixbuf; |
procedure Save
( | Pixbuf | : Gdk_Pixbuf; |
Filename | : String; | |
Format | : File_Format; | |
Error | : out GError; | |
Quality | : Image_Quality := Image_Quality'Last; | |
Depth | : Integer := 32); |
function Add_Alpha
( | Pixbuf | : Gdk_Pixbuf; |
Substitute_Color | : Boolean := False; | |
Red | : Guchar := 0; | |
Green | : Guchar := 0; | |
Blue | : Guchar := 0) return Gdk_Pixbuf; |
procedure Copy_Area
( | Src_Pixbuf | : Gdk_Pixbuf; |
Src_X | : Gint; | |
Src_Y | : Gint; | |
Width | : Gint; | |
Height | : Gint; | |
Dest_Pixbuf | : Gdk_Pixbuf; | |
Dest_X | : Gint; | |
Dest_Y | : Gint); |
procedure Saturate_And_Pixelate
( | Src | : Gdk_Pixbuf; |
Dest | : Gdk_Pixbuf; | |
Saturation | : Gfloat; | |
Pixelate | : Boolean := True); |
procedure Render_Threshold_Alpha
( | Pixbuf | : Gdk_Pixbuf; |
Bitmap | : Gdk.Bitmap.Gdk_Bitmap; | |
Src_X | : Gint; | |
Src_Y | : Gint; | |
Dest_X | : Gint; | |
Dest_Y | : Gint; | |
Width | : Gint; | |
Height | : Gint; | |
Alpha_Threshold | : Alpha_Range); |
procedure Render_To_Drawable
( | Pixbuf | : Gdk_Pixbuf; |
Drawable | : Gdk.Drawable.Gdk_Drawable; | |
GC | : Gdk.GC.Gdk_GC; | |
Src_X | : Gint; | |
Src_Y | : Gint; | |
Dest_X | : Gint; | |
Dest_Y | : Gint; | |
Width | : Gint; | |
Height | : Gint; | |
Dither | : Gdk.Rgb.Gdk_Rgb_Dither := Gdk.Rgb.Dither_Normal; | |
X_Dither | : Gint := 0; | |
Y_Dither | : Gint := 0); |
procedure Render_To_Drawable_Alpha
( | Pixbuf | : Gdk_Pixbuf; |
Drawable | : Gdk.Drawable.Gdk_Drawable; | |
Src_X | : Gint; | |
Src_Y | : Gint; | |
Dest_X | : Gint; | |
Dest_Y | : Gint; | |
Width | : Gint; | |
Height | : Gint; | |
Alpha | : Alpha_Mode; | |
Alpha_Threshold | : Alpha_Range; | |
Dither | : Gdk.Rgb.Gdk_Rgb_Dither := Gdk.Rgb.Dither_Normal; | |
X_Dither | : Gint := 0; | |
Y_Dither | : Gint := 0); |
procedure Render_Pixmap_And_Mask
( | Pixbuf | : Gdk_Pixbuf; |
Pixmap | : out Gdk.Pixmap.Gdk_Pixmap; | |
Mask | : out Gdk.Bitmap.Gdk_Bitmap; | |
Alpha_Threshold | : Alpha_Range); |
procedure Render_Pixmap_And_Mask_For_Colormap
( | Pixbuf | : Gdk_Pixbuf; |
Colormap | : Gdk.Color.Gdk_Colormap; | |
Pixmap | : out Gdk.Pixmap.Gdk_Pixmap; | |
Mask | : out Gdk.Bitmap.Gdk_Bitmap; | |
Alpha_Threshold | : Alpha_Range); |
function Get_From_Drawable
( | Dest | : Gdk_Pixbuf; |
Src | : Gdk.Drawable.Gdk_Drawable; | |
Cmap | : Gdk.Color.Gdk_Colormap; | |
Src_X | : Gint; | |
Src_Y | : Gint; | |
Dest_X | : Gint; | |
Dest_Y | : Gint; | |
Width | : Gint; | |
Height | : Gint) return Gdk_Pixbuf; |
procedure Scale
( | Src | : Gdk_Pixbuf; |
Dest | : Gdk_Pixbuf; | |
Dest_X | : Gint; | |
Dest_Y | : Gint; | |
Dest_Width | : Gint; | |
Dest_Height | : Gint; | |
Offset_X | : Gdouble := 0.0; | |
Offset_Y | : Gdouble := 0.0; | |
Scale_X | : Gdouble := 1.0; | |
Scale_Y | : Gdouble := 1.0; | |
Inter_Type | : Gdk_Interp_Type := Interp_Bilinear); |
procedure Composite
( | Src | : Gdk_Pixbuf; |
Dest | : Gdk_Pixbuf; | |
Dest_X | : Gint; | |
Dest_Y | : Gint; | |
Dest_Width | : Gint; | |
Dest_Height | : Gint; | |
Offset_X | : Gdouble := 0.0; | |
Offset_Y | : Gdouble := 0.0; | |
Scale_X | : Gdouble := 1.0; | |
Scale_Y | : Gdouble := 1.0; | |
Inter_Type | : Gdk_Interp_Type := Interp_Bilinear; | |
Overall_Alpha | : Alpha_Range := 128); |
procedure Composite_Color
( | Src | : Gdk_Pixbuf; |
Dest | : Gdk_Pixbuf; | |
Dest_X | : Gint; | |
Dest_Y | : Gint; | |
Dest_Width | : Gint; | |
Dest_Height | : Gint; | |
Offset_X | : Gdouble := 0.0; | |
Offset_Y | : Gdouble := 0.0; | |
Scale_X | : Gdouble := 1.0; | |
Scale_Y | : Gdouble := 1.0; | |
Inter_Type | : Gdk_Interp_Type := Interp_Bilinear; | |
Overall_Alpha | : Alpha_Range := 128; | |
Check_X | : Gint := 0; | |
Check_Y | : Gint := 0; | |
Check_Size | : Gint := 0; | |
Color1 | : Guint32 := 0; | |
Color2 | : Guint32 := 0); |
function Scale_Simple
( | Src | : Gdk_Pixbuf; |
Dest_Width | : Gint; | |
Dest_Height | : Gint; | |
Inter_Type | : Gdk_Interp_Type := Interp_Bilinear) return Gdk_Pixbuf; |
function Composite_Color_Simple
( | Src | : Gdk_Pixbuf; |
Dest_Width | : Gint; | |
Dest_Height | : Gint; | |
Inter_Type | : Gdk_Interp_Type := Interp_Bilinear; | |
Overall_Alpha | : Alpha_Range := 128; | |
Color1 | : Guint32 := 0; | |
Color2 | : Guint32 := 0) return Gdk_Pixbuf; |
function Get_Type_Animation return Glib.GType;
procedure Gdk_New_From_File
( | Animation | : out Gdk_Pixbuf_Animation; |
Filename | : String; | |
Error | : out GError); |
procedure Ref
( | Animation | : Gdk_Pixbuf_Animation); |
procedure Unref
( | Animation | : Gdk_Pixbuf_Animation); |
function Get_Width
( | Animation | : Gdk_Pixbuf_Animation) return Gint; |
function Get_Height
( | Animation | : Gdk_Pixbuf_Animation) return Gint; |
function Is_Static_Image
( | Animation | : Gdk_Pixbuf_Animation) return Boolean; |
function Get_Static_Image
( | Animation | : Gdk_Pixbuf_Animation) return Gdk_Pixbuf; |
function Get_Iter
( | Animation | : Gdk_Pixbuf_Animation; |
Start_Time | : GTime_Val_Access := null) return Gdk_Pixbuf_Animation_Iter; |
function Get_Type_Animation_Iter return Glib.GType;
procedure Ref
( | Iter | : Gdk_Pixbuf_Animation_Iter); |
procedure Unref
( | Iter | : Gdk_Pixbuf_Animation_Iter); |
function Get_Delay_Time
( | Iter | : Gdk_Pixbuf_Animation_Iter) return Gint; |
function Get_Pixbuf
( | Iter | : Gdk_Pixbuf_Animation_Iter) return Gdk_Pixbuf; |
function On_Currently_Loading_Frame
( | Iter | : Gdk_Pixbuf_Animation_Iter) return Boolean; |
function Advance
( | Iter | : Gdk_Pixbuf_Animation_Iter; |
Current_Timer | : GTime_Val_Access := null) return Boolean; |
procedure Gdk_New_From_Pixbuf
( | Cursor | : out Gdk.Cursor.Gdk_Cursor; |
Display | : Gdk.Display.Gdk_Display := Gdk.Display.Get_Default; | |
Pixbuf | : Gdk_Pixbuf; | |
X | : Glib.Gint; | |
Y | : Glib.Gint); |
function Get_Image
( | Cursor | : Gdk.Cursor.Gdk_Cursor) return Gdk_Pixbuf; |
This object provides image manipulation routines.
The following image formats are known, but some depend on external libraries for the proper loading of files (indicated with * in the list): PNG*, JPEG*, TIFF*, GIF, XPM, PNM, Sun raster file (ras), ico, bmp.
With this package, you can load images from file, display them on the screen, re-scale them and compose them with other images.
All the functions fully support alpha channels (opacity).
Different filters are provided, depending on the quality of output you expect and the speed you need.
Binding from C File version 1.3.11
<testgtk>create_pixbuf.adb</testgtk>