// (c) Tuomas J. Lukka #include #include #include namespace Vob { namespace ImageLoader { DBGVAR(dbg, "ImageLoader"); struct Problem {}; /** Load an image into a raster using gdk-pixbuf. */ RGBARaster *loadImageRGBA(const char *filename) { GdkPixbuf* pb = gdk_pixbuf_new_from_file(filename); if(!pb) throw Problem(); DBG(dbg) << "NC "< data; int w = gdk_pixbuf_get_width(pb); int h = gdk_pixbuf_get_height(pb); if(nc == 4) { data.resize(w*h); GLuint *c = (GLuint *)gdk_pixbuf_get_pixels(pb); copy(c, c + w * h, data.begin()); /* for(int i=0; i