gdk_pixbuf2 2.2.4-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (218) hide show
  1. checksums.yaml +7 -0
  2. data/README +29 -0
  3. data/Rakefile +34 -0
  4. data/ext/gdk_pixbuf2/depend +11 -0
  5. data/ext/gdk_pixbuf2/extconf.rb +66 -0
  6. data/ext/gdk_pixbuf2/gdk_pixbuf2.def +2 -0
  7. data/ext/gdk_pixbuf2/rbgdk-pixbuf-format.c +179 -0
  8. data/ext/gdk_pixbuf2/rbgdk-pixbuf-loader.c +164 -0
  9. data/ext/gdk_pixbuf2/rbgdk-pixbuf.c +737 -0
  10. data/ext/gdk_pixbuf2/rbgdk-pixbuf.h +41 -0
  11. data/ext/gdk_pixbuf2/rbgdk-pixbuf2conversions.h +42 -0
  12. data/ext/gdk_pixbuf2/rbgdk-pixbuf2private.h +35 -0
  13. data/ext/gdk_pixbuf2/rbgdk-pixbufanimation.c +93 -0
  14. data/ext/gdk_pixbuf2/rbgdk-pixbufanimationiter.c +71 -0
  15. data/ext/gdk_pixbuf2/rbgdk-pixbufsimpleanim.c +53 -0
  16. data/ext/gdk_pixbuf2/rbgdk-pixdata.c +213 -0
  17. data/extconf.rb +49 -0
  18. data/lib/2.0/gdk_pixbuf2.so +0 -0
  19. data/lib/2.1/gdk_pixbuf2.so +0 -0
  20. data/lib/2.2/gdk_pixbuf2.so +0 -0
  21. data/lib/gdk_pixbuf2.rb +57 -0
  22. data/sample/anim.rb +38 -0
  23. data/sample/composite.rb +45 -0
  24. data/sample/flip.rb +47 -0
  25. data/sample/floppybuddy.gif +0 -0
  26. data/sample/format.rb +39 -0
  27. data/sample/gnome-foot.png +0 -0
  28. data/sample/inline.rb +37 -0
  29. data/sample/loader.rb +20 -0
  30. data/sample/pixdata.rb +39 -0
  31. data/sample/rotate.rb +45 -0
  32. data/sample/save.rb +25 -0
  33. data/sample/scale.rb +45 -0
  34. data/sample/simpleanim.rb +34 -0
  35. data/sample/utils.rb +44 -0
  36. data/sample/xpm.rb +40 -0
  37. data/vendor/local/bin/gdk-pixbuf-csource.exe +0 -0
  38. data/vendor/local/bin/gdk-pixbuf-pixdata.exe +0 -0
  39. data/vendor/local/bin/gdk-pixbuf-query-loaders.exe +0 -0
  40. data/vendor/local/bin/libgdk_pixbuf-2.0-0.dll +0 -0
  41. data/vendor/local/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-animation.h +204 -0
  42. data/vendor/local/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-core.h +464 -0
  43. data/vendor/local/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-enum-types.h +33 -0
  44. data/vendor/local/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-features.h +120 -0
  45. data/vendor/local/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-io.h +343 -0
  46. data/vendor/local/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-loader.h +108 -0
  47. data/vendor/local/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-marshal.h +36 -0
  48. data/vendor/local/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-simple-anim.h +64 -0
  49. data/vendor/local/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-transform.h +158 -0
  50. data/vendor/local/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf.h +43 -0
  51. data/vendor/local/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixdata.h +168 -0
  52. data/vendor/local/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache +139 -0
  53. data/vendor/local/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.a +0 -0
  54. data/vendor/local/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.dll +0 -0
  55. data/vendor/local/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.dll.a +0 -0
  56. data/vendor/local/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.la +41 -0
  57. data/vendor/local/lib/gdk_pixbuf-2.0.def +128 -0
  58. data/vendor/local/lib/girepository-1.0/GdkPixbuf-2.0.typelib +0 -0
  59. data/vendor/local/lib/libgdk_pixbuf-2.0.dll.a +0 -0
  60. data/vendor/local/lib/libgdk_pixbuf-2.0.la +41 -0
  61. data/vendor/local/lib/pkgconfig/gdk-pixbuf-2.0.pc +19 -0
  62. data/vendor/local/share/gir-1.0/GdkPixbuf-2.0.gir +3443 -0
  63. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/GdkPixbufLoader.html +827 -0
  64. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/annotation-glossary.html +65 -0
  65. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/api-index-2-12.html +35 -0
  66. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/api-index-2-14.html +46 -0
  67. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/api-index-2-2.html +108 -0
  68. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/api-index-2-26.html +50 -0
  69. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/api-index-2-28.html +47 -0
  70. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/api-index-2-30.html +35 -0
  71. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/api-index-2-4.html +72 -0
  72. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/api-index-2-6.html +65 -0
  73. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/api-index-2-8.html +39 -0
  74. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/api-index-deprecated.html +53 -0
  75. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/api-index-full.html +787 -0
  76. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/composite.png +0 -0
  77. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-Animations.html +1068 -0
  78. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-File-Loading.html +794 -0
  79. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-File-saving.html +864 -0
  80. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-Image-Data-in-Memory.html +491 -0
  81. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-Inline-data.html +639 -0
  82. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-Module-Interface.html +1298 -0
  83. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-Reference-Counting-and-Memory-Mangement.html +208 -0
  84. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-Scaling.html +914 -0
  85. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html +898 -0
  86. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-Utilities.html +381 -0
  87. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-Versioning.html +184 -0
  88. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-X-Drawables-to-Pixbufs.html +197 -0
  89. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-Xlib-Rendering.html +438 -0
  90. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-XlibRGB.html +1115 -0
  91. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-csource.html +167 -0
  92. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf-Xlib-initialization.html +159 -0
  93. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf-from-drawables.html +45 -0
  94. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf-rendering.html +44 -0
  95. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-query-loaders.html +85 -0
  96. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf.devhelp2 +226 -0
  97. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/home.png +0 -0
  98. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/index.html +150 -0
  99. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/index.sgml +322 -0
  100. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/left-insensitive.png +0 -0
  101. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/left.png +0 -0
  102. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/license.html +59 -0
  103. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/right-insensitive.png +0 -0
  104. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/right.png +0 -0
  105. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/rn01.html +101 -0
  106. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/rn02.html +50 -0
  107. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/style.css +476 -0
  108. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/up-insensitive.png +0 -0
  109. data/vendor/local/share/gtk-doc/html/gdk-pixbuf/up.png +0 -0
  110. data/vendor/local/share/license/gdk-pixbuf/AUTHORS +65 -0
  111. data/vendor/local/share/license/gdk-pixbuf/COPYING +482 -0
  112. data/vendor/local/share/locale/af/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  113. data/vendor/local/share/locale/ang/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  114. data/vendor/local/share/locale/ar/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  115. data/vendor/local/share/locale/as/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  116. data/vendor/local/share/locale/ast/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  117. data/vendor/local/share/locale/az/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  118. data/vendor/local/share/locale/be/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  119. data/vendor/local/share/locale/be@latin/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  120. data/vendor/local/share/locale/bg/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  121. data/vendor/local/share/locale/bn/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  122. data/vendor/local/share/locale/bn_IN/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  123. data/vendor/local/share/locale/br/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  124. data/vendor/local/share/locale/bs/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  125. data/vendor/local/share/locale/ca/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  126. data/vendor/local/share/locale/ca@valencia/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  127. data/vendor/local/share/locale/crh/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  128. data/vendor/local/share/locale/cs/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  129. data/vendor/local/share/locale/csb/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  130. data/vendor/local/share/locale/cy/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  131. data/vendor/local/share/locale/da/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  132. data/vendor/local/share/locale/de/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  133. data/vendor/local/share/locale/dz/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  134. data/vendor/local/share/locale/el/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  135. data/vendor/local/share/locale/en@shaw/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  136. data/vendor/local/share/locale/en_CA/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  137. data/vendor/local/share/locale/en_GB/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  138. data/vendor/local/share/locale/eo/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  139. data/vendor/local/share/locale/es/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  140. data/vendor/local/share/locale/et/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  141. data/vendor/local/share/locale/eu/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  142. data/vendor/local/share/locale/fa/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  143. data/vendor/local/share/locale/fi/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  144. data/vendor/local/share/locale/fr/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  145. data/vendor/local/share/locale/ga/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  146. data/vendor/local/share/locale/gl/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  147. data/vendor/local/share/locale/gu/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  148. data/vendor/local/share/locale/he/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  149. data/vendor/local/share/locale/hi/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  150. data/vendor/local/share/locale/hr/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  151. data/vendor/local/share/locale/hu/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  152. data/vendor/local/share/locale/hy/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  153. data/vendor/local/share/locale/ia/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  154. data/vendor/local/share/locale/id/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  155. data/vendor/local/share/locale/io/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  156. data/vendor/local/share/locale/is/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  157. data/vendor/local/share/locale/it/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  158. data/vendor/local/share/locale/ja/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  159. data/vendor/local/share/locale/ka/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  160. data/vendor/local/share/locale/km/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  161. data/vendor/local/share/locale/kn/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  162. data/vendor/local/share/locale/ko/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  163. data/vendor/local/share/locale/ku/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  164. data/vendor/local/share/locale/li/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  165. data/vendor/local/share/locale/lt/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  166. data/vendor/local/share/locale/lv/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  167. data/vendor/local/share/locale/mai/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  168. data/vendor/local/share/locale/mi/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  169. data/vendor/local/share/locale/mk/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  170. data/vendor/local/share/locale/ml/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  171. data/vendor/local/share/locale/mn/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  172. data/vendor/local/share/locale/mr/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  173. data/vendor/local/share/locale/ms/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  174. data/vendor/local/share/locale/my/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  175. data/vendor/local/share/locale/nb/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  176. data/vendor/local/share/locale/nds/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  177. data/vendor/local/share/locale/ne/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  178. data/vendor/local/share/locale/nl/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  179. data/vendor/local/share/locale/nn/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  180. data/vendor/local/share/locale/nso/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  181. data/vendor/local/share/locale/oc/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  182. data/vendor/local/share/locale/or/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  183. data/vendor/local/share/locale/pa/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  184. data/vendor/local/share/locale/pl/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  185. data/vendor/local/share/locale/ps/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  186. data/vendor/local/share/locale/pt/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  187. data/vendor/local/share/locale/pt_BR/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  188. data/vendor/local/share/locale/ro/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  189. data/vendor/local/share/locale/ru/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  190. data/vendor/local/share/locale/si/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  191. data/vendor/local/share/locale/sk/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  192. data/vendor/local/share/locale/sl/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  193. data/vendor/local/share/locale/sq/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  194. data/vendor/local/share/locale/sr/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  195. data/vendor/local/share/locale/sr@ije/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  196. data/vendor/local/share/locale/sr@latin/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  197. data/vendor/local/share/locale/sv/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  198. data/vendor/local/share/locale/ta/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  199. data/vendor/local/share/locale/te/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  200. data/vendor/local/share/locale/tg/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  201. data/vendor/local/share/locale/th/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  202. data/vendor/local/share/locale/tk/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  203. data/vendor/local/share/locale/tr/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  204. data/vendor/local/share/locale/tt/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  205. data/vendor/local/share/locale/ug/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  206. data/vendor/local/share/locale/uk/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  207. data/vendor/local/share/locale/uz/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  208. data/vendor/local/share/locale/uz@cyrillic/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  209. data/vendor/local/share/locale/vi/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  210. data/vendor/local/share/locale/wa/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  211. data/vendor/local/share/locale/xh/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  212. data/vendor/local/share/locale/yi/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  213. data/vendor/local/share/locale/zh_CN/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  214. data/vendor/local/share/locale/zh_HK/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  215. data/vendor/local/share/locale/zh_TW/LC_MESSAGES/gdk-pixbuf.mo +0 -0
  216. data/vendor/local/share/man/man1/gdk-pixbuf-csource.1 +135 -0
  217. data/vendor/local/share/man/man1/gdk-pixbuf-query-loaders.1 +73 -0
  218. metadata +273 -0
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env ruby
2
+ =begin
3
+ scale.rb - Ruby/GdkPixbuf sample script.
4
+
5
+ Copyright (c) 2002-2006 Ruby-GNOME2 Project Team
6
+ This program is licenced under the same licence as Ruby-GNOME2.
7
+
8
+ $Id: scale.rb,v 1.10 2006/06/17 14:38:08 mutoh Exp $
9
+ =end
10
+
11
+ require 'gtk2'
12
+
13
+ filename = ARGV[0]
14
+ unless filename
15
+ puts "ruby #{$0} filename"
16
+ exit(1)
17
+ end
18
+
19
+ vbox = Gtk::VBox.new
20
+
21
+ src = Gdk::Pixbuf.new(filename)
22
+ vbox.add(Gtk::Image.new(src))
23
+
24
+ dst = src.scale(200, 200, Gdk::Pixbuf::INTERP_NEAREST)
25
+ dst.scale!(src, 60, 60, 90, 90, -50, 50, 6, 3)
26
+ vbox.add(Gtk::Image.new(dst))
27
+
28
+ dst2 = Gdk::Pixbuf.new(Gdk::Pixbuf::COLORSPACE_RGB, true, 8, 200, 200)
29
+ dst2.scale!(src, 0, 0, 100, 100, 0, 0, 1.5, 1.5)
30
+
31
+ vbox.add(Gtk::Image.new(dst2))
32
+
33
+ dst3 = Gdk::Pixbuf.new(Gdk::Pixbuf::COLORSPACE_RGB, true, 8, 200, 200)
34
+ dst3.scale!(src, 0, 0, 200, 200, 0, 0, 5, 3, Gdk::Pixbuf::INTERP_HYPER)
35
+ vbox.add(Gtk::Image.new(dst3))
36
+
37
+ window = Gtk::Window.new
38
+ window.signal_connect('delete-event') do
39
+ Gtk.main_quit
40
+ end
41
+
42
+ window.add(vbox).show_all
43
+
44
+ Gtk.main
45
+
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env ruby
2
+ =begin
3
+ simpleanim.rb - Ruby/GdkPixbuf sample script for Gdk::PixbufSimpleAnim.
4
+
5
+ Inspired by http://mail.gnome.org/archives/gtk-perl-list/2005-September/msg00110.html
6
+
7
+ Copyright (c) 2002-2006 Ruby-GNOME2 Project Team
8
+ This program is licenced under the same licence as Ruby-GNOME2.
9
+
10
+ $Id: simpleanim.rb,v 1.2 2006/06/17 14:38:08 mutoh Exp $
11
+ =end
12
+
13
+ require 'gtk2'
14
+
15
+ $stdout.sync = true
16
+
17
+ simple_anim = Gdk::PixbufSimpleAnim.new(64, 64, 24)
18
+ store_pixels = []
19
+
20
+ print 'generating frames'
21
+ for red in 0 .. 126
22
+ store_pixels << pixels = ([ 4*(63-red).abs, 0, 0 ] * (64*64)).pack('C*')
23
+ pixbuf = Gdk::Pixbuf.new(pixels, Gdk::Pixbuf::COLORSPACE_RGB, false, 8, 64, 64, 64*3)
24
+ simple_anim.add_frame(pixbuf)
25
+ print '.'
26
+ end
27
+ puts 'done'
28
+
29
+ window = Gtk::Window.new
30
+ image = Gtk::Image.new(simple_anim)
31
+ window.add(image)
32
+ window.show_all
33
+ window.signal_connect('destroy') { Gtk.main_quit }
34
+ Gtk.main
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env ruby
2
+ =begin
3
+ utils.rb - Ruby/GdkPixbuf sample script.
4
+
5
+ Copyright (c) 2002-2006 Ruby-GNOME2 Project Team
6
+ This program is licenced under the same licence as Ruby-GNOME2.
7
+
8
+ $Id: utils.rb,v 1.4 2006/06/17 14:38:08 mutoh Exp $
9
+ =end
10
+
11
+ require 'gtk2'
12
+
13
+ filename = ARGV[0]
14
+ unless filename
15
+ puts "ruby #{$0} filename"
16
+ exit(1)
17
+ end
18
+
19
+ src = Gdk::Pixbuf.new(filename)
20
+
21
+ vbox = Gtk::VBox.new
22
+
23
+ dst = src.add_alpha(true, 0, 0, 0)
24
+ vbox.pack_start(Gtk::Image.new(dst))
25
+
26
+ dst = Gdk::Pixbuf.new(Gdk::Pixbuf::COLORSPACE_RGB, true, 8,
27
+ src.width + 20, src.height + 30)
28
+ src.copy_area(0, 0, src.width / 2, src.height / 2, dst, 10, 20)
29
+ vbox.pack_start(Gtk::Image.new(dst))
30
+
31
+ dst = src.saturate_and_pixelate(0.3, true)
32
+ vbox.pack_start(Gtk::Image.new(dst))
33
+
34
+ dst = src.fill!(0xff000099) #RGBA
35
+ vbox.pack_start(Gtk::Image.new(dst))
36
+
37
+ w = Gtk::Window.new.add(vbox)
38
+ w.signal_connect('delete-event') do
39
+ Gtk.main_quit
40
+ end
41
+
42
+ w.show_all
43
+
44
+ Gtk.main
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env ruby
2
+ =begin
3
+ xpm.rb - Ruby/GdkPixbuf sample script.
4
+
5
+ Copyright (c) 2002-2006 Ruby-GNOME2 Project Team
6
+ This program is licenced under the same licence as Ruby-GNOME2.
7
+
8
+ $Id: xpm.rb,v 1.5 2006/06/17 14:38:08 mutoh Exp $
9
+ =end
10
+
11
+ require 'gtk2'
12
+
13
+ r_xpm = [
14
+ "10 10 3 1",
15
+ " c None",
16
+ ". c #FE0B0B",
17
+ "+ c #FFFFFF",
18
+ "+.......++",
19
+ "+.. ..+",
20
+ "+.. ..+",
21
+ "+.. ...+",
22
+ "+.......++",
23
+ "+.....++++",
24
+ "+..++..+++",
25
+ "+..++...++",
26
+ "+..+++...+",
27
+ "+..++++..+"]
28
+
29
+ w = Gtk::Window.new
30
+ w.signal_connect('delete-event') do
31
+ Gtk.main_quit
32
+ end
33
+
34
+ src = Gdk::Pixbuf.new(r_xpm)
35
+ dst = src.scale(300, 300, Gdk::Pixbuf::INTERP_HYPER)
36
+
37
+ w.add(Gtk::Image.new(dst))
38
+ w.show_all
39
+
40
+ Gtk.main
@@ -0,0 +1,204 @@
1
+ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
2
+ /* GdkPixbuf library - Animation support
3
+ *
4
+ * Copyright (C) 1999 The Free Software Foundation
5
+ *
6
+ * Authors: Mark Crichton <crichton@gimp.org>
7
+ * Miguel de Icaza <miguel@gnu.org>
8
+ * Federico Mena-Quintero <federico@gimp.org>
9
+ * Havoc Pennington <hp@redhat.com>
10
+ *
11
+ * This library is free software; you can redistribute it and/or
12
+ * modify it under the terms of the GNU Lesser General Public
13
+ * License as published by the Free Software Foundation; either
14
+ * version 2 of the License, or (at your option) any later version.
15
+ *
16
+ * This library is distributed in the hope that it will be useful,
17
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19
+ * Lesser General Public License for more details.
20
+ *
21
+ * You should have received a copy of the GNU Lesser General Public
22
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
23
+ */
24
+
25
+ #ifndef GDK_PIXBUF_ANIMATION_H
26
+ #define GDK_PIXBUF_ANIMATION_H
27
+
28
+ #if defined(GDK_PIXBUF_DISABLE_SINGLE_INCLUDES) && !defined (GDK_PIXBUF_H_INSIDE) && !defined (GDK_PIXBUF_COMPILATION)
29
+ #error "Only <gdk-pixbuf/gdk-pixbuf.h> can be included directly."
30
+ #endif
31
+
32
+ #include <glib-object.h>
33
+ #include <gdk-pixbuf/gdk-pixbuf-core.h>
34
+
35
+ G_BEGIN_DECLS
36
+
37
+ /* Animation support */
38
+
39
+ /**
40
+ * GdkPixbufAnimation:
41
+ *
42
+ * An opaque struct representing an animation.
43
+ */
44
+ typedef struct _GdkPixbufAnimation GdkPixbufAnimation;
45
+
46
+
47
+ /**
48
+ * GdkPixbufAnimationIter:
49
+ *
50
+ * An opaque struct representing an iterator which points to a
51
+ * certain position in an animation.
52
+ */
53
+ typedef struct _GdkPixbufAnimationIter GdkPixbufAnimationIter;
54
+
55
+ #define GDK_TYPE_PIXBUF_ANIMATION (gdk_pixbuf_animation_get_type ())
56
+ #define GDK_PIXBUF_ANIMATION(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXBUF_ANIMATION, GdkPixbufAnimation))
57
+ #define GDK_IS_PIXBUF_ANIMATION(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXBUF_ANIMATION))
58
+
59
+ #define GDK_TYPE_PIXBUF_ANIMATION_ITER (gdk_pixbuf_animation_iter_get_type ())
60
+ #define GDK_PIXBUF_ANIMATION_ITER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXBUF_ANIMATION_ITER, GdkPixbufAnimationIter))
61
+ #define GDK_IS_PIXBUF_ANIMATION_ITER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXBUF_ANIMATION_ITER))
62
+
63
+ GType gdk_pixbuf_animation_get_type (void) G_GNUC_CONST;
64
+
65
+ #ifndef __GTK_DOC_IGNORE__
66
+ #ifdef G_OS_WIN32
67
+ #define gdk_pixbuf_animation_new_from_file gdk_pixbuf_animation_new_from_file_utf8
68
+ #endif
69
+ #endif
70
+
71
+ GdkPixbufAnimation *gdk_pixbuf_animation_new_from_file (const char *filename,
72
+ GError **error);
73
+ GdkPixbufAnimation *gdk_pixbuf_animation_new_from_stream (GInputStream *stream,
74
+ GCancellable *cancellable,
75
+ GError **error);
76
+ void gdk_pixbuf_animation_new_from_stream_async (GInputStream *stream,
77
+ GCancellable *cancellable,
78
+ GAsyncReadyCallback callback,
79
+ gpointer user_data);
80
+ GdkPixbufAnimation *gdk_pixbuf_animation_new_from_stream_finish (GAsyncResult*async_result,
81
+ GError **error);
82
+ GdkPixbufAnimation *gdk_pixbuf_animation_new_from_resource(const char *resource_path,
83
+ GError **error);
84
+
85
+ #ifndef GDK_PIXBUF_DISABLE_DEPRECATED
86
+ G_DEPRECATED_FOR(g_object_ref)
87
+ GdkPixbufAnimation *gdk_pixbuf_animation_ref (GdkPixbufAnimation *animation);
88
+ G_DEPRECATED_FOR(g_object_unref)
89
+ void gdk_pixbuf_animation_unref (GdkPixbufAnimation *animation);
90
+ #endif
91
+
92
+ int gdk_pixbuf_animation_get_width (GdkPixbufAnimation *animation);
93
+ int gdk_pixbuf_animation_get_height (GdkPixbufAnimation *animation);
94
+ gboolean gdk_pixbuf_animation_is_static_image (GdkPixbufAnimation *animation);
95
+ GdkPixbuf *gdk_pixbuf_animation_get_static_image (GdkPixbufAnimation *animation);
96
+
97
+ GdkPixbufAnimationIter *gdk_pixbuf_animation_get_iter (GdkPixbufAnimation *animation,
98
+ const GTimeVal *start_time);
99
+ GType gdk_pixbuf_animation_iter_get_type (void) G_GNUC_CONST;
100
+ int gdk_pixbuf_animation_iter_get_delay_time (GdkPixbufAnimationIter *iter);
101
+ GdkPixbuf *gdk_pixbuf_animation_iter_get_pixbuf (GdkPixbufAnimationIter *iter);
102
+ gboolean gdk_pixbuf_animation_iter_on_currently_loading_frame (GdkPixbufAnimationIter *iter);
103
+ gboolean gdk_pixbuf_animation_iter_advance (GdkPixbufAnimationIter *iter,
104
+ const GTimeVal *current_time);
105
+
106
+
107
+ #ifdef GDK_PIXBUF_ENABLE_BACKEND
108
+
109
+
110
+
111
+ /**
112
+ * GdkPixbufAnimationClass:
113
+ * @parent_class: the parent class
114
+ * @is_static_image: returns whether the given animation is just a static image.
115
+ * @get_static_image: returns a static image representing the given animation.
116
+ * @get_size: fills @width and @height with the frame size of the animation.
117
+ * @get_iter: returns an iterator for the given animation.
118
+ *
119
+ * Modules supporting animations must derive a type from
120
+ * #GdkPixbufAnimation, providing suitable implementations of the
121
+ * virtual functions.
122
+ */
123
+ typedef struct _GdkPixbufAnimationClass GdkPixbufAnimationClass;
124
+
125
+ #define GDK_PIXBUF_ANIMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF_ANIMATION, GdkPixbufAnimationClass))
126
+ #define GDK_IS_PIXBUF_ANIMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF_ANIMATION))
127
+ #define GDK_PIXBUF_ANIMATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXBUF_ANIMATION, GdkPixbufAnimationClass))
128
+
129
+ /* Private part of the GdkPixbufAnimation structure */
130
+ struct _GdkPixbufAnimation {
131
+ GObject parent_instance;
132
+
133
+ };
134
+
135
+ struct _GdkPixbufAnimationClass {
136
+ GObjectClass parent_class;
137
+
138
+ /*< public >*/
139
+
140
+ gboolean (*is_static_image) (GdkPixbufAnimation *anim);
141
+
142
+ GdkPixbuf* (*get_static_image) (GdkPixbufAnimation *anim);
143
+
144
+ void (*get_size) (GdkPixbufAnimation *anim,
145
+ int *width,
146
+ int *height);
147
+
148
+ GdkPixbufAnimationIter* (*get_iter) (GdkPixbufAnimation *anim,
149
+ const GTimeVal *start_time);
150
+
151
+ };
152
+
153
+
154
+
155
+ /**
156
+ * GdkPixbufAnimationIterClass:
157
+ * @parent_class: the parent class
158
+ * @get_delay_time: returns the time in milliseconds that the current frame
159
+ * should be shown.
160
+ * @get_pixbuf: returns the current frame.
161
+ * @on_currently_loading_frame: returns whether the current frame of @iter is
162
+ * being loaded.
163
+ * @advance: advances the iterator to @current_time, possibly changing the
164
+ * current frame.
165
+ *
166
+ * Modules supporting animations must derive a type from
167
+ * #GdkPixbufAnimationIter, providing suitable implementations of the
168
+ * virtual functions.
169
+ */
170
+ typedef struct _GdkPixbufAnimationIterClass GdkPixbufAnimationIterClass;
171
+
172
+ #define GDK_PIXBUF_ANIMATION_ITER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF_ANIMATION_ITER, GdkPixbufAnimationIterClass))
173
+ #define GDK_IS_PIXBUF_ANIMATION_ITER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF_ANIMATION_ITER))
174
+ #define GDK_PIXBUF_ANIMATION_ITER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXBUF_ANIMATION_ITER, GdkPixbufAnimationIterClass))
175
+
176
+ struct _GdkPixbufAnimationIter {
177
+ GObject parent_instance;
178
+
179
+ };
180
+
181
+ struct _GdkPixbufAnimationIterClass {
182
+ GObjectClass parent_class;
183
+
184
+ /*< public >*/
185
+
186
+ int (*get_delay_time) (GdkPixbufAnimationIter *iter);
187
+
188
+ GdkPixbuf* (*get_pixbuf) (GdkPixbufAnimationIter *iter);
189
+
190
+ gboolean (*on_currently_loading_frame) (GdkPixbufAnimationIter *iter);
191
+
192
+ gboolean (*advance) (GdkPixbufAnimationIter *iter,
193
+ const GTimeVal *current_time);
194
+ };
195
+
196
+
197
+ GType gdk_pixbuf_non_anim_get_type (void) G_GNUC_CONST;
198
+ GdkPixbufAnimation* gdk_pixbuf_non_anim_new (GdkPixbuf *pixbuf);
199
+
200
+ #endif /* GDK_PIXBUF_ENABLE_BACKEND */
201
+
202
+ G_END_DECLS
203
+
204
+ #endif /* GDK_PIXBUF_ANIMATION_H */
@@ -0,0 +1,464 @@
1
+ /* GdkPixbuf library - GdkPixbuf data structure
2
+ *
3
+ * Copyright (C) 2003 The Free Software Foundation
4
+ *
5
+ * Authors: Mark Crichton <crichton@gimp.org>
6
+ * Miguel de Icaza <miguel@gnu.org>
7
+ * Federico Mena-Quintero <federico@gimp.org>
8
+ * Havoc Pennington <hp@redhat.com>
9
+ *
10
+ * This library is free software; you can redistribute it and/or
11
+ * modify it under the terms of the GNU Lesser General Public
12
+ * License as published by the Free Software Foundation; either
13
+ * version 2 of the License, or (at your option) any later version.
14
+ *
15
+ * This library is distributed in the hope that it will be useful,
16
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
+ * Lesser General Public License for more details.
19
+ *
20
+ * You should have received a copy of the GNU Lesser General Public
21
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+ #ifndef GDK_PIXBUF_CORE_H
25
+ #define GDK_PIXBUF_CORE_H
26
+
27
+ #if defined(GDK_PIXBUF_DISABLE_SINGLE_INCLUDES) && !defined (GDK_PIXBUF_H_INSIDE) && !defined (GDK_PIXBUF_COMPILATION)
28
+ #error "Only <gdk-pixbuf/gdk-pixbuf.h> can be included directly."
29
+ #endif
30
+
31
+ #include <glib.h>
32
+ #include <glib-object.h>
33
+ #include <gio/gio.h>
34
+
35
+ G_BEGIN_DECLS
36
+
37
+ /**
38
+ * SECTION:gdk-pixbuf
39
+ * @Short_description: Information that describes an image.
40
+ * @Title: The GdkPixbuf Structure
41
+ *
42
+ * The #GdkPixbuf structure contains
43
+ * information that describes an image in memory.
44
+ *
45
+ * ## Image Data ## {#image-data}
46
+ *
47
+ * Image data in a pixbuf is stored in memory in uncompressed,
48
+ * packed format. Rows in the image are stored top to bottom, and
49
+ * in each row pixels are stored from left to right. There may be
50
+ * padding at the end of a row. The "rowstride" value of a pixbuf,
51
+ * as returned by gdk_pixbuf_get_rowstride(), indicates the number
52
+ * of bytes between rows.
53
+ *
54
+ * ## put_pixel() Example ## {#put-pixel}
55
+ *
56
+ * The following code illustrates a simple put_pixel()
57
+ * function for RGB pixbufs with 8 bits per channel with an alpha
58
+ * channel. It is not included in the gdk-pixbuf library for
59
+ * performance reasons; rather than making several function calls
60
+ * for each pixel, your own code can take shortcuts.
61
+ *
62
+ * |[<!-- language="C" -->
63
+ * static void
64
+ * put_pixel (GdkPixbuf *pixbuf, int x, int y, guchar red, guchar green, guchar blue, guchar alpha)
65
+ * {
66
+ * int width, height, rowstride, n_channels;
67
+ * guchar *pixels, *p;
68
+ *
69
+ * n_channels = gdk_pixbuf_get_n_channels (pixbuf);
70
+ *
71
+ * g_assert (gdk_pixbuf_get_colorspace (pixbuf) == GDK_COLORSPACE_RGB);
72
+ * g_assert (gdk_pixbuf_get_bits_per_sample (pixbuf) == 8);
73
+ * g_assert (gdk_pixbuf_get_has_alpha (pixbuf));
74
+ * g_assert (n_channels == 4);
75
+ *
76
+ * width = gdk_pixbuf_get_width (pixbuf);
77
+ * height = gdk_pixbuf_get_height (pixbuf);
78
+ *
79
+ * g_assert (x >= 0 && x < width);
80
+ * g_assert (y >= 0 && y < height);
81
+ *
82
+ * rowstride = gdk_pixbuf_get_rowstride (pixbuf);
83
+ * pixels = gdk_pixbuf_get_pixels (pixbuf);
84
+ *
85
+ * p = pixels + y * rowstride + x * n_channels;
86
+ * p[0] = red;
87
+ * p[1] = green;
88
+ * p[2] = blue;
89
+ * p[3] = alpha;
90
+ * }
91
+ * ]|
92
+ *
93
+ * This function will not work for pixbufs with images that are
94
+ * other than 8 bits per sample or channel, but it will work for
95
+ * most of the pixbufs that GTK+ uses.
96
+ *
97
+ * If you are doing memcpy() of raw pixbuf data, note that the last row
98
+ * in the pixbuf may not be as wide as the full rowstride, but rather
99
+ * just as wide as the pixel data needs to be. That is, it is unsafe to
100
+ * do `memcpy (dest, pixels, rowstride * height)` to copy a whole pixbuf.
101
+ * Use gdk_pixbuf_copy() instead, or compute the width in bytes of the
102
+ * last row as `width * ((n_channels * bits_per_sample + 7) / 8)`.
103
+ */
104
+
105
+
106
+ /**
107
+ * GdkPixbufAlphaMode:
108
+ * @GDK_PIXBUF_ALPHA_BILEVEL: A bilevel clipping mask (black and white)
109
+ * will be created and used to draw the image. Pixels below 0.5 opacity
110
+ * will be considered fully transparent, and all others will be
111
+ * considered fully opaque.
112
+ * @GDK_PIXBUF_ALPHA_FULL: For now falls back to #GDK_PIXBUF_ALPHA_BILEVEL.
113
+ * In the future it will do full alpha compositing.
114
+ *
115
+ * These values can be passed to
116
+ * gdk_pixbuf_render_to_drawable_alpha() to control how the alpha
117
+ * channel of an image should be handled. This function can create a
118
+ * bilevel clipping mask (black and white) and use it while painting
119
+ * the image. In the future, when the X Window System gets an alpha
120
+ * channel extension, it will be possible to do full alpha
121
+ * compositing onto arbitrary drawables. For now both cases fall
122
+ * back to a bilevel clipping mask.
123
+ */
124
+ typedef enum
125
+ {
126
+ GDK_PIXBUF_ALPHA_BILEVEL,
127
+ GDK_PIXBUF_ALPHA_FULL
128
+ } GdkPixbufAlphaMode;
129
+
130
+ /**
131
+ * GdkColorspace:
132
+ * @GDK_COLORSPACE_RGB: Indicates a red/green/blue additive color space.
133
+ *
134
+ * This enumeration defines the color spaces that are supported by
135
+ * the gdk-pixbuf library. Currently only RGB is supported.
136
+ */
137
+ /* Note that these values are encoded in inline pixbufs
138
+ * as ints, so don't reorder them
139
+ */
140
+ typedef enum {
141
+ GDK_COLORSPACE_RGB
142
+ } GdkColorspace;
143
+
144
+ /* All of these are opaque structures */
145
+
146
+ /**
147
+ * GdkPixbuf:
148
+ *
149
+ * This is the main structure in the gdk-pixbuf library. It is
150
+ * used to represent images. It contains information about the
151
+ * image's pixel data, its color space, bits per sample, width and
152
+ * height, and the rowstride (the number of bytes between the start of
153
+ * one row and the start of the next).
154
+ */
155
+ typedef struct _GdkPixbuf GdkPixbuf;
156
+
157
+ #define GDK_TYPE_PIXBUF (gdk_pixbuf_get_type ())
158
+ #define GDK_PIXBUF(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXBUF, GdkPixbuf))
159
+ #define GDK_IS_PIXBUF(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXBUF))
160
+
161
+
162
+ /**
163
+ * GdkPixbufDestroyNotify:
164
+ * @pixels: (array) (element-type guint8): The pixel array of the pixbuf
165
+ * that is being finalized.
166
+ * @data: (closure): User closure data.
167
+ *
168
+ * A function of this type is responsible for freeing the pixel array
169
+ * of a pixbuf. The gdk_pixbuf_new_from_data() function lets you
170
+ * pass in a pre-allocated pixel array so that a pixbuf can be
171
+ * created from it; in this case you will need to pass in a function
172
+ * of #GdkPixbufDestroyNotify so that the pixel data can be freed
173
+ * when the pixbuf is finalized.
174
+ */
175
+ typedef void (* GdkPixbufDestroyNotify) (guchar *pixels, gpointer data);
176
+
177
+ /**
178
+ * GDK_PIXBUF_ERROR:
179
+ *
180
+ * Error domain used for pixbuf operations. Indicates that the error code
181
+ * will be in the #GdkPixbufError enumeration. See #GError for
182
+ * information on error domains and error codes.
183
+ */
184
+ #define GDK_PIXBUF_ERROR gdk_pixbuf_error_quark ()
185
+
186
+ /**
187
+ * GdkPixbufError:
188
+ * @GDK_PIXBUF_ERROR_CORRUPT_IMAGE: An image file was broken somehow.
189
+ * @GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY: Not enough memory.
190
+ * @GDK_PIXBUF_ERROR_BAD_OPTION: A bad option was passed to a pixbuf save module.
191
+ * @GDK_PIXBUF_ERROR_UNKNOWN_TYPE: Unknown image type.
192
+ * @GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION: Don't know how to perform the
193
+ * given operation on the type of image at hand.
194
+ * @GDK_PIXBUF_ERROR_FAILED: Generic failure code, something went wrong.
195
+ *
196
+ * An error code in the #GDK_PIXBUF_ERROR domain. Many gdk-pixbuf
197
+ * operations can cause errors in this domain, or in the #G_FILE_ERROR
198
+ * domain.
199
+ */
200
+ typedef enum {
201
+ /* image data hosed */
202
+ GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
203
+ /* no mem to load image */
204
+ GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
205
+ /* bad option passed to save routine */
206
+ GDK_PIXBUF_ERROR_BAD_OPTION,
207
+ /* unsupported image type (sort of an ENOSYS) */
208
+ GDK_PIXBUF_ERROR_UNKNOWN_TYPE,
209
+ /* unsupported operation (load, save) for image type */
210
+ GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION,
211
+ GDK_PIXBUF_ERROR_FAILED
212
+ } GdkPixbufError;
213
+
214
+ GQuark gdk_pixbuf_error_quark (void);
215
+
216
+
217
+
218
+ GType gdk_pixbuf_get_type (void) G_GNUC_CONST;
219
+
220
+ /* Reference counting */
221
+
222
+ #ifndef GDK_PIXBUF_DISABLE_DEPRECATED
223
+ G_DEPRECATED_FOR(g_object_ref)
224
+ GdkPixbuf *gdk_pixbuf_ref (GdkPixbuf *pixbuf);
225
+ G_DEPRECATED_FOR(g_object_unref)
226
+ void gdk_pixbuf_unref (GdkPixbuf *pixbuf);
227
+ #endif
228
+
229
+ /* GdkPixbuf accessors */
230
+
231
+ GdkColorspace gdk_pixbuf_get_colorspace (const GdkPixbuf *pixbuf);
232
+ int gdk_pixbuf_get_n_channels (const GdkPixbuf *pixbuf);
233
+ gboolean gdk_pixbuf_get_has_alpha (const GdkPixbuf *pixbuf);
234
+ int gdk_pixbuf_get_bits_per_sample (const GdkPixbuf *pixbuf);
235
+ guchar *gdk_pixbuf_get_pixels (const GdkPixbuf *pixbuf);
236
+ int gdk_pixbuf_get_width (const GdkPixbuf *pixbuf);
237
+ int gdk_pixbuf_get_height (const GdkPixbuf *pixbuf);
238
+ int gdk_pixbuf_get_rowstride (const GdkPixbuf *pixbuf);
239
+ gsize gdk_pixbuf_get_byte_length (const GdkPixbuf *pixbuf);
240
+
241
+ guchar *gdk_pixbuf_get_pixels_with_length (const GdkPixbuf *pixbuf,
242
+ guint *length);
243
+
244
+
245
+
246
+
247
+ /* Create a blank pixbuf with an optimal rowstride and a new buffer */
248
+ GdkPixbuf *gdk_pixbuf_new (GdkColorspace colorspace, gboolean has_alpha, int bits_per_sample,
249
+ int width, int height);
250
+
251
+ /* Copy a pixbuf */
252
+
253
+ GdkPixbuf *gdk_pixbuf_copy (const GdkPixbuf *pixbuf);
254
+
255
+ /* Create a pixbuf which points to the pixels of another pixbuf */
256
+ GdkPixbuf *gdk_pixbuf_new_subpixbuf (GdkPixbuf *src_pixbuf,
257
+ int src_x,
258
+ int src_y,
259
+ int width,
260
+ int height);
261
+
262
+ /* Simple loading */
263
+
264
+ #ifndef __GTK_DOC_IGNORE__
265
+ #ifdef G_OS_WIN32
266
+ /* DLL ABI stability hack. */
267
+ #define gdk_pixbuf_new_from_file gdk_pixbuf_new_from_file_utf8
268
+ #define gdk_pixbuf_new_from_file_at_size gdk_pixbuf_new_from_file_at_size_utf8
269
+ #define gdk_pixbuf_new_from_file_at_scale gdk_pixbuf_new_from_file_at_scale_utf8
270
+ #endif
271
+ #endif
272
+
273
+ GdkPixbuf *gdk_pixbuf_new_from_file (const char *filename,
274
+ GError **error);
275
+ GdkPixbuf *gdk_pixbuf_new_from_file_at_size (const char *filename,
276
+ int width,
277
+ int height,
278
+ GError **error);
279
+ GdkPixbuf *gdk_pixbuf_new_from_file_at_scale (const char *filename,
280
+ int width,
281
+ int height,
282
+ gboolean preserve_aspect_ratio,
283
+ GError **error);
284
+ GdkPixbuf *gdk_pixbuf_new_from_resource (const char *resource_path,
285
+ GError **error);
286
+ GdkPixbuf *gdk_pixbuf_new_from_resource_at_scale (const char *resource_path,
287
+ int width,
288
+ int height,
289
+ gboolean preserve_aspect_ratio,
290
+ GError **error);
291
+
292
+ GdkPixbuf *gdk_pixbuf_new_from_data (const guchar *data,
293
+ GdkColorspace colorspace,
294
+ gboolean has_alpha,
295
+ int bits_per_sample,
296
+ int width, int height,
297
+ int rowstride,
298
+ GdkPixbufDestroyNotify destroy_fn,
299
+ gpointer destroy_fn_data);
300
+
301
+ GdkPixbuf *gdk_pixbuf_new_from_xpm_data (const char **data);
302
+ GdkPixbuf* gdk_pixbuf_new_from_inline (gint data_length,
303
+ const guint8 *data,
304
+ gboolean copy_pixels,
305
+ GError **error);
306
+
307
+ /* Mutations */
308
+ void gdk_pixbuf_fill (GdkPixbuf *pixbuf,
309
+ guint32 pixel);
310
+
311
+ /* Saving */
312
+
313
+ #ifndef __GTK_DOC_IGNORE__
314
+ #ifdef G_OS_WIN32
315
+ /* DLL ABI stability hack. */
316
+ #define gdk_pixbuf_save gdk_pixbuf_save_utf8
317
+ #define gdk_pixbuf_savev gdk_pixbuf_savev_utf8
318
+ #endif
319
+ #endif
320
+
321
+ gboolean gdk_pixbuf_save (GdkPixbuf *pixbuf,
322
+ const char *filename,
323
+ const char *type,
324
+ GError **error,
325
+ ...) G_GNUC_NULL_TERMINATED;
326
+
327
+ gboolean gdk_pixbuf_savev (GdkPixbuf *pixbuf,
328
+ const char *filename,
329
+ const char *type,
330
+ char **option_keys,
331
+ char **option_values,
332
+ GError **error);
333
+
334
+ /* Saving to a callback function */
335
+
336
+
337
+ /**
338
+ * GdkPixbufSaveFunc:
339
+ * @buf: (array length=count) (element-type guint8): bytes to be written.
340
+ * @count: number of bytes in @buf.
341
+ * @error: (out): A location to return an error.
342
+ * @data: (closure): user data passed to gdk_pixbuf_save_to_callback().
343
+ *
344
+ * Specifies the type of the function passed to
345
+ * gdk_pixbuf_save_to_callback(). It is called once for each block of
346
+ * bytes that is "written" by gdk_pixbuf_save_to_callback(). If
347
+ * successful it should return %TRUE. If an error occurs it should set
348
+ * @error and return %FALSE, in which case gdk_pixbuf_save_to_callback()
349
+ * will fail with the same error.
350
+ *
351
+ * Since: 2.4
352
+ * Returns: %TRUE if successful, %FALSE (with @error set) if failed.
353
+ */
354
+
355
+ typedef gboolean (*GdkPixbufSaveFunc) (const gchar *buf,
356
+ gsize count,
357
+ GError **error,
358
+ gpointer data);
359
+
360
+ gboolean gdk_pixbuf_save_to_callback (GdkPixbuf *pixbuf,
361
+ GdkPixbufSaveFunc save_func,
362
+ gpointer user_data,
363
+ const char *type,
364
+ GError **error,
365
+ ...) G_GNUC_NULL_TERMINATED;
366
+
367
+ gboolean gdk_pixbuf_save_to_callbackv (GdkPixbuf *pixbuf,
368
+ GdkPixbufSaveFunc save_func,
369
+ gpointer user_data,
370
+ const char *type,
371
+ char **option_keys,
372
+ char **option_values,
373
+ GError **error);
374
+
375
+ /* Saving into a newly allocated char array */
376
+
377
+ gboolean gdk_pixbuf_save_to_buffer (GdkPixbuf *pixbuf,
378
+ gchar **buffer,
379
+ gsize *buffer_size,
380
+ const char *type,
381
+ GError **error,
382
+ ...) G_GNUC_NULL_TERMINATED;
383
+
384
+ gboolean gdk_pixbuf_save_to_bufferv (GdkPixbuf *pixbuf,
385
+ gchar **buffer,
386
+ gsize *buffer_size,
387
+ const char *type,
388
+ char **option_keys,
389
+ char **option_values,
390
+ GError **error);
391
+
392
+ GdkPixbuf *gdk_pixbuf_new_from_stream (GInputStream *stream,
393
+ GCancellable *cancellable,
394
+ GError **error);
395
+
396
+ void gdk_pixbuf_new_from_stream_async (GInputStream *stream,
397
+ GCancellable *cancellable,
398
+ GAsyncReadyCallback callback,
399
+ gpointer user_data);
400
+
401
+ GdkPixbuf *gdk_pixbuf_new_from_stream_finish (GAsyncResult *async_result,
402
+ GError **error);
403
+
404
+ GdkPixbuf *gdk_pixbuf_new_from_stream_at_scale (GInputStream *stream,
405
+ gint width,
406
+ gint height,
407
+ gboolean preserve_aspect_ratio,
408
+ GCancellable *cancellable,
409
+ GError **error);
410
+
411
+ void gdk_pixbuf_new_from_stream_at_scale_async (GInputStream *stream,
412
+ gint width,
413
+ gint height,
414
+ gboolean preserve_aspect_ratio,
415
+ GCancellable *cancellable,
416
+ GAsyncReadyCallback callback,
417
+ gpointer user_data);
418
+
419
+ gboolean gdk_pixbuf_save_to_stream (GdkPixbuf *pixbuf,
420
+ GOutputStream *stream,
421
+ const char *type,
422
+ GCancellable *cancellable,
423
+ GError **error,
424
+ ...);
425
+
426
+ void gdk_pixbuf_save_to_stream_async (GdkPixbuf *pixbuf,
427
+ GOutputStream *stream,
428
+ const gchar *type,
429
+ GCancellable *cancellable,
430
+ GAsyncReadyCallback callback,
431
+ gpointer user_data,
432
+ ...);
433
+
434
+ gboolean gdk_pixbuf_save_to_stream_finish (GAsyncResult *async_result,
435
+ GError **error);
436
+
437
+ /* Adding an alpha channel */
438
+ GdkPixbuf *gdk_pixbuf_add_alpha (const GdkPixbuf *pixbuf, gboolean substitute_color,
439
+ guchar r, guchar g, guchar b);
440
+
441
+ /* Copy an area of a pixbuf onto another one */
442
+ void gdk_pixbuf_copy_area (const GdkPixbuf *src_pixbuf,
443
+ int src_x, int src_y,
444
+ int width, int height,
445
+ GdkPixbuf *dest_pixbuf,
446
+ int dest_x, int dest_y);
447
+
448
+ /* Brighten/darken and optionally make it pixelated-looking */
449
+ void gdk_pixbuf_saturate_and_pixelate (const GdkPixbuf *src,
450
+ GdkPixbuf *dest,
451
+ gfloat saturation,
452
+ gboolean pixelate);
453
+
454
+ /* Transform an image to agree with its embedded orientation option / tag */
455
+ GdkPixbuf *gdk_pixbuf_apply_embedded_orientation (GdkPixbuf *src);
456
+
457
+ const gchar * gdk_pixbuf_get_option (GdkPixbuf *pixbuf,
458
+ const gchar *key);
459
+
460
+
461
+ G_END_DECLS
462
+
463
+
464
+ #endif /* GDK_PIXBUF_CORE_H */