diff options
author | dynaflash <[email protected]> | 2008-01-29 16:11:47 +0000 |
---|---|---|
committer | dynaflash <[email protected]> | 2008-01-29 16:11:47 +0000 |
commit | 0ec912f5fd9008e4643bf375db3088f29c389304 (patch) | |
tree | fb6acb3459c073eb5f69a30377ff4874a41d44ba /macosx | |
parent | 3da2999d6e99abecc485af5d7d0a9028638af0a1 (diff) |
MacGui: Adds Loose Anamorphic information to the queue display
- patch by travistex
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1238 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/HBQueueController.h | 6 | ||||
-rw-r--r-- | macosx/HBQueueController.mm | 40 |
2 files changed, 35 insertions, 11 deletions
diff --git a/macosx/HBQueueController.h b/macosx/HBQueueController.h index 2070f0418..a2e5b9998 100644 --- a/macosx/HBQueueController.h +++ b/macosx/HBQueueController.h @@ -85,8 +85,12 @@ BOOL fIsDragging; int chapter_markers; int crop[4]; int deinterlace; - int width; + int width; // source dimensions int height; + int output_width; // output dimensions + int output_height; + int anamorphic_width; // anamorphic dimensions + int anamorphic_height; int keep_ratio; int grayscale; int pixel_ratio; diff --git a/macosx/HBQueueController.mm b/macosx/HBQueueController.mm index 81da938ff..242b8744f 100644 --- a/macosx/HBQueueController.mm +++ b/macosx/HBQueueController.mm @@ -161,6 +161,31 @@ static NSDictionary* _shortHeightAttribute = NULL; subtitleLang = [[NSString stringWithUTF8String:aSubtitle->lang] retain]; } + // Calculate and store output dimensions and anamorphic dimensions + if (pixel_ratio == 1) // Original PAR Implementation, now called Strict Anamorphic + { + output_width = titleWidth - crop[2] - crop[3]; + output_height = titleHeight - crop[0] - crop[1]; + anamorphic_width = output_width * pixel_aspect_width / pixel_aspect_height; + anamorphic_height = output_height; + } + else if (pixel_ratio == 2) // Loose Anamorphic + { + // call hb_set_anamorphic_size to do a "dry run" to get the values to be + // used by libhb for loose anamorphic. + int par_width, par_height; + hb_set_anamorphic_size(job, &output_width, &output_height, &par_width, &par_height); + anamorphic_width = output_width * par_width / par_height; + anamorphic_height = output_height; + } + else // No Anamorphic + { + output_width = width; + output_height = height; + anamorphic_width = 0; // not needed for this case + anamorphic_height = 0; // not needed for this case + } + } return self; } @@ -400,17 +425,12 @@ static NSDictionary* _shortHeightAttribute = NULL; if (withPictureInfo) { NSString * jobPictureInfo; - // integers for picture values deinterlace, crop[4], keep_ratio, grayscale, pixel_ratio, pixel_aspect_width, pixel_aspect_height, - // maxWidth, maxHeight - if (pixel_ratio == 1) - { - int croppedWidth = titleWidth - crop[2] - crop[3]; - int displayparwidth = croppedWidth * pixel_aspect_width / pixel_aspect_height; - int displayparheight = titleHeight - crop[0] - crop[1]; - jobPictureInfo = [NSString stringWithFormat:@"%dx%d (%dx%d Anamorphic)", displayparwidth, displayparheight, width, displayparheight]; - } + if (pixel_ratio == 1) // Original PAR Implementation, now called Strict Anamorphic + jobPictureInfo = [NSString stringWithFormat:@"%d x %d (%d x %d Strict Anamorphic)", output_width, output_height, anamorphic_width, anamorphic_height]; + else if (pixel_ratio == 2) // Loose Anamorphic + jobPictureInfo = [NSString stringWithFormat:@"%d x %d (%d x %d Loose Anamorphic)", output_width, output_height, anamorphic_width, anamorphic_height]; else - jobPictureInfo = [NSString stringWithFormat:@"%dx%d", width, height]; + jobPictureInfo = [NSString stringWithFormat:@"%d x %d", output_width, output_height]; if (keep_ratio == 1) jobPictureInfo = [jobPictureInfo stringByAppendingString:@" Keep Aspect Ratio"]; |