initial commit, lordsawar source, slightly modified
[lordsawar] / src / gui / image-helpers.h
1 //  Copyright (C) 2007 Ole Laursen
2 //  Copyright (C) 2009 Ben Asselstine
3 //
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.
8 //
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.
13 //
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 
17 //  02110-1301, USA.
18
19 #ifndef IMAGE_HELPERS_H
20 #define IMAGE_HELPERS_H
21
22 #include <vector>
23 #include <gdkmm/pixbuf.h>
24 #include "PixMask.h"
25
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
28 std::vector<PixMask*>
29 disassemble_row(const std::string &file, int no);
30 std::vector<PixMask*>
31 disassemble_row(const std::string &file, int no, bool first_half_height);
32
33 Glib::RefPtr<Gdk::Pixmap> to_pixmap(Glib::RefPtr<Gdk::Pixbuf> pixbuf);
34
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);
39 #endif