## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

1.     -----------------------------------------------------------------------

2.     --               GtkAda - Ada95 binding for Gtk+/Gnome               --

3.     --                                                                   --

4.     --                Copyright (C) 2000-2013, AdaCore                   --

5.     --                                                                   --

6.     -- This library is free software; you can redistribute it and/or     --

7.     -- modify it under the terms of the GNU General Public               --

8.     -- License as published by the Free Software Foundation; either      --

9.     -- version 2 of the License, or (at your option) any later version.  --

10.     --                                                                   --

11.     -- This library is distributed in the hope that it will be useful,   --

12.     -- but WITHOUT ANY WARRANTY; without even the implied warranty of    --

13.     -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU --

14.     -- General Public License for more details.                          --

15.     --                                                                   --

16.     -- You should have received a copy of the GNU General Public         --

17.     -- License along with this library; if not, write to the             --

18.     -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      --

19.     -- Boston, MA 02111-1307, USA.                                       --

20.     --                                                                   --

21.     -- As a special exception, if other files instantiate generics from  --

22.     -- this unit, or you link this unit with other files to produce an   --

23.     -- executable, this  unit  does not  by itself cause  the resulting  --

24.     -- executable to be covered by the GNU General Public License. This  --

25.     -- exception does not however invalidate any other reasons why the   --

26.     -- executable file  might be covered by the  GNU Public License.     --

27.     -----------------------------------------------------------------------

29.     --  <description>

30.     --  This object provides image manipulation routines.

31.     --

32.     --  The following image formats are known, but some depend on external

33.     --  libraries for the proper loading of files (indicated with * in the list):

34.     --     PNG*, JPEG*, TIFF*, GIF, XPM, PNM, Sun raster file (ras), ico,

35.     --     bmp.

36.     --

37.     --  With this package, you can load images from file, display them on the

38.     --  screen, re-scale them and compose them with other images.

39.     --  All the functions fully support alpha channels (opacity).

40.     --

41.     --  Different filters are provided, depending on the quality of output you

42.     --  expect and the speed you need.

43.     --  </description>

44.     --  <c_version>1.3.11</c_version>

45.     --  <group>Gdk, the low-level API</group>

46.     --  <testgtk>create_pixbuf.adb</testgtk>

48.     with Interfaces.C.Strings;

49.     with System;

51.     with GlibTo API docTo specTo body; use GlibTo API docTo specTo body;

52.     with Glib.ErrorTo API docTo specTo body; use Glib.ErrorTo API docTo specTo body;

53.     with Glib.ObjectTo API docTo specTo body;

54.     with Gdk.BitmapTo API docTo specTo body;

55.     with Gdk.DrawableTo API docTo specTo body;

56.     with Gdk.ColorTo API docTo specTo body;

57.     with Gdk.CursorTo API docTo specTo body;

58.     with Gdk.DisplayTo API docTo specTo body;

59.     with Gdk.GCTo API docTo specTo body;

60.     with Gdk.PixmapTo API docTo specTo body;

61.     with Gdk.RgbTo API docTo specTo body;

63.     package Gdk.PixbufTo API docTo specTo body is

65.        type Gdk_Pixbuf_RecordTo API docTo body is new Glib.Object.GObject_RecordTo API docTo specTo body with private;

67.        type Gdk_Pixbuf is access all Gdk_Pixbuf_RecordTo API docTo specTo body'Class;

68.        --  A very efficient client-side pixmap.

69.        --  This type can be adapted to all the possible screen depths (number of

70.        --  bits per pixel), and the algorithms are extremely efficient.

71.        --  You can also load a pixbuf directly from an external file in one of

72.        --  the standard image formats.

74.        Null_Pixbuf : constant Gdk_PixbufTo API docTo spec := null;

76.        type Gdk_Pixbuf_Animation is new Glib.C_ProxyTo API docTo spec;

77.        --  Type used for animations.

79.        type Gdk_Pixbuf_Animation_Iter is new Glib.C_ProxyTo API docTo spec;

80.        --  Type used to iterate through an animation.

82.        type Alpha_Mode is (Alpha_Bilevel, Alpha_Full);

83.        --  Alpha compositing mode.

84.        --  This indicates how the alpha channel (for opacity) is handled when

85.        --  rendering.

86.        pragma Convention (C, Alpha_ModeTo API docTo spec);

88.        type Gdk_Colorspace is (Colorspace_RGB);

89.        --  Type of the image.

90.        --  The only possible value is currently RGB, but extensions will

91.        --  exist with CMYK, Gray, Lab, ...

92.        pragma Convention (C, Gdk_ColorspaceTo API docTo spec);

94.        type Gdk_Interp_Type is

