2 * qscale: Quick, high-quality JPEG-to-JPEG scaler.
3 * Copyright (C) 2008 Steinar H. Gunderson <sgunderson@bigfoot.com>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, version 2 of the License.
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 General Public License for more details.
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 02110-1301, USA
23 #include "libqscale.h"
25 int main(int argc, char **argv)
27 /* user-settable parameters */
28 unsigned nominal_w = atoi(argv[1]);
29 unsigned nominal_h = atoi(argv[2]);
30 unsigned samp_h0 = 2, samp_v0 = 2;
31 unsigned samp_h1 = 1, samp_v1 = 1;
32 unsigned samp_h2 = 1, samp_v2 = 1;
33 unsigned jpeg_quality = 85;
36 qscale_img *img = qscale_load_jpeg_from_stdio(stdin);
37 qscale_img *scaled = qscale_scale(img, nominal_w, nominal_h, samp_h0, samp_v0, samp_h1, samp_v1, samp_h2, samp_v2, LANCZOS);
39 qscale_save_jpeg_to_stdio(scaled, stdout, jpeg_quality, SEQUENTIAL);