1 // Copyright (C) 2007 Ole Laursen
2 // Copyright (C) 2009 Ben Asselstine
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 3 of the License, or
7 // (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Library General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 #ifndef IMAGE_HELPERS_H
20 #define IMAGE_HELPERS_H
23 #include <gdkmm/pixbuf.h>
26 // convert a file containing one large image with subimages, each of the same
27 // width, to an array of pixbufs corresponding to the subimages
29 disassemble_row(const std::string &file, int no);
31 disassemble_row(const std::string &file, int no, bool first_half_height);
33 Glib::RefPtr<Gdk::Pixmap> to_pixmap(Glib::RefPtr<Gdk::Pixbuf> pixbuf);
35 int get_pwidth(Glib::RefPtr<Gdk::Pixmap> pixmap);
36 int get_pheight(Glib::RefPtr<Gdk::Pixmap> pixmap);
37 Glib::RefPtr<Gdk::Pixbuf> to_pixbuf(Glib::RefPtr<Gdk::Pixmap> pixmap);
38 Glib::RefPtr<Gdk::Pixmap> scale (Glib::RefPtr<Gdk::Pixmap> pixmap, int w, int h);