95.          (Interp_Nearest,

96.           --  Nearest neighbor. It is the fastest and lowest quality.

98.           Interp_Tiles,

99.           --  Accurate simulation of the Postscript image operator

100.           --  without any interpolation enabled; each pixel is rendered as a tiny

101.           --  parallelogram of solid color, the edges of which are implemented

102.           --  with anti-aliasing. It resembles nearest neighbor for enlargement,

103.           --  and bilinear for reduction.

105.           Interp_Bilinear,

106.           --  Bilinear interpolation. For enlargement, it is equivalent to

107.           --  point-sampling the ideal bilinear-interpolated image. For reduction,

108.           --  it is equivalent to laying down small tiles and integrating over the

109.           --  coverage area.

111.           Interp_Hyper

112.           --  Filter_Hyper is the highest quality reconstruction function. It is

113.           --  derived from the hyperbolic filters in Wolberg's "Digital Image

114.           --  Warping," and is formally defined as the hyperbolic-filter sampling

115.           --  the ideal hyperbolic-filter interpolated image (the filter is

116.           --  designed to be idempotent for 1:1 pixel mapping). It is the slowest

117.           --  and highest quality.

118.          );

119.        --  Interpolation methods.

120.        pragma Convention (C, Gdk_Interp_TypeTo API docTo spec);

122.        ------------

123.        -- Errors --

124.        ------------

126.        --  Errors defined in the Pixbuf_Error domain:

128.        Corrupt_Image         : constant := 0;

129.        --  image data hosed

131.        Insufficient_Memory   : constant := 1;

132.        --  no mem to load image

134.        Bad_Option            : constant := 2;

135.        --  bad option passed to save routine

137.        Unknown_Type          : constant := 3;

138.        --  unsupported image type

140.        Unsupported_Operation : constant := 4;

141.        --  unsupported operation (load, save) for image type

143.        Failed                : constant := 5;

144.        --  Operation failed.

146.        type File_Format is (JPEG, PNG, ICO, BMP);

147.        --  Possible formats when saving a file.

149.        type Image_Quality is range 0 .. 100;

150.        --  For a JPEG image only, quality of the image in percentage.

152.        type Alpha_Range is range 0 .. 255;

153.        --  Valid values for alpha parameters.

154.        pragma Convention (C, Alpha_RangeTo API docTo spec);

156.        --------------

157.        -- Get_Type --

158.        --------------

160.        function Get_TypeTo API docTo body return Glib.GTypeTo API docTo spec;

161.        --  Return the internal value associated with a Gdk_Pixbuf.

163.        --------------------------

164.        -- Accessing the fields --

165.        --------------------------

167.        function Get_ColorspaceTo API docTo body (Pixbuf : Gdk_PixbufTo API docTo spec) return Gdk_ColorspaceTo API docTo spec;

168.        --  Query the color space of a pixbuf.

170.        function Get_N_ChannelsTo API docTo body (Pixbuf : Gdk_PixbufTo API docTo spec) return GintTo API docTo spec;

171.        --  Number of channels in the image.

173.        function Get_Has_AlphaTo API docTo body (Pixbuf : Gdk_PixbufTo API docTo spec) return Boolean;

174.        --  Return True if the image has an alpha channel (opacity information).

176.        function Get_Bits_Per_SampleTo API docTo body (Pixbuf : Gdk_PixbufTo API docTo spec) return GintTo API docTo spec;

177.        --  Number of bits per color sample.

179.        function Get_PixelsTo API docTo body (Pixbuf : Gdk_PixbufTo API docTo spec) return Gdk.Rgb.Rgb_Buffer_AccessTo API docTo spec;

180.        --  Return a pointer to the pixel data of the image.

182.        function Get_WidthTo API docTo body (Pixbuf : Gdk_PixbufTo API docTo spec) return GintTo API docTo spec;

183.        --  Return the width of the image in pixels.

185.        function Get_HeightTo API docTo body (Pixbuf : Gdk_PixbufTo API docTo spec) return GintTo API docTo spec;

186.        --  Return the height of the image in pixels.

188.        function Get_RowstrideTo API docTo body (Pixbuf : Gdk_PixbufTo API docTo spec) return GintTo API docTo spec;

189.        --  Return the number of bytes between rows in the image data.

191.        --------------

192.        -- Creating --

193.        --------------

195.        function Gdk_NewTo API docTo body

196.          (ColorspaceTo API docTo body      : Gdk_ColorspaceTo API docTo spec := Colorspace_RGB;

197.           Has_Alpha       : Boolean := False;

198.           Bits_Per_Sample : GintTo API docTo spec := 8;

199.           Width           : GintTo API docTo spec;

200.           Height          : GintTo API docTo spec) return Gdk_PixbufTo API docTo spec;

201.        --  Create a blank pixbuf with an optimal row stride and a new buffer.

202.        --  The buffer is allocated, but not cleared.

203.        --  The reference counting is initialized to 1.

205.        function CopyTo API docTo body (Pixbuf : Gdk_PixbufTo API docTo spec) return Gdk_PixbufTo API docTo spec;

206.        --  Copy a pixbuf.

