Changeset 4934 for tools/grab/main.c
- Timestamp:
- 12/20/10 22:29:05 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/grab/main.c
r4899 r4934 131 131 132 132 int xres_v,yres_v,xres_o,yres_o,xres,yres,aspect; 133 int c,osd_only,video_only,use_osd_res,width, use_png,use_jpg,jpg_quality,no_aspect,use_letterbox;133 int c,osd_only,video_only,use_osd_res,width,own_hight,use_png,use_jpg,jpg_quality,no_aspect,use_letterbox; 134 134 135 135 // we use fast resize as standard now 136 136 resize = &fast_resize; 137 137 138 osd_only=video_only=use_osd_res=width= use_png=use_jpg=no_aspect=use_letterbox=0;138 osd_only=video_only=use_osd_res=width=own_hight=use_png=use_jpg=no_aspect=use_letterbox=0; 139 139 jpg_quality=50; 140 140 aspect=1; … … 146 146 147 147 // process command line 148 while ((c = getopt (argc, argv, "dhj:lbnop r:vf:")) != -1)148 while ((c = getopt (argc, argv, "dhj:lbnopir:vf:")) != -1) 149 149 { 150 150 switch (c) … … 160 160 printf("-n dont correct 16:9 aspect ratio\n"); 161 161 printf("-r (size) resize to a fixed width, maximum: 1920\n"); 162 printf("-i (size) resize to a fixed hight (only with -r), maximum: 1920\n"); 162 163 printf("-l always 4:3, create letterbox if 16:9\n"); 163 164 printf("-b use bicubic picture resize (slow but smooth)\n"); … … 187 188 { 188 189 printf("[grab] Error: -r (size) ist limited to 1920 pixel !\n"); 190 return 1; 191 } 192 break; 193 case 'i': // use given resolution 194 own_hight=atoi(optarg); 195 if (own_hight > 1920) 196 { 197 printf("[grab] Error: -i (size) ist limited to 1920 pixel !\n"); 189 198 return 1; 190 199 } … … 291 300 if (width) 292 301 { 293 printf("[grab] Resizing Screenshot to %d x %d ...\n",width,yres*width/xres); 294 resize(output,video,xres,yres,width,(yres*width/xres),3); 295 yres=yres*width/xres; 302 if (own_hight == 0) 303 own_hight = yres*width/xres; 304 printf("[grab] Resizing Screenshot to %d x %d ...\n",width,own_hight); 305 resize(output,video,xres,yres,width,(own_hight),3); 306 yres=own_hight; 296 307 xres=width; 297 308 memcpy(output,video,xres*yres*3);
Note: See TracChangeset
for help on using the changeset viewer.