1 // Generated by gmmproc 2.45.3 -- DO NOT MODIFY!
2 
3 #undef GDK_DISABLE_DEPRECATED
4 #define GDK_DISABLE_DEPRECATION_WARNINGS 1
5 #undef GDK_PIXBUF_DISABLE_DEPRECATED
6 #define GDK_PIXBUF_DISABLE_DEPRECATION_WARNINGS 1
7 
8 
9 #include <glibmm.h>
10 
11 #include <gdkmm/pixbuf.h>
12 #include <gdkmm/private/pixbuf_p.h>
13 
14 #include <gdk-pixbuf/gdk-pixbuf.h>
15 
16 // -*- c++ -*-
17 /* $Id: pixbuf.ccg,v 1.8 2006/05/11 11:40:23 murrayc Exp $ */
18 
19 /* Copyright 1998-2002 The gtkmm Development Team
20  *
21  * This library is free software; you can redistribute it and/or
22  * modify it under the terms of the GNU Lesser General Public
23  * License as published by the Free Software Foundation; either
24  * version 2.1 of the License, or (at your option) any later version.
25  *
26  * This library is distributed in the hope that it will be useful,
27  * but WITHOUT ANY WARRANTY; without even the implied warranty of
28  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
29  * Lesser General Public License for more details.
30  *
31  * You should have received a copy of the GNU Lesser General Public
32  * License along with this library; if not, write to the Free
33  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
34  */
35 
36 #include <gdk/gdk.h>
37 #include <gdk-pixbuf/gdk-pixbuf.h>
38 
39 //Turn off all deprecation warnings, to avoid the warning about
40 //gdk_pixbuf_new_from_inline() in the generated code.
41 //We don't bother using G_GNUC_END_IGNORE_DEPRECATIONS
42 //because we are happy to keep it active for the whole file.
43 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
44 
45 namespace
46 {
47 
pixbuf_destroy_data_callback(guint8 * pixels,void * user_data)48 static void pixbuf_destroy_data_callback(guint8* pixels, void* user_data)
49 {
50   Gdk::Pixbuf::SlotDestroyData *const slot = static_cast<Gdk::Pixbuf::SlotDestroyData*>(user_data);
51   g_return_if_fail(slot != 0);
52 
53   try
54   {
55     (*slot)(pixels); // invoke callback
56   }
57   catch(...)
58   {
59     Glib::exception_handlers_invoke();
60   }
61 
62   delete slot;
63 }
64 
65 } // anonymous namespace
66 
67 
68 namespace Gdk
69 {
70 
71 #ifndef GDKMM_DISABLE_DEPRECATED
72 
Pixbuf(const Glib::RefPtr<Image> & src,const Glib::RefPtr<Colormap> & cmap,int src_x,int src_y,int dest_x,int dest_y,int width,int height)73 Pixbuf::Pixbuf(const Glib::RefPtr<Image>& src,
74                const Glib::RefPtr<Colormap>& cmap,
75                int src_x, int src_y,
76                int dest_x, int dest_y,
77                int width, int height)
78 :
79   Object((GObject*) gdk_pixbuf_get_from_image(
80       0, src->gobj(), cmap->gobj(), src_x, src_y, dest_x, dest_y, width, height))
81 {}
82 #endif // GDKMM_DISABLE_DEPRECATED
83 
84 
Pixbuf(const Glib::RefPtr<Image> & src,const Glib::RefPtr<Colormap> & cmap,int src_x,int src_y,int width,int height)85 Pixbuf::Pixbuf(const Glib::RefPtr<Image>& src,
86                const Glib::RefPtr<Colormap>& cmap,
87                int src_x, int src_y,
88                int width, int height)
89 :
90   Object((GObject*) gdk_pixbuf_get_from_image(
91       0, src->gobj(), cmap->gobj(), src_x, src_y, 0, 0, width, height))
92 {}
93 
Pixbuf(const Glib::RefPtr<Image> & src,int src_x,int src_y,int width,int height)94 Pixbuf::Pixbuf(const Glib::RefPtr<Image>& src,
95                int src_x, int src_y,
96                int width, int height)
97 :
98   Object((GObject*) gdk_pixbuf_get_from_image(
99       0, src->gobj(), 0, src_x, src_y, 0, 0, width, height))
100 {}
101 
102 #ifndef GDKMM_DISABLE_DEPRECATED
103 
Pixbuf(const Glib::RefPtr<Drawable> & src,const Glib::RefPtr<Colormap> & cmap,int src_x,int src_y,int dest_x,int dest_y,int width,int height)104 Pixbuf::Pixbuf(const Glib::RefPtr<Drawable>& src,
105                const Glib::RefPtr<Colormap>& cmap,
106                int src_x, int src_y,
107                int dest_x, int dest_y,
108                int width, int height)
109 :
110   Object((GObject*) gdk_pixbuf_get_from_drawable(
111       0, src->gobj(), cmap->gobj(), src_x, src_y, dest_x, dest_y, width, height))
112 {}
113 #endif // GDKMM_DISABLE_DEPRECATED
114 
115 
Pixbuf(const Glib::RefPtr<Drawable> & src,const Glib::RefPtr<Colormap> & cmap,int src_x,int src_y,int width,int height)116 Pixbuf::Pixbuf(const Glib::RefPtr<Drawable>& src,
117                const Glib::RefPtr<Colormap>& cmap,
118                int src_x, int src_y,
119                int width, int height)
120 :
121   Object((GObject*) gdk_pixbuf_get_from_drawable(
122       0, src->gobj(), cmap->gobj(), src_x, src_y, 0, 0, width, height))
123 {}
124 
Pixbuf(const Glib::RefPtr<Drawable> & src,int src_x,int src_y,int width,int height)125 Pixbuf::Pixbuf(const Glib::RefPtr<Drawable>& src,
126                int src_x, int src_y,
127                int width, int height)
128 :
129   Object((GObject*) gdk_pixbuf_get_from_drawable(
130       0, src->gobj(), 0, src_x, src_y, 0, 0, width, height))
131 {}
132 
133 #ifndef GDKMM_DISABLE_DEPRECATED
134 
create(const Glib::RefPtr<Drawable> & src,const Glib::RefPtr<Colormap> & cmap,int src_x,int src_y,int dest_x,int dest_y,int width,int height)135 Glib::RefPtr<Pixbuf> Pixbuf::create(const Glib::RefPtr<Drawable>& src,
136                                     const Glib::RefPtr<Colormap>& cmap,
137                                     int src_x, int src_y,
138                                     int dest_x, int dest_y,
139                                     int width, int height)
140 {
141   return Glib::RefPtr<Pixbuf>( new Pixbuf(src, cmap, src_x, src_y, dest_x, dest_y, width, height) );
142 }
143 
create(const Glib::RefPtr<Image> & src,const Glib::RefPtr<Colormap> & cmap,int src_x,int src_y,int dest_x,int dest_y,int width,int height)144 Glib::RefPtr<Pixbuf> Pixbuf::create(const Glib::RefPtr<Image>& src,
145                                     const Glib::RefPtr<Colormap>& cmap,
146                                     int src_x, int src_y,
147                                     int dest_x, int dest_y,
148                                     int width, int height)
149 {
150   return Glib::RefPtr<Pixbuf>( new Pixbuf(src, cmap, src_x, src_y, dest_x, dest_y, width, height) );
151 }
152 #endif // GDKMM_DISABLE_DEPRECATED
153 
154 
create_from_data(const guint8 * data,Colorspace colorspace,bool has_alpha,int bits_per_sample,int width,int height,int rowstride)155 Glib::RefPtr<Pixbuf> Pixbuf::create_from_data(const guint8* data, Colorspace colorspace,
156                                               bool has_alpha, int bits_per_sample,
157                                               int width, int height, int rowstride)
158 {
159   GdkPixbuf *const pixbuf = gdk_pixbuf_new_from_data(
160       data, (GdkColorspace) colorspace, has_alpha, bits_per_sample, width, height, rowstride,
161       0, 0);
162 
163   return Glib::wrap(pixbuf);
164 }
165 
create_from_data(const guint8 * data,Colorspace colorspace,bool has_alpha,int bits_per_sample,int width,int height,int rowstride,const Pixbuf::SlotDestroyData & destroy_slot)166 Glib::RefPtr<Pixbuf> Pixbuf::create_from_data(const guint8* data, Colorspace colorspace,
167                                               bool has_alpha, int bits_per_sample,
168                                               int width, int height, int rowstride,
169                                               const Pixbuf::SlotDestroyData& destroy_slot)
170 {
171   GdkPixbuf *const pixbuf = gdk_pixbuf_new_from_data(
172       data, (GdkColorspace) colorspace, has_alpha, bits_per_sample, width, height, rowstride,
173       &pixbuf_destroy_data_callback, new SlotDestroyData(destroy_slot));
174 
175   return Glib::wrap(pixbuf);
176 }
177 
create_from_stream(const Glib::RefPtr<Gio::InputStream> & stream)178 Glib::RefPtr<Pixbuf> Pixbuf::create_from_stream(const Glib::RefPtr<Gio::InputStream>& stream)
179 {
180   GError* gerror = 0;
181   Glib::RefPtr<Pixbuf> retvalue = Glib::wrap(gdk_pixbuf_new_from_stream(const_cast<GInputStream*>(Glib::unwrap(stream)), 0, &(gerror)));
182 
183   if(gerror)
184     ::Glib::Error::throw_exception(gerror);
185 
186   return retvalue;
187 }
188 
create_from_stream_at_scale(const Glib::RefPtr<Gio::InputStream> & stream,int width,int height,bool preserve_aspect_ratio)189 Glib::RefPtr<Pixbuf> Pixbuf::create_from_stream_at_scale(const Glib::RefPtr<Gio::InputStream>& stream, int width, int height, bool preserve_aspect_ratio)
190 {
191   GError* gerror = 0;
192   Glib::RefPtr<Pixbuf> retvalue = Glib::wrap(gdk_pixbuf_new_from_stream_at_scale(const_cast<GInputStream*>(Glib::unwrap(stream)), width, height, static_cast<int>(preserve_aspect_ratio), 0, &(gerror)));
193 
194   if(gerror)
195     ::Glib::Error::throw_exception(gerror);
196 
197   return retvalue;
198 }
199 
render_pixmap_and_mask_for_colormap(const Glib::RefPtr<Colormap> & colormap,Glib::RefPtr<Pixmap> & pixmap_return,Glib::RefPtr<Bitmap> & mask_return,int alpha_threshold)200 void Pixbuf::render_pixmap_and_mask_for_colormap(const Glib::RefPtr<Colormap>& colormap,
201                                                  Glib::RefPtr<Pixmap>& pixmap_return,
202                                                  Glib::RefPtr<Bitmap>& mask_return,
203                                                  int alpha_threshold)
204 {
205   GdkPixmap* pPixmap = 0;
206   GdkBitmap* pBitmap = 0;
207 
208   gdk_pixbuf_render_pixmap_and_mask_for_colormap(
209       gobj(), colormap->gobj(), &pPixmap, &pBitmap, alpha_threshold);
210 
211   pixmap_return = Glib::wrap((GdkPixmapObject*) pPixmap);
212   mask_return   = Glib::RefPtr<Gdk::Bitmap>::cast_dynamic(Glib::wrap((GdkPixmapObject*) pBitmap));
213 }
214 
render_pixmap_and_mask(Glib::RefPtr<Pixmap> & pixmap_return,Glib::RefPtr<Bitmap> & mask_return,int alpha_threshold)215 void Pixbuf::render_pixmap_and_mask(Glib::RefPtr<Pixmap>& pixmap_return,
216                                     Glib::RefPtr<Bitmap>& mask_return,
217                                     int alpha_threshold)
218 {
219   GdkPixmap* pPixmap = 0;
220   GdkBitmap* pBitmap = 0;
221 
222   gdk_pixbuf_render_pixmap_and_mask(gobj(), &pPixmap, &pBitmap, alpha_threshold);
223 
224   pixmap_return = Glib::wrap((GdkPixmapObject*) pPixmap);
225   mask_return   = Glib::RefPtr<Gdk::Bitmap>::cast_dynamic(Glib::wrap((GdkPixmapObject*) pBitmap));
226 }
227 
228 
save(const std::string & filename,const Glib::ustring & type)229 void Pixbuf::save(const std::string& filename, const Glib::ustring& type)
230 {
231   GError* gerror = 0;
232   gdk_pixbuf_savev(gobj(), filename.c_str(), type.c_str(), 0, 0, &gerror);
233 
234   if(gerror)
235     ::Glib::Error::throw_exception(gerror);
236 }
237 
238 
save(const std::string & filename,const Glib::ustring & type,const Glib::StringArrayHandle & option_keys,const Glib::StringArrayHandle & option_values)239 void Pixbuf::save(const std::string& filename, const Glib::ustring& type,
240                   const Glib::StringArrayHandle& option_keys,
241                   const Glib::StringArrayHandle& option_values)
242 {
243   GError* gerror = 0;
244 
245   gdk_pixbuf_savev(
246       gobj(), filename.c_str(), type.c_str(),
247       const_cast<char**>(option_keys.data()), const_cast<char**>(option_values.data()),
248       &gerror);
249 
250   if(gerror)
251     ::Glib::Error::throw_exception(gerror);
252 }
253 
254 
save_to_buffer(gchar * & buffer,gsize & buffer_size,const Glib::ustring & type)255 void Pixbuf::save_to_buffer(gchar*& buffer, gsize& buffer_size,
256                             const Glib::ustring& type)
257 {
258   GError* gerror = 0;
259 
260   gdk_pixbuf_save_to_buffer(
261       gobj(), &buffer, &buffer_size,
262       type.c_str(),
263       &gerror, NULL);
264 
265   if(gerror)
266     ::Glib::Error::throw_exception(gerror);
267 }
268 
save_to_buffer(gchar * & buffer,gsize & buffer_size,const Glib::ustring & type,const Glib::StringArrayHandle & option_keys,const Glib::StringArrayHandle & option_values)269 void Pixbuf::save_to_buffer(gchar*& buffer, gsize& buffer_size,
270                             const Glib::ustring& type,
271                             const Glib::StringArrayHandle& option_keys,
272                             const Glib::StringArrayHandle& option_values)
273 {
274   GError* gerror = 0;
275 
276   gdk_pixbuf_save_to_bufferv(
277       gobj(), &buffer, &buffer_size,
278       type.c_str(),
279       const_cast<char**>(option_keys.data()), const_cast<char**>(option_values.data()),
280       &gerror);
281 
282   if(gerror)
283     ::Glib::Error::throw_exception(gerror);
284 }
285 
get_formats()286 Pixbuf::SListHandle_PixbufFormat Pixbuf::get_formats()
287 {
288   return SListHandle_PixbufFormat(gdk_pixbuf_get_formats(), Glib::OWNERSHIP_SHALLOW);
289 }
290 
291 } // namespace Gdk
292 
293 
294 namespace
295 {
296 } // anonymous namespace
297 
298 // static
value_type()299 GType Glib::Value<Gdk::Colorspace>::value_type()
300 {
301   return gdk_colorspace_get_type();
302 }
303 
304 // static
value_type()305 GType Glib::Value<Gdk::InterpType>::value_type()
306 {
307   return gdk_interp_type_get_type();
308 }
309 
310 // static
value_type()311 GType Glib::Value<Gdk::PixbufAlphaMode>::value_type()
312 {
313   return gdk_pixbuf_alpha_mode_get_type();
314 }
315 
316 // static
value_type()317 GType Glib::Value<Gdk::PixbufRotation>::value_type()
318 {
319   return gdk_pixbuf_rotation_get_type();
320 }
321 
322 
PixbufError(Gdk::PixbufError::Code error_code,const Glib::ustring & error_message)323 Gdk::PixbufError::PixbufError(Gdk::PixbufError::Code error_code, const Glib::ustring& error_message)
324 :
325   Glib::Error (GDK_PIXBUF_ERROR, error_code, error_message)
326 {}
327 
PixbufError(GError * gobject)328 Gdk::PixbufError::PixbufError(GError* gobject)
329 :
330   Glib::Error (gobject)
331 {}
332 
code() const333 Gdk::PixbufError::Code Gdk::PixbufError::code() const
334 {
335   return static_cast<Code>(Glib::Error::code());
336 }
337 
throw_func(GError * gobject)338 void Gdk::PixbufError::throw_func(GError* gobject)
339 {
340   throw Gdk::PixbufError(gobject);
341 }
342 
343 // static
value_type()344 GType Glib::Value<Gdk::PixbufError::Code>::value_type()
345 {
346   return gdk_pixbuf_error_get_type();
347 }
348 
349 
350 namespace Glib
351 {
352 
wrap(GdkPixbuf * object,bool take_copy)353 Glib::RefPtr<Gdk::Pixbuf> wrap(GdkPixbuf* object, bool take_copy)
354 {
355   return Glib::RefPtr<Gdk::Pixbuf>( dynamic_cast<Gdk::Pixbuf*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
356   //We use dynamic_cast<> in case of multiple inheritance.
357 }
358 
359 } /* namespace Glib */
360 
361 
362 namespace Gdk
363 {
364 
365 
366 /* The *_Class implementation: */
367 
init()368 const Glib::Class& Pixbuf_Class::init()
369 {
370   if(!gtype_) // create the GType if necessary
371   {
372     // Glib::Class has to know the class init function to clone custom types.
373     class_init_func_ = &Pixbuf_Class::class_init_function;
374 
375     // This is actually just optimized away, apparently with no harm.
376     // Make sure that the parent type has been created.
377     //CppClassParent::CppObjectType::get_type();
378 
379     // Create the wrapper type, with the same class/instance size as the base type.
380     register_derived_type(gdk_pixbuf_get_type());
381 
382     // Add derived versions of interfaces, if the C type implements any interfaces:
383 
384   }
385 
386   return *this;
387 }
388 
389 
class_init_function(void * g_class,void * class_data)390 void Pixbuf_Class::class_init_function(void* g_class, void* class_data)
391 {
392   BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
393   CppClassParent::class_init_function(klass, class_data);
394 
395 
396 }
397 
398 
wrap_new(GObject * object)399 Glib::ObjectBase* Pixbuf_Class::wrap_new(GObject* object)
400 {
401   return new Pixbuf((GdkPixbuf*)object);
402 }
403 
404 
405 /* The implementation: */
406 
gobj_copy()407 GdkPixbuf* Pixbuf::gobj_copy()
408 {
409   reference();
410   return gobj();
411 }
412 
Pixbuf(const Glib::ConstructParams & construct_params)413 Pixbuf::Pixbuf(const Glib::ConstructParams& construct_params)
414 :
415   Glib::Object(construct_params)
416 {
417 
418 }
419 
Pixbuf(GdkPixbuf * castitem)420 Pixbuf::Pixbuf(GdkPixbuf* castitem)
421 :
422   Glib::Object((GObject*)(castitem))
423 {}
424 
425 
~Pixbuf()426 Pixbuf::~Pixbuf()
427 {}
428 
429 
430 Pixbuf::CppClassType Pixbuf::pixbuf_class_; // initialize static member
431 
get_type()432 GType Pixbuf::get_type()
433 {
434   return pixbuf_class_.init().get_type();
435 }
436 
437 
get_base_type()438 GType Pixbuf::get_base_type()
439 {
440   return gdk_pixbuf_get_type();
441 }
442 
443 
create(const Glib::RefPtr<Drawable> & src,const Glib::RefPtr<Colormap> & cmap,int src_x,int src_y,int width,int height)444 Glib::RefPtr<Pixbuf> Pixbuf::create(const Glib::RefPtr<Drawable>& src, const Glib::RefPtr<Colormap>& cmap, int src_x, int src_y, int width, int height)
445 {
446   return Glib::RefPtr<Pixbuf>( new Pixbuf(src, cmap, src_x, src_y, width, height) );
447 }
448 
create(const Glib::RefPtr<Drawable> & src,int src_x,int src_y,int width,int height)449 Glib::RefPtr<Pixbuf> Pixbuf::create(const Glib::RefPtr<Drawable>& src, int src_x, int src_y, int width, int height)
450 {
451   return Glib::RefPtr<Pixbuf>( new Pixbuf(src, src_x, src_y, width, height) );
452 }
453 
create(const Glib::RefPtr<Image> & src,const Glib::RefPtr<Colormap> & cmap,int src_x,int src_y,int width,int height)454 Glib::RefPtr<Pixbuf> Pixbuf::create(const Glib::RefPtr<Image>& src, const Glib::RefPtr<Colormap>& cmap, int src_x, int src_y, int width, int height)
455 {
456   return Glib::RefPtr<Pixbuf>( new Pixbuf(src, cmap, src_x, src_y, width, height) );
457 }
458 
create(const Glib::RefPtr<Image> & src,int src_x,int src_y,int width,int height)459 Glib::RefPtr<Pixbuf> Pixbuf::create(const Glib::RefPtr<Image>& src, int src_x, int src_y, int width, int height)
460 {
461   return Glib::RefPtr<Pixbuf>( new Pixbuf(src, src_x, src_y, width, height) );
462 }
463 
copy() const464 Glib::RefPtr<Pixbuf> Pixbuf::copy() const
465 {
466   return Glib::wrap(gdk_pixbuf_copy(const_cast<GdkPixbuf*>(gobj())));
467 }
468 
create(Colorspace colorspace,bool has_alpha,int bits_per_sample,int width,int height)469 Glib::RefPtr<Pixbuf> Pixbuf::create(Colorspace colorspace, bool has_alpha, int bits_per_sample, int width, int height)
470 {
471   return Glib::wrap(gdk_pixbuf_new(((GdkColorspace)(colorspace)), static_cast<int>(has_alpha), bits_per_sample, width, height));
472 }
473 
create_subpixbuf(const Glib::RefPtr<Pixbuf> & src_pixbuf,int src_x,int src_y,int width,int height)474 Glib::RefPtr<Pixbuf> Pixbuf::create_subpixbuf(const Glib::RefPtr<Pixbuf>& src_pixbuf, int src_x, int src_y, int width, int height)
475 {
476   return Glib::wrap(gdk_pixbuf_new_subpixbuf(Glib::unwrap(src_pixbuf), src_x, src_y, width, height));
477 }
478 
create_from_file(const std::string & filename)479 Glib::RefPtr<Pixbuf> Pixbuf::create_from_file(const std::string& filename)
480 {
481   GError* gerror = 0;
482   Glib::RefPtr<Pixbuf> retvalue = Glib::wrap(gdk_pixbuf_new_from_file(filename.c_str(), &(gerror)));
483   if(gerror)
484     ::Glib::Error::throw_exception(gerror);
485   return retvalue;
486 }
487 
create_from_file(const std::string & filename,int width,int height,bool preserve_aspect_ratio)488 Glib::RefPtr<Pixbuf> Pixbuf::create_from_file(const std::string& filename, int width, int height, bool preserve_aspect_ratio)
489 {
490   GError* gerror = 0;
491   Glib::RefPtr<Pixbuf> retvalue = Glib::wrap(gdk_pixbuf_new_from_file_at_scale(filename.c_str(), width, height, static_cast<int>(preserve_aspect_ratio), &(gerror)));
492   if(gerror)
493     ::Glib::Error::throw_exception(gerror);
494   return retvalue;
495 }
496 
create_from_xpm_data(const char * const * data)497 Glib::RefPtr<Pixbuf> Pixbuf::create_from_xpm_data(const char *const * data)
498 {
499   return Glib::wrap(gdk_pixbuf_new_from_xpm_data(const_cast<const char**>(data)));
500 }
501 
create_from_inline(int data_length,const guint8 * data,bool copy_pixels)502 Glib::RefPtr<Pixbuf> Pixbuf::create_from_inline(int data_length, const guint8* data, bool copy_pixels)
503 {
504   GError* gerror = 0;
505   Glib::RefPtr<Pixbuf> retvalue = Glib::wrap(gdk_pixbuf_new_from_inline(data_length, data, static_cast<int>(copy_pixels), &(gerror)));
506   if(gerror)
507     ::Glib::Error::throw_exception(gerror);
508   return retvalue;
509 }
510 
create_from_stream(const Glib::RefPtr<Gio::InputStream> & stream,const Glib::RefPtr<Gio::Cancellable> & cancelable)511 Glib::RefPtr<Pixbuf> Pixbuf::create_from_stream(const Glib::RefPtr<Gio::InputStream>& stream, const Glib::RefPtr<Gio::Cancellable>& cancelable)
512 {
513   GError* gerror = 0;
514   Glib::RefPtr<Pixbuf> retvalue = Glib::wrap(gdk_pixbuf_new_from_stream(const_cast<GInputStream*>(Glib::unwrap(stream)), const_cast<GCancellable*>(Glib::unwrap(cancelable)), &(gerror)));
515   if(gerror)
516     ::Glib::Error::throw_exception(gerror);
517   return retvalue;
518 }
519 
create_from_stream_at_scale(const Glib::RefPtr<Gio::InputStream> & stream,int width,int height,bool preserve_aspect_ratio,const Glib::RefPtr<Gio::Cancellable> & cancelable)520 Glib::RefPtr<Pixbuf> Pixbuf::create_from_stream_at_scale(const Glib::RefPtr<Gio::InputStream>& stream, int width, int height, bool preserve_aspect_ratio, const Glib::RefPtr<Gio::Cancellable>& cancelable)
521 {
522   GError* gerror = 0;
523   Glib::RefPtr<Pixbuf> retvalue = Glib::wrap(gdk_pixbuf_new_from_stream_at_scale(const_cast<GInputStream*>(Glib::unwrap(stream)), width, height, static_cast<int>(preserve_aspect_ratio), const_cast<GCancellable*>(Glib::unwrap(cancelable)), &(gerror)));
524   if(gerror)
525     ::Glib::Error::throw_exception(gerror);
526   return retvalue;
527 }
528 
get_colorspace() const529 Colorspace Pixbuf::get_colorspace() const
530 {
531   return ((Colorspace)(gdk_pixbuf_get_colorspace(const_cast<GdkPixbuf*>(gobj()))));
532 }
533 
get_n_channels() const534 int Pixbuf::get_n_channels() const
535 {
536   return gdk_pixbuf_get_n_channels(const_cast<GdkPixbuf*>(gobj()));
537 }
538 
get_has_alpha() const539 bool Pixbuf::get_has_alpha() const
540 {
541   return gdk_pixbuf_get_has_alpha(const_cast<GdkPixbuf*>(gobj()));
542 }
543 
get_bits_per_sample() const544 int Pixbuf::get_bits_per_sample() const
545 {
546   return gdk_pixbuf_get_bits_per_sample(const_cast<GdkPixbuf*>(gobj()));
547 }
548 
get_pixels() const549 guint8* Pixbuf::get_pixels() const
550 {
551   return gdk_pixbuf_get_pixels(const_cast<GdkPixbuf*>(gobj()));
552 }
553 
get_width() const554 int Pixbuf::get_width() const
555 {
556   return gdk_pixbuf_get_width(const_cast<GdkPixbuf*>(gobj()));
557 }
558 
get_height() const559 int Pixbuf::get_height() const
560 {
561   return gdk_pixbuf_get_height(const_cast<GdkPixbuf*>(gobj()));
562 }
563 
get_rowstride() const564 int Pixbuf::get_rowstride() const
565 {
566   return gdk_pixbuf_get_rowstride(const_cast<GdkPixbuf*>(gobj()));
567 }
568 
fill(guint32 pixel)569 void Pixbuf::fill(guint32 pixel)
570 {
571   gdk_pixbuf_fill(gobj(), pixel);
572 }
573 
add_alpha(bool substitute_color,guint8 r,guint8 g,guint8 b) const574 Glib::RefPtr<Gdk::Pixbuf> Pixbuf::add_alpha(bool substitute_color, guint8 r, guint8 g, guint8 b) const
575 {
576   return Glib::wrap(gdk_pixbuf_add_alpha(const_cast<GdkPixbuf*>(gobj()), static_cast<int>(substitute_color), r, g, b));
577 }
578 
copy_area(int src_x,int src_y,int width,int height,const Glib::RefPtr<Gdk::Pixbuf> & dest_pixbuf,int dest_x,int dest_y) const579 void Pixbuf::copy_area(int src_x, int src_y, int width, int height, const Glib::RefPtr<Gdk::Pixbuf>& dest_pixbuf, int dest_x, int dest_y) const
580 {
581   gdk_pixbuf_copy_area(const_cast<GdkPixbuf*>(gobj()), src_x, src_y, width, height, Glib::unwrap(dest_pixbuf), dest_x, dest_y);
582 }
583 
saturate_and_pixelate(const Glib::RefPtr<Gdk::Pixbuf> & dest,float saturation,bool pixelate) const584 void Pixbuf::saturate_and_pixelate(const Glib::RefPtr<Gdk::Pixbuf>& dest, float saturation, bool pixelate) const
585 {
586   gdk_pixbuf_saturate_and_pixelate(const_cast<GdkPixbuf*>(gobj()), Glib::unwrap(dest), saturation, static_cast<int>(pixelate));
587 }
588 
scale(const Glib::RefPtr<Gdk::Pixbuf> & dest,int dest_x,int dest_y,int dest_width,int dest_height,double offset_x,double offset_y,double scale_x,double scale_y,InterpType interp_type) const589 void Pixbuf::scale(const Glib::RefPtr<Gdk::Pixbuf>& dest, int dest_x, int dest_y, int dest_width, int dest_height, double offset_x, double offset_y, double scale_x, double scale_y, InterpType interp_type) const
590 {
591   gdk_pixbuf_scale(const_cast<GdkPixbuf*>(gobj()), Glib::unwrap(dest), dest_x, dest_y, dest_width, dest_height, offset_x, offset_y, scale_x, scale_y, ((GdkInterpType)(interp_type)));
592 }
593 
composite(const Glib::RefPtr<Gdk::Pixbuf> & dest,int dest_x,int dest_y,int dest_width,int dest_height,double offset_x,double offset_y,double scale_x,double scale_y,InterpType interp_type,int overall_alpha) const594 void Pixbuf::composite(const Glib::RefPtr<Gdk::Pixbuf>& dest, int dest_x, int dest_y, int dest_width, int dest_height, double offset_x, double offset_y, double scale_x, double scale_y, InterpType interp_type, int overall_alpha) const
595 {
596   gdk_pixbuf_composite(const_cast<GdkPixbuf*>(gobj()), Glib::unwrap(dest), dest_x, dest_y, dest_width, dest_height, offset_x, offset_y, scale_x, scale_y, ((GdkInterpType)(interp_type)), overall_alpha);
597 }
598 
composite_color(const Glib::RefPtr<Gdk::Pixbuf> & dest,int dest_x,int dest_y,int dest_width,int dest_height,double offset_x,double offset_y,double scale_x,double scale_y,InterpType interp_type,int overall_alpha,int check_x,int check_y,int check_size,guint32 color1,guint32 color2) const599 void Pixbuf::composite_color(const Glib::RefPtr<Gdk::Pixbuf>& dest, int dest_x, int dest_y, int dest_width, int dest_height, double offset_x, double offset_y, double scale_x, double scale_y, InterpType interp_type, int overall_alpha, int check_x, int check_y, int check_size, guint32 color1, guint32 color2) const
600 {
601   gdk_pixbuf_composite_color(const_cast<GdkPixbuf*>(gobj()), Glib::unwrap(dest), dest_x, dest_y, dest_width, dest_height, offset_x, offset_y, scale_x, scale_y, ((GdkInterpType)(interp_type)), overall_alpha, check_x, check_y, check_size, color1, color2);
602 }
603 
scale_simple(int dest_width,int dest_height,InterpType interp_type) const604 Glib::RefPtr<Gdk::Pixbuf> Pixbuf::scale_simple(int dest_width, int dest_height, InterpType interp_type) const
605 {
606   return Glib::wrap(gdk_pixbuf_scale_simple(const_cast<GdkPixbuf*>(gobj()), dest_width, dest_height, ((GdkInterpType)(interp_type))));
607 }
608 
composite_color_simple(int dest_width,int dest_height,InterpType interp_type,int overall_alpha,int check_size,guint32 color1,guint32 color2) const609 Glib::RefPtr<Gdk::Pixbuf> Pixbuf::composite_color_simple(int dest_width, int dest_height, InterpType interp_type, int overall_alpha, int check_size, guint32 color1, guint32 color2) const
610 {
611   return Glib::wrap(gdk_pixbuf_composite_color_simple(const_cast<GdkPixbuf*>(gobj()), dest_width, dest_height, ((GdkInterpType)(interp_type)), overall_alpha, check_size, color1, color2));
612 }
613 
rotate_simple(PixbufRotation angle) const614 Glib::RefPtr<Gdk::Pixbuf> Pixbuf::rotate_simple(PixbufRotation angle) const
615 {
616   return Glib::wrap(gdk_pixbuf_rotate_simple(const_cast<GdkPixbuf*>(gobj()), ((GdkPixbufRotation)(angle))));
617 }
618 
flip(bool horizontal) const619 Glib::RefPtr<Gdk::Pixbuf> Pixbuf::flip(bool horizontal) const
620 {
621   return Glib::wrap(gdk_pixbuf_flip(const_cast<GdkPixbuf*>(gobj()), static_cast<int>(horizontal)));
622 }
623 
render_threshold_alpha(const Glib::RefPtr<Gdk::Bitmap> & bitmap,int src_x,int src_y,int dest_x,int dest_y,int width,int height,int alpha_threshold)624 void Pixbuf::render_threshold_alpha(const Glib::RefPtr<Gdk::Bitmap>& bitmap, int src_x, int src_y, int dest_x, int dest_y, int width, int height, int alpha_threshold)
625 {
626   gdk_pixbuf_render_threshold_alpha(gobj(), Glib::unwrap(bitmap), src_x, src_y, dest_x, dest_y, width, height, alpha_threshold);
627 }
628 
629 #ifndef GDKMM_DISABLE_DEPRECATED
630 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
render_to_drawable(const Glib::RefPtr<Drawable> & drawable,const Glib::RefPtr<Gdk::GC> & gc,int src_x,int src_y,int dest_x,int dest_y,int width,int height,RgbDither dither,int x_dither,int y_dither)631 void Pixbuf::render_to_drawable(const Glib::RefPtr<Drawable>& drawable, const Glib::RefPtr<Gdk::GC>& gc, int src_x, int src_y, int dest_x, int dest_y, int width, int height, RgbDither dither, int x_dither, int y_dither)
632 {
633   gdk_pixbuf_render_to_drawable(gobj(), Glib::unwrap(drawable), Glib::unwrap(gc), src_x, src_y, dest_x, dest_y, width, height, ((GdkRgbDither)(dither)), x_dither, y_dither);
634 }
635 G_GNUC_END_IGNORE_DEPRECATIONS
636 #endif // GDKMM_DISABLE_DEPRECATED
637 
638 #ifndef GDKMM_DISABLE_DEPRECATED
639 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
render_to_drawable_alpha(const Glib::RefPtr<Drawable> & drawable,int src_x,int src_y,int dest_x,int dest_y,int width,int height,PixbufAlphaMode alpha_mode,int alpha_threshold,RgbDither dither,int x_dither,int y_dither)640 void Pixbuf::render_to_drawable_alpha(const Glib::RefPtr<Drawable>& drawable, int src_x, int src_y, int dest_x, int dest_y, int width, int height, PixbufAlphaMode alpha_mode, int alpha_threshold, RgbDither dither, int x_dither, int y_dither)
641 {
642   gdk_pixbuf_render_to_drawable_alpha(gobj(), Glib::unwrap(drawable), src_x, src_y, dest_x, dest_y, width, height, ((GdkPixbufAlphaMode)(alpha_mode)), alpha_threshold, ((GdkRgbDither)(dither)), x_dither, y_dither);
643 }
644 G_GNUC_END_IGNORE_DEPRECATIONS
645 #endif // GDKMM_DISABLE_DEPRECATED
646 
get_option(const Glib::ustring & key) const647 Glib::ustring Pixbuf::get_option(const Glib::ustring& key) const
648 {
649   return Glib::convert_const_gchar_ptr_to_ustring(gdk_pixbuf_get_option(const_cast<GdkPixbuf*>(gobj()), key.c_str()));
650 }
651 
652 
653 } // namespace Gdk
654 
655 
656