208.        function Gdk_New_SubpixbufTo API docTo body

209.          (Src_Pixbuf : Gdk_PixbufTo API docTo spec;

210.           Src_X      : GintTo API docTo spec;

211.           Src_Y      : GintTo API docTo spec;

212.           Width      : GintTo API docTo spec;

213.           Height     : GintTo API docTo spec) return Gdk_PixbufTo API docTo spec;

214.        --  Create a pixbuf which points to the pixels of another pixbuf

216.        procedure Gdk_New_From_FileTo API docTo body

217.          (Pixbuf   : out Gdk_PixbufTo API docTo spec;

218.           Filename : String;

219.           Error    : out GErrorTo API docTo spec);

220.        --  Load an image from file.

222.        function Gdk_New_From_DataTo API docTo body

223.          (Data              : Guchar_Array_AccessTo API docTo spec;

224.           ColorspaceTo API docTo body        : Gdk_ColorspaceTo API docTo spec := Colorspace_RGB;

225.           Has_Alpha         : Boolean := False;

226.           Bits_Per_Sample   : GintTo API docTo spec := 8;

227.           Width             : GintTo API docTo spec;

228.           Height            : GintTo API docTo spec;

229.           Rowstride         : GintTo API docTo spec;

230.           Auto_Destroy_Data : Boolean := True) return Gdk_PixbufTo API docTo spec;

231.        --  Create a pixbuf out of in-memory image data.

232.        --  Currently only RGB images with 8 bits per sample are supported.

233.        --  Width and Height must be > 0.

234.        --  Rowstride is the distance in bytes between row starts.

235.        --  A typical value is 4*Width when there is an Alpha channel.

236.        --  If Auto_Destroy_Data is true, passed data will be automatically

237.        --  freed when the reference count of the pixbuf reaches 1.

238.        --  Otherwise, data is never freed.

240.        function Gdk_New_From_Xpm_DataTo API docTo body

241.          (Data : Interfaces.C.Strings.chars_ptr_array) return Gdk_PixbufTo API docTo spec;

242.        --  Create an image from a XPM data.

244.        procedure FillTo API docTo body (Pixbuf : Gdk_PixbufTo API docTo spec; Pixel : Guint32To API docTo spec);

245.        --  Fill pixbuf with a given pixel value.

247.        procedure SaveTo API docTo body

248.          (Pixbuf   : Gdk_PixbufTo API docTo spec;

249.           Filename : String;

250.           FormatTo API docTo body   : File_FormatTo API docTo spec;

251.           Error    : out GErrorTo API docTo spec;

252.           Quality  : Image_QualityTo API docTo spec := Image_QualityTo API docTo spec'Last;

253.           Depth    : Integer := 32);

254.        --  Save pixbuf to a file.

255.        --  Quality is only taken into account for JPEG images.

256.        --  Depth is only taken into account for ICO images and can take the values

257.        --  16, 24 or 32.

258.        --  Error is set to null on success, and set to a GError otherwise.

260.        function Add_AlphaTo API docTo body

261.          (Pixbuf           : Gdk_PixbufTo API docTo spec;

262.           Substitute_Color : Boolean := False;

263.           Red              : GucharTo API docTo spec := 0;

264.           Green            : GucharTo API docTo spec := 0;

265.           Blue             : GucharTo API docTo spec := 0) return Gdk_PixbufTo API docTo spec;

266.        --  Add an alpha channel.

267.        --  Return a newly allocated image copied from Pixbuf, but with an

268.        --  extra alpha channel.

269.        --  If Pixbuf already had an alpha channel, the two images have exactly

270.        --  the same contents.

271.        --  If Substitute_Color is True, the color (Red, Green, Blue) is

272.        --  substituted for zero opacity.

273.        --  If Substitute_Color is False, Red, Green and Blue are ignored, and a

274.        --  new color is created with zero opacity.

276.        procedure Copy_AreaTo API docTo body

277.          (Src_Pixbuf  : Gdk_PixbufTo API docTo spec;

278.           Src_X       : GintTo API docTo spec;

279.           Src_Y       : GintTo API docTo spec;

280.           Width       : GintTo API docTo spec;

281.           Height      : GintTo API docTo spec;

282.           Dest_Pixbuf : Gdk_PixbufTo API docTo spec;

283.           Dest_X      : GintTo API docTo spec;

284.           Dest_Y      : GintTo API docTo spec);

285.        --  Copy a rectangular area from Src_pixbuf to Dest_pixbuf.

286.        --  Conversion of pixbuf formats is done automatically.

288.        procedure Saturate_And_PixelateTo API docTo body

289.          (Src        : Gdk_PixbufTo API docTo spec;

290.           Dest       : Gdk_PixbufTo API docTo spec;

291.           Saturation : GfloatTo API docTo spec;

292.           Pixelate   : Boolean := True);

293.        --  Brighten/darken and optionally make it pixelated-looking.

295.        ---------------

