Mercurial > mplayer.hg
comparison libvo/aspecttest.c @ 6087:8be92a9b30a4
Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
Also add a testapp for the aspect code.
author | atmos4 |
---|---|
date | Tue, 14 May 2002 00:22:03 +0000 |
parents | |
children | dd86735178a6 |
comparison
equal
deleted
inserted
replaced
6086:ad794ccafc55 | 6087:8be92a9b30a4 |
---|---|
1 /* testapp for aspect.[ch] by Atmos | |
2 * gcc aspecttest.c aspect.c -o aspecttest -DASPECT_TEST [-DASPECT_DEBUG] | |
3 */ | |
4 | |
5 #include <stdio.h> | |
6 | |
7 #include "aspect.h" | |
8 | |
9 /* default zoom state 0 off, 1 on */ | |
10 #define DEF_ZOOM 1 | |
11 | |
12 extern float monitor_aspect; | |
13 | |
14 int main(int argc, char *argv[]) { | |
15 int w,h,z=DEF_ZOOM; | |
16 //printf("argc: %d\n",argc); | |
17 switch(argc) { | |
18 case 10: | |
19 z = atoi(argv[9]); | |
20 case 9: | |
21 monitor_aspect = (float)atoi(argv[7])/(float)atoi(argv[8]); | |
22 case 7: | |
23 aspect_save_prescale(atoi(argv[5]),atoi(argv[6])); | |
24 printf("prescale size: %sx%s\n",argv[5],argv[6]); | |
25 case 5: | |
26 aspect_save_screenres(atoi(argv[1]),atoi(argv[2])); | |
27 printf("screenres: %sx%s\n",argv[1],argv[2]); | |
28 aspect_save_orig(atoi(argv[3]),atoi(argv[4])); | |
29 printf("original size: %sx%s\n",argv[3],argv[4]); | |
30 w=atoi(argv[3]); h=atoi(argv[4]); | |
31 break; | |
32 default: | |
33 printf("USAGE: %s <screenw> <screenh> <origw> <origh>\n[<prescalew> " | |
34 "<prescaleh>] [<screenaspectw> <screenaspecth>] [<zoom 0/1>]\n", | |
35 argv[0]); | |
36 return 1; | |
37 } | |
38 printf("monitor_aspect: %f\n",monitor_aspect); | |
39 aspect(&w,&h,z); | |
40 printf("new size: %dx%d\n",w,h); | |
41 return 0; | |
42 } | |
43 |