diff options
Diffstat (limited to 'qsvg.cc')
-rw-r--r-- | qsvg.cc | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/qsvg.cc b/qsvg.cc deleted file mode 100644 index 2eb737e..0000000 --- a/qsvg.cc +++ /dev/null @@ -1,59 +0,0 @@ -#include <iostream> -#include <QtCore/QCoreApplication> -#include <QImage> -#include <QSvgRenderer> -#include <QPainter> - -/* - hicg -- Harmattan Icon/Color Generator - Copyright (C) 2011 Javier S. Pedro <maemo@javispedro.com> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - -using std::cerr; -using std::endl; - -int main(int argc, char *argv[]) -{ - QCoreApplication a(argc, argv); - QStringList args = a.arguments(); - if (args.size() != 5) { - cerr << "usage: qsvg <file.svg> <width> <height> <file.png>" << endl; - return 1; - } - - QSvgRenderer r(args[1]); - - if (!r.isValid()) { - cerr << "Could not open source file." << endl; - return 1; - } - - int w, h; - w = args[2].toInt(); - h = args[3].toInt(); - - QImage i(w, h, QImage::Format_ARGB32); - i.fill(QColor(Qt::transparent).rgba()); - - QPainter p(&i); - r.render(&p); - - if (!i.save(args[4], "png")) { - cerr << "Could not save to destination file." << endl; - } - - return 0; -} |