296.        -- Rendering --

297.        ---------------

299.        procedure Render_Threshold_AlphaTo API docTo body

300.          (Pixbuf          : Gdk_PixbufTo API docTo spec;

301.           Bitmap          : Gdk.Bitmap.Gdk_BitmapTo API docTo spec;

302.           Src_X           : GintTo API docTo spec;

303.           Src_Y           : GintTo API docTo spec;

304.           Dest_X          : GintTo API docTo spec;

305.           Dest_Y          : GintTo API docTo spec;

306.           Width           : GintTo API docTo spec;

307.           Height          : GintTo API docTo spec;

308.           Alpha_Threshold : Alpha_RangeTo API docTo spec);

309.        --  Take the opacity values in a rectangular portion of a pixbuf and

310.        --  thresholds them to produce a bi-level alpha mask that can be used as

311.        --  a clipping mask for a drawable.

312.        --  Bitmap is the bitmap where the bilevel mask will be painted to.

313.        --  Alpha_Threshold are the opacity values below which a pixel will be

314.        --  painted as zero. All other values will be painted as one.

316.        procedure Render_To_DrawableTo API docTo body

317.          (Pixbuf   : Gdk_PixbufTo API docTo spec;

318.           Drawable : Gdk.Drawable.Gdk_DrawableTo API docTo spec;

319.           GC       : Gdk.GC.Gdk_GCTo API docTo spec;

320.           Src_X    : GintTo API docTo spec;

321.           Src_Y    : GintTo API docTo spec;

322.           Dest_X   : GintTo API docTo spec;

323.           Dest_Y   : GintTo API docTo spec;

324.           Width    : GintTo API docTo spec;

325.           Height   : GintTo API docTo spec;

326.           DitherTo API docTo body   : Gdk.Rgb.Gdk_Rgb_DitherTo API docTo spec := Gdk.Rgb.Dither_Normal;

327.           X_Dither : GintTo API docTo spec := 0;

328.           Y_Dither : GintTo API docTo spec := 0);

329.        --  Render a rectangular portion of a pixbuf to a drawable while using the

330.        --  specified GC. This is done using Gdk.RGB, so the specified drawable

331.        --  must have the Gdk.RGB visual and colormap.  Note that this function

332.        --  will ignore the opacity information for images with an alpha channel;

333.        --  the GC must already have the clipping mask set if you want transparent

334.        --  regions to show through.

335.        --

336.        --  For an explanation of dither offsets, see the Gdk.RGB documentation.  In

337.        --  brief, the dither offset is important when re-rendering partial regions

338.        --  of an image to a rendered version of the full image, or for when the

339.        --  offsets to a base position change, as in scrolling.  The dither matrix

340.        --  has to be shifted for consistent visual results.  If you do not have

341.        --  any of these cases, the dither offsets can be both zero.

343.        procedure Render_To_Drawable_AlphaTo API docTo body

344.          (Pixbuf          : Gdk_PixbufTo API docTo spec;

345.           Drawable        : Gdk.Drawable.Gdk_DrawableTo API docTo spec;

346.           Src_X           : GintTo API docTo spec;

347.           Src_Y           : GintTo API docTo spec;

348.           Dest_X          : GintTo API docTo spec;

349.           Dest_Y          : GintTo API docTo spec;

350.           Width           : GintTo API docTo spec;

351.           Height          : GintTo API docTo spec;

352.           AlphaTo API docTo body           : Alpha_ModeTo API docTo spec;

353.           Alpha_Threshold : Alpha_RangeTo API docTo spec;

354.           DitherTo API docTo body          : Gdk.Rgb.Gdk_Rgb_DitherTo API docTo spec := Gdk.Rgb.Dither_Normal;

355.           X_Dither        : GintTo API docTo spec := 0;

356.           Y_Dither        : GintTo API docTo spec := 0);

357.        --  Render a rectangular portion of a pixbuf to a drawable.

358.        --  This is done using Gdk.RGB, so the specified drawable must have the

359.        --  Gdk_RGB visual and colormap. When used with Alpha_Bilevel, this function

360.        --  has to create a bitmap out of the thresholded alpha channel of the

361.        --  image and, it has to set this bitmap as the clipping mask for the GC

362.        --  used for drawing.  This can be a significant performance penalty

363.        --  depending on the size and the complexity of the alpha channel of the

364.        --  image. If performance is crucial, consider handling the alpha channel

365.        --  yourself (possibly by caching it in your application) and using

366.        --  Render_To_Drawable or Gdk.RGB directly instead.

367.        --

368.        --  If the image does have opacity information and Alpha_Mode

369.        --  is Alpha_Bilevel, specifies the threshold value for opacity values

371.        procedure Render_Pixmap_And_MaskTo API docTo body

