annotate libvo/aspecttest.c @ 28063:a318969a4f45

Set the base size window manager hint, otherwise some subtract the minimum size of 4x4 from the numbers displayed to the user which might be confusing. Based on patch by Bert Wesarg [bert wesarg googlemail com].
author reimar
date Fri, 05 Dec 2008 19:01:49 +0000
parents 2ffff528c1fc
children 7681eab10aea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27506
2ffff528c1fc Remove wrong compilation instructions.
diego
parents: 26583
diff changeset
1 /* test app for aspect.[ch] by Atmos */
6087
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
2
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
3 #include <stdio.h>
25516
dd86735178a6 Add missing #include, fixes the warning:
diego
parents: 6087
diff changeset
4 #include <stdlib.h>
6087
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
5
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
6 #include "aspect.h"
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
7
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
8 /* default zoom state 0 off, 1 on */
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
9 #define DEF_ZOOM 1
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
10
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
11 extern float monitor_aspect;
26583
6559b9364ca3 Add compilation rule for libvo/aspecttest and (hackishly) fix linking.
diego
parents: 25516
diff changeset
12 int vo_fs;
6559b9364ca3 Add compilation rule for libvo/aspecttest and (hackishly) fix linking.
diego
parents: 25516
diff changeset
13 float vo_panscan;
6087
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
14
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
15 int main(int argc, char *argv[]) {
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
16 int w,h,z=DEF_ZOOM;
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
17 //printf("argc: %d\n",argc);
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
18 switch(argc) {
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
19 case 10:
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
20 z = atoi(argv[9]);
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
21 case 9:
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
22 monitor_aspect = (float)atoi(argv[7])/(float)atoi(argv[8]);
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
23 case 7:
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
24 aspect_save_prescale(atoi(argv[5]),atoi(argv[6]));
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
25 printf("prescale size: %sx%s\n",argv[5],argv[6]);
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
26 case 5:
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
27 aspect_save_screenres(atoi(argv[1]),atoi(argv[2]));
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
28 printf("screenres: %sx%s\n",argv[1],argv[2]);
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
29 aspect_save_orig(atoi(argv[3]),atoi(argv[4]));
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
30 printf("original size: %sx%s\n",argv[3],argv[4]);
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
31 w=atoi(argv[3]); h=atoi(argv[4]);
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
32 break;
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
33 default:
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
34 printf("USAGE: %s <screenw> <screenh> <origw> <origh>\n[<prescalew> "
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
35 "<prescaleh>] [<screenaspectw> <screenaspecth>] [<zoom 0/1>]\n",
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
36 argv[0]);
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
37 return 1;
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
38 }
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
39 printf("monitor_aspect: %f\n",monitor_aspect);
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
40 aspect(&w,&h,z);
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
41 printf("new size: %dx%d\n",w,h);
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
42 return 0;
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
43 }
8be92a9b30a4 Fix a bug in the aspect coden (roudning at wrong point) and allow donwscaling in second pass.
atmos4
parents:
diff changeset
44