#include #include #include int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QDir src_dir("../gfx/"); QDir dst_dir("c:/temp/"); dst_dir.mkdir("gfx_2x/"); dst_dir.cd("gfx_2x/"); QRgb filter_rgb = qRgba(240, 0, 0, 255); QRgb mask_rgb = qRgba(255, 0, 255, 255); QRgb shadow_rgb = qRgba(127, 0, 127, 255); QStringList list = src_dir.entryList(); foreach(const QString file, list) { qDebug("found file: %s", file.toStdString().c_str()); QImage image(src_dir.filePath(file)); if( !image.isNull() ) { if( image.width() % 2 != 0 ) { throw "image width not multiple of 2"; } if( image.height() % 2 != 0 ) { throw "image height not multiple of 2"; } int new_width = image.width() / 2; int new_height = image.height() / 2; QImage new_image(new_width, new_height, image.format()); new_image.fill(0); for(int y=0;y