372.          (Pixbuf          : Gdk_PixbufTo API docTo spec;

373.           Pixmap          : out Gdk.Pixmap.Gdk_PixmapTo API docTo spec;

374.           Mask            : out Gdk.Bitmap.Gdk_BitmapTo API docTo spec;

375.           Alpha_Threshold : Alpha_RangeTo API docTo spec);

376.        procedure Render_Pixmap_And_Mask_For_ColormapTo API docTo body

377.          (Pixbuf          : Gdk_PixbufTo API docTo spec;

378.           Colormap        : Gdk.Color.Gdk_ColormapTo API docTo spec;

379.           Pixmap          : out Gdk.Pixmap.Gdk_PixmapTo API docTo spec;

380.           Mask            : out Gdk.Bitmap.Gdk_BitmapTo API docTo spec;

381.           Alpha_Threshold : Alpha_RangeTo API docTo spec);

382.        --  Creates a pixmap and a mask bitmap which are returned in the Pixmap

383.        --  and Mask arguments, respectively, and renders a pixbuf and its

384.        --  corresponding tresholded alpha mask to them.  This is merely a

385.        --  convenience function; applications that need to render pixbufs with

386.        --  dither offsets or to given drawables should use Render_To_Drawable_Alpha

387.        --  or Render_To_Drawable

388.        --  The pixmap that is created uses Colormap.

389.        --  This colormap must match the colormap of the window where the pixmap

390.        --  will eventually be used or an error will result.

392.        function Get_From_DrawableTo API docTo body

393.          (Dest   : Gdk_PixbufTo API docTo spec;

394.           Src    : Gdk.Drawable.Gdk_DrawableTo API docTo spec;

395.           Cmap   : Gdk.Color.Gdk_ColormapTo API docTo spec;

396.           Src_X  : GintTo API docTo spec;

397.           Src_Y  : GintTo API docTo spec;

398.           Dest_X : GintTo API docTo spec;

399.           Dest_Y : GintTo API docTo spec;

400.           Width  : GintTo API docTo spec;

401.           Height : GintTo API docTo spec) return Gdk_PixbufTo API docTo spec;

402.        --  Transfer image data from a Gdk drawable and converts it to an RGB(A)

403.        --  representation inside a Gdk_Pixbuf.

404.        --

405.        --  If the drawable src is a pixmap, then a suitable colormap must be

406.        --  specified, since pixmaps are just blocks of pixel data without an

407.        --  associated colormap.

408.        --  If the drawable is a window, the Cmap argument will be ignored and the

409.        --  window's own colormap will be used instead.

410.        --

411.        --  If the specified destination pixbuf Dest is Null_Pixbuf, then this

412.        --  function will create an RGB pixbuf with 8 bits per channel and no

413.        --  alpha, with the same size specified by the Width and Height

414.        --  arguments. In this case, the Dest_x and Dest_y arguments must be

415.        --  specified as 0, otherwise the function will return Null_Pixbuf.  If the

416.        --  specified destination pixbuf is not Null_Pixbuf and it contains alpha

417.        --  information, then the filled pixels will be set to full opacity.

418.        --

419.        --  If the specified drawable is a pixmap, then the requested source

420.        --  rectangle must be completely contained within the pixmap, otherwise the

421.        --  function will return Null_Pixbuf.

422.        --

423.        --  If the specified drawable is a window, then it must be viewable, i.e.

424.        --  all of its ancestors up to the root window must be mapped.  Also, the

425.        --  specified source rectangle must be completely contained within the

426.        --  window and within the screen.  If regions of the window are obscured by

427.        --  non-inferior windows, the contents of those regions are undefined.

428.        --  The contents of regions obscured by inferior windows of a different

429.        --  depth than that of the source window will also be undefined.

430.        --

431.        --  Return value: The same pixbuf as Dest if it was non-NULL, or a

432.        --  newly-created pixbuf with a reference count of 1 if no destination

433.        --  pixbuf was specified.

435.        -------------

436.        -- Scaling --

437.        -------------

439.        procedure ScaleTo API docTo body

440.          (Src          : Gdk_PixbufTo API docTo spec;

441.           Dest         : Gdk_PixbufTo API docTo spec;

442.           Dest_X       : GintTo API docTo spec;

443.           Dest_Y       : GintTo API docTo spec;

444.           Dest_Width   : GintTo API docTo spec;

445.           Dest_Height  : GintTo API docTo spec;

446.           Offset_X     : GdoubleTo API docTo spec := 0.0;

447.           Offset_Y     : GdoubleTo API docTo spec := 0.0;

448.           Scale_X      : GdoubleTo API docTo spec := 1.0;

449.           Scale_Y      : GdoubleTo API docTo spec := 1.0;

450.           Inter_TypeTo API docTo body   : Gdk_Interp_TypeTo API docTo spec := Interp_Bilinear);

451.        --  Transform the source image by scaling by Scale_x and Scale_y then

452.        --  translating by Offset_x and Offset_y.

453.        --  The image is then rendered in the rectangle (Dest_x, Dest_y,

454.        --  Dest_width, Dest_height) of the resulting image onto the destination

