/* * This file is part of the Scale2x project. * * Copyright (C) 2003 Andrea Mazzoleni * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* * This is the source of a simple command line tool which uses the reference * implementation of the Scale effects. * * You can find an high level description of the effects at : * * http://scale2x.sourceforge.net/ */ #include "file.h" #include "pixel.h" #include "portable.h" #include #include #include void scalex(unsigned char* dst_ptr, unsigned dst_slice, const unsigned char* src_ptr, unsigned src_slice, unsigned pixel, unsigned width, unsigned height, unsigned mx, unsigned my) { int x; int y; for(y=0;y max_ver) { printf("Invalid -r option. Valid values are 0 - %d.\n", max_ver); exit(EXIT_FAILURE); } if (optind + 2 != argc) { usage(); exit(EXIT_FAILURE); } if (file_process(argv[optind], argv[optind+1], opt_scale_x, opt_scale_y, opt_tes, opt_ver, opt_crc, opt_only124) != 0) { exit(EXIT_FAILURE); } return EXIT_SUCCESS; }