diff options
author | dynaflash <[email protected]> | 2009-05-01 19:54:18 +0000 |
---|---|---|
committer | dynaflash <[email protected]> | 2009-05-01 19:54:18 +0000 |
commit | 198c0b4601453d4debf96a0b6809d0ffb497ecdc (patch) | |
tree | 484d19575ddc742ec355dffcd8eaf23346d43e8c /libhb | |
parent | 8cab795c817920ff023b6f0b8992a588e62c08c5 (diff) |
MacGui: Custom Anamorphic initial implementation (experimental) and pic settings and preview changes.
- Custom Anamorphic mode allows more customization of pixel and display dimensions.
-- NOTE: The layout and even functionality are considered very experimental and not ready for prime time yet.
-- Change to hb_get_preview allowing a preview size > title->width and height courtesy of jbjake.
-- Allows setting the modulus to 16 (default), 8, 4, 2, or 1.
-- Adds display height, pixel width and pixel height fields.
- Picture Inspector:
-- Changes shape and size according to the size/filter tab and anamorphic and filter settings.
- Picture Preview:
-- Now crops the gray borders from around the image returned from hb_get_preview and recreates cropping and resizing itself.
-- Add size and scale information to the preview window title bar so you can see it without activating the hud controls.
-- Attempt to fix the intermittent aliasing problem with the hud control overlay by making sure the hud origin is a whole int (fix courtesy of KonaB1end).
- Known Issues:
-- Scale to Screen mode is currently borked. The actual image does not scale yet.
-- Depending on how far you upscale the display dimensions in custom anamorphic, the preview image can get a bit wonky. Returning to one of the standard modes clears it up.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2362 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/hb.c | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/libhb/hb.c b/libhb/hb.c index d688eed23..ff8524956 100644 --- a/libhb/hb.c +++ b/libhb/hb.c @@ -465,31 +465,34 @@ void hb_get_preview( hb_handle_t * h, hb_title_t * title, int picture, // Free context sws_freeContext( context ); - /* Gray background */ - p32 = (uint32_t *) buffer; - for( i = 0; i < ( title->width + 2 ) * ( title->height + 2 ); i++ ) + if( job->height < title->height || job->width < title->width ) { - p32[i] = 0xFF808080; - } + /* Gray background */ + p32 = (uint32_t *) buffer; + for( i = 0; i < ( title->width + 2 ) * ( title->height + 2 ); i++ ) + { + p32[i] = 0xFF808080; + } - /* Draw the picture, centered, and draw the cropping zone */ - preview_size = pic_preview.linesize[0]; - pen = buffer + ( title->height - job->height ) * - ( title->width + 2 ) * 2 + ( title->width - job->width ) * 2; - memset( pen, 0xFF, 4 * ( job->width + 2 ) ); - pen += 4 * ( title->width + 2 ); - for( i = 0; i < job->height; i++ ) - { - uint8_t * nextLine; - nextLine = pen + 4 * ( title->width + 2 ); - memset( pen, 0xFF, 4 ); - pen += 4; - memcpy( pen, buf4 + preview_size * i, 4 * job->width ); - pen += 4 * job->width; - memset( pen, 0xFF, 4 ); - pen = nextLine; + /* Draw the picture, centered, and draw the cropping zone */ + preview_size = pic_preview.linesize[0]; + pen = buffer + ( title->height - job->height ) * + ( title->width + 2 ) * 2 + ( title->width - job->width ) * 2; + memset( pen, 0xFF, 4 * ( job->width + 2 ) ); + pen += 4 * ( title->width + 2 ); + for( i = 0; i < job->height; i++ ) + { + uint8_t * nextLine; + nextLine = pen + 4 * ( title->width + 2 ); + memset( pen, 0xFF, 4 ); + pen += 4; + memcpy( pen, buf4 + preview_size * i, 4 * job->width ); + pen += 4 * job->width; + memset( pen, 0xFF, 4 ); + pen = nextLine; + } + memset( pen, 0xFF, 4 * ( job->width + 2 ) ); } - memset( pen, 0xFF, 4 * ( job->width + 2 ) ); // Clean up avpicture_free( &pic_preview ); |