455.        --  drawable replacing the previous contents.

457.        procedure CompositeTo API docTo body

458.          (Src           : Gdk_PixbufTo API docTo spec;

459.           Dest          : Gdk_PixbufTo API docTo spec;

460.           Dest_X        : GintTo API docTo spec;

461.           Dest_Y        : GintTo API docTo spec;

462.           Dest_Width    : GintTo API docTo spec;

463.           Dest_Height   : GintTo API docTo spec;

464.           Offset_X      : GdoubleTo API docTo spec := 0.0;

465.           Offset_Y      : GdoubleTo API docTo spec := 0.0;

466.           Scale_X       : GdoubleTo API docTo spec := 1.0;

467.           Scale_Y       : GdoubleTo API docTo spec := 1.0;

468.           Inter_TypeTo API docTo body    : Gdk_Interp_TypeTo API docTo spec := Interp_Bilinear;

469.           Overall_Alpha : Alpha_RangeTo API docTo spec := 128);

470.        --  Transform the source image by scaling by Scale_X and Scale_Y then

471.        --  translating by Offset_X and Offset_Y, then composite the rectangle

472.        --  (Dest_X, Dest_Y, Dest_Width, Dest_Height) of the resulting image onto

473.        --  the destination drawable.

475.        procedure Composite_ColorTo API docTo body

476.          (Src           : Gdk_PixbufTo API docTo spec;

477.           Dest          : Gdk_PixbufTo API docTo spec;

478.           Dest_X        : GintTo API docTo spec;

479.           Dest_Y        : GintTo API docTo spec;

480.           Dest_Width    : GintTo API docTo spec;

481.           Dest_Height   : GintTo API docTo spec;

482.           Offset_X      : GdoubleTo API docTo spec := 0.0;

483.           Offset_Y      : GdoubleTo API docTo spec := 0.0;

484.           Scale_X       : GdoubleTo API docTo spec := 1.0;

485.           Scale_Y       : GdoubleTo API docTo spec := 1.0;

486.           Inter_TypeTo API docTo body    : Gdk_Interp_TypeTo API docTo spec := Interp_Bilinear;

487.           Overall_Alpha : Alpha_RangeTo API docTo spec := 128;

488.           Check_X       : GintTo API docTo spec := 0;

489.           Check_Y       : GintTo API docTo spec := 0;

490.           Check_Size    : GintTo API docTo spec := 0;

491.           Color1        : Guint32To API docTo spec := 0;

492.           Color2        : Guint32To API docTo spec := 0);

493.        --  Transform the source image by scaling by Scale_x and Scale_y then

494.        --  translating by Offset_x and Offset_y, then composites the rectangle

495.        --  (Dest_X, Dest_Y, Dest_Width, Dest_Height) of the resulting image with

496.        --  a checkboard of the colors Color1 and Color2 and renders it onto the

497.        --  destination drawable.

498.        --  The origin of checkboard is at (Check_x, Check_y)

499.        --  Color1 is the color at the upper left of the check.

501.        function Scale_SimpleTo API docTo body

502.          (Src           : Gdk_PixbufTo API docTo spec;

503.           Dest_Width    : GintTo API docTo spec;

504.           Dest_Height   : GintTo API docTo spec;

505.           Inter_TypeTo API docTo body    : Gdk_Interp_TypeTo API docTo spec := Interp_Bilinear) return Gdk_PixbufTo API docTo spec;

506.        --  Scale the Src image to Dest_width x Dest_height and render the result

507.        --  into a new pixbuf.

509.        function Composite_Color_SimpleTo API docTo body

510.          (Src           : Gdk_PixbufTo API docTo spec;

511.           Dest_Width    : GintTo API docTo spec;

512.           Dest_Height   : GintTo API docTo spec;

513.           Inter_TypeTo API docTo body    : Gdk_Interp_TypeTo API docTo spec := Interp_Bilinear;

514.           Overall_Alpha : Alpha_RangeTo API docTo spec := 128;

515.           Color1        : Guint32To API docTo spec := 0;

516.           Color2        : Guint32To API docTo spec := 0) return Gdk_PixbufTo API docTo spec;

517.        --  Scale Src to Dest_width x Dest_height and composite the result with

518.        --  a checkboard of colors Color1 and Color2 and render the result into

519.        --  a new pixbuf.

521.        -----------------------

522.        -- Animation support --

523.        -----------------------

525.        function Get_Type_AnimationTo API docTo body return Glib.GTypeTo API docTo spec;

526.        --  Return the internal value associated with a Gdk_Pixbuf_Animation.

528.        procedure Gdk_New_From_FileTo API docTo body

529.          (Animation : out Gdk_Pixbuf_AnimationTo API docTo spec;

530.           Filename  : String;

531.           Error     : out GErrorTo API docTo spec);

532.        --  Create a new animation by loading it from a file.

