- string ext = FS::extpart(fn);
-#ifdef WITH_LIBPNG
- if(ext==".png")
- {
- IO::BufferedFile file(fn);
- load_png(file, *priv);
- }
- else
-#endif
- {
-#ifdef WITH_DEVIL
- load_devil_file(fn, *priv);
-#else
- throw unsupported_image_format("DevIL needed for non-PNG images");
-#endif
- }
- (void)fn;
-}
-
-void Image::load_memory(const void *data, unsigned size)
-{
-#ifdef WITH_LIBPNG
- if(size>=8 && is_png(data, 8))
- {
- IO::Memory mem(reinterpret_cast<const char *>(data), size);
- load_png(mem, *priv);
- }
- else
-#endif
- {
-#ifdef WITH_DEVIL
- load_devil_mem(data, size, *priv);
-#else
- throw unsupported_image_format("DevIL needed for non-PNG images");
-#endif
- }
- (void)data;
- (void)size;
-}
-
-PixelFormat Image::get_format() const
-{
- return priv->fmt;
-}
-
-unsigned Image::get_width() const
-{
- return priv->width;