1 //  Copyright (C) 2007 Ole Laursen
2 //  Copyright (C) 2009, 2011, 2012 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 #pragma once
20 #ifndef IMAGE_HELPERS_H
21 #define IMAGE_HELPERS_H
22 
23 #include <vector>
24 #include <gdkmm/pixbuf.h>
25 #include "PixMask.h"
26 
27 // convert a file containing one large image with subimages, each of the same
28 // width, to an array of pixbufs corresponding to the subimages
29 std::vector<PixMask*>
30 disassemble_row(const Glib::ustring &file, int no, bool &broken);
31 std::vector<PixMask*>
32 disassemble_row(const Glib::ustring &file, int no, bool first_half_height, bool &broken);
33 std::vector<PixMask*>
34 disassemble_row(Glib::RefPtr<Gdk::Pixbuf> p, int no, bool first_half_height);
35 
36 //Cairo::RefPtr<Cairo::Surface> scale (Cairo::RefPtr<Cairo::Surface> pixmap, int w, int h);
37 bool image_width_is_multiple_of_image_height(const Glib::ustring file);
38 void get_image_width_and_height (const Glib::ustring &file, guint32 &width, guint32 &height, bool &broken);
39 #endif
40