533.        --  The file format is detected automatically. If the file's format does not

534.        --  support multi-frame images, then an animation with a single frame will

535.        --  be created. Possible errors are in the Pixbuf_Error and GFile_Error

536.        --  domains.

537.        --  On return, Animation is a newly created animation with a reference count

538.        --  of 1, or null if any of several error conditions ocurred: the file could

539.        --  not be opened, there was no loader for the file's format, there was not

540.        --  enough memory to allocate the image buffer, or the image file contained

541.        --  invalid data.

543.        procedure RefTo API docTo body (Animation : Gdk_Pixbuf_AnimationTo API docTo spec);

544.        --  Increment the reference counting on the animation.

546.        procedure UnrefTo API docTo body (Animation : Gdk_Pixbuf_AnimationTo API docTo spec);

547.        --  Decrement the reference counting on the animation.

549.        function Get_WidthTo API docTo body (Animation : Gdk_Pixbuf_AnimationTo API docTo spec) return GintTo API docTo spec;

550.        --  Return the width of the bounding box of a pixbuf animation.

552.        function Get_HeightTo API docTo body (Animation : Gdk_Pixbuf_AnimationTo API docTo spec) return GintTo API docTo spec;

553.        --  Return the height of the bounding box of a pixbuf animation.

555.        function Is_Static_ImageTo API docTo body (Animation : Gdk_Pixbuf_AnimationTo API docTo spec) return Boolean;

556.        --  If you load a file with Gdk_New_From_File and it turns out to be a

557.        --  plain, unanimated image, then this function will return True.

558.        --  Use Get_Static_Image to retrieve the image.

560.        function Get_Static_ImageTo API docTo body

561.          (Animation : Gdk_Pixbuf_AnimationTo API docTo spec) return Gdk_PixbufTo API docTo spec;

562.        --  If an animation is really just a plain image (has only one frame),

563.        --  this function returns that image. If the animation is an animation,

564.        --  this function returns a reasonable thing to display as a static

565.        --  unanimated image, which might be the first frame, or something more

566.        --  sophisticated. If an animation hasn't loaded any frames yet, this

567.        --  function will return null.

569.        function Get_IterTo API docTo body

570.          (Animation  : Gdk_Pixbuf_AnimationTo API docTo spec;

571.           Start_Time : GTime_Val_AccessTo API docTo spec := null)

572.           return Gdk_Pixbuf_Animation_IterTo API docTo spec;

573.        --  Get an iterator for displaying an animation. The iterator provides

574.        --  the frames that should be displayed at a given time.

575.        --  It should be freed after use with Unref.

576.        --

577.        --  Start_Time would normally come from G_Get_Current_Time, and marks the

578.        --  beginning of animation playback. After creating an iterator, you should

579.        --  immediately display the pixbuf returned by Get_Pixbuf. Then, you should

580.        --  install a timeout (with Timeout_Add) or by some other mechanism to

581.        --  ensure that you'll update the image after Get_Delay_Time milliseconds.

582.        --  Each time the image is updated, you should reinstall the timeout with

583.        --  the new, possibly-changed delay time.

584.        --

585.        --  As a shortcut, if Start_Time is equal to null, the result of

586.        --  G_Get_Current_Time will be used automatically.

587.        --

588.        --  To update the image (i.e. possibly change the result of Get_Pixbuf to a

589.        --  new frame of the animation), call Advance.

590.        --

591.        --  If you're using Gdk_Pixbuf_Loader, in addition to updating the image

592.        --  after the delay time, you should also update it whenever you

593.        --  receive the area_updated signal and On_Currently_Loading_Frame returns

594.        --  True. In this case, the frame currently being fed into the loader

595.        --  has received new data, so needs to be refreshed. The delay time for

596.        --  a frame may also be modified after an area_updated signal, for

597.        --  example if the delay time for a frame is encoded in the data after

598.        --  the frame itself. So your timeout should be reinstalled after any

599.        --  area_updated signal.

600.        --

601.        --  A delay time of -1 is possible, indicating "infinite."

603.        ---------------

604.        -- Iterators --

605.        ---------------

607.        function Get_Type_Animation_IterTo API docTo body return Glib.GTypeTo API docTo spec;

608.        --  Return the internal value associated with a Gdk_Pixbuf_Animation_Iter.

610.        procedure RefTo API docTo body (Iter : Gdk_Pixbuf_Animation_IterTo API docTo spec);

611.        --  Increment the reference counting on the iterator.

613.        procedure UnrefTo API docTo body (Iter : Gdk_Pixbuf_Animation_IterTo API docTo spec);

614.        --  Decrement the reference counting on the iterator.

616.        function Get_Delay_TimeTo API docTo body (Iter : Gdk_Pixbuf_Animation_IterTo API docTo spec) return GintTo API docTo spec;

617.        --  Return the number of milliseconds the current pixbuf should be displayed

618.        --  or -1 if the current pixbuf should be displayed forever. Timeout_Add

619.        --  conveniently takes a timeout in milliseconds, so you can use a timeout

620.        --  to schedule the next update.

622.        function Get_PixbufTo API docTo body (Iter : Gdk_Pixbuf_Animation_IterTo API docTo spec) return Gdk_PixbufTo API docTo spec;

623.        --  Return the current pixbuf which should be displayed.

624.        --  The pixbuf will be the same size as the animation itself (Get_Width,

625.        --  Get_Height). This pixbuf should be displayed for Get_Delay_Time

626.        --  milliseconds. The caller of this function does not own a reference to

627.        --  the returned pixbuf; the returned pixbuf will become invalid when the

628.        --  iterator advances to the next frame, which may happen anytime you call

629.        --  Advance. Copy the pixbuf to keep it (don't just add a reference), as it

630.        --  may get recycled as you advance the iterator.

632.        function On_Currently_Loading_FrameTo API docTo body

633.          (Iter : Gdk_Pixbuf_Animation_IterTo API docTo spec) return Boolean;

634.        --  Used to determine how to respond to the area_updated signal on

635.        --  Gdk_Pixbuf_Loader when loading an animation. area_updated is emitted

636.        --  for an area of the frame currently streaming in to the loader. So if

637.        --  you're on the currently loading frame, you need to redraw the screen for

638.        --  the updated area.

640.        function AdvanceTo API docTo body

641.          (Iter          : Gdk_Pixbuf_Animation_IterTo API docTo spec;

642.           Current_Timer : GTime_Val_AccessTo API docTo spec := null) return Boolean;

643.        --  Possibly advance an animation to a new frame.

644.        --  Chooses the frame based on the start time passed to Get_Iter.

645.        --

646.        --  Current_Time would normally come from G_Get_Current_Time, and

647.        --  must be greater than or equal to the time passed to Get_Iter,

648.        --  and must increase or remain unchanged each time Get_Pixbuf is

649.        --  called. That is, you can't go backward in time; animations only

650.        --  play forward.

651.        --

652.        --  As a shortcut, pass null for the current time and G_Get_Current_Time

653.        --  will be invoked on your behalf. So you only need to explicitly pass

654.        --  Current_Time if you're doing something odd like playing the animation

655.        --  at double speed.

656.        --

657.        --  If this function returns False, there's no need to update the animation

658.        --  display, assuming the display had been rendered prior to advancing;

659.        --  if True, you need to call Get_Pixbuf and update the display with the new

660.        --  pixbuf.

662.        -------------

663.        -- Cursors --

664.        -------------

666.        procedure Gdk_New_From_PixbufTo API docTo body

667.          (Cursor  : out Gdk.Cursor.Gdk_CursorTo API docTo spec;

668.           Display : Gdk.Display.Gdk_DisplayTo API docTo spec := Gdk.Display.Get_DefaultTo API docTo specTo body;

669.           Pixbuf  : Gdk_PixbufTo API docTo spec;

670.           X       : Glib.GintTo API docTo spec;

671.           Y       : Glib.GintTo API docTo spec);

672.        --  Create a cursor from a pixbuf.

673.        --  Not all GDK backends support RGBA cursors. If they are not supported,

674.        --  a monochrome approximation will be displayed.

675.        --  The functions gdk.display.supports_cursor_alpha and

676.        --  gdk.display.supports_cursor_color can be used to determine whether RGBA

677.        --  cursors are supported;

678.        --  gdk.display.get_default_cursor_size and

679.        --  gdk.display.get_maximal_cursor_size give information about cursor sizes.

680.        --  On the X backend, support for RGBA cursors requires a sufficently new

681.        --  version of the X Render extension.

683.        function Get_ImageTo API docTo body (Cursor : Gdk.Cursor.Gdk_CursorTo API docTo spec) return Gdk_PixbufTo API docTo spec;

684.        --  Return the image stored in the cursor

686.        --  <doc_ignore>

687.        function ConvertTo API docTo body (P : System.Address) return Gdk_PixbufTo API docTo spec;

688.        --  </doc_ignore>

690.     private

692.        type Gdk_Pixbuf_RecordTo API docTo spec is new Glib.Object.GObject_RecordTo API docTo specTo body with null record;

694.        pragma Import (C, Get_TypeTo API docTo spec, "gdk_pixbuf_get_type");

695.        pragma Import (C, Get_Type_AnimationTo API docTo spec, "gdk_pixbuf_animation_get_type");

696.        pragma Import

697.          (C, Get_Type_Animation_IterTo API docTo spec, "gdk_pixbuf_animation_iter_get_type");

698.        pragma Import (C, Get_IterTo API docTo spec, "gdk_pixbuf_animation_get_iter");

699.        pragma Import

700.          (C, Get_Delay_TimeTo API docTo spec, "gdk_pixbuf_animation_iter_get_delay_time");

702.     end Gdk.PixbufTo API docTo specTo body;