changeset 1895:6e3edda945ae

added half-size (3dtv) stereo mode
author Vladimir Nadvornik <nadvornik@suse.cz>
date Sun, 20 Mar 2011 12:49:00 +0100
parents f0412c60e9f6
children 9604c72ac670
files src/pixbuf-renderer.c src/preferences.c src/typedefs.h
diffstat 3 files changed, 38 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/pixbuf-renderer.c	Sun Mar 20 11:31:08 2011 +0100
+++ b/src/pixbuf-renderer.c	Sun Mar 20 12:49:00 2011 +0100
@@ -2621,6 +2621,16 @@
 		if (pr->renderer2) pr->renderer2->free(pr->renderer2);
 		pr->renderer2 = NULL;
 		}
+	if (pr->stereo_mode & PR_STEREO_HALF)
+		{
+		if (pr->stereo_mode & PR_STEREO_HORIZ) pr->aspect_ratio = 2.0;
+		else if (pr->stereo_mode & PR_STEREO_VERT) pr->aspect_ratio = 0.5;
+		else pr->aspect_ratio = 1.0;
+		}
+	else
+		{
+		pr->aspect_ratio = 1.0;
+		}
 }
 
 void pixbuf_renderer_stereo_set(PixbufRenderer *pr, gint stereo_mode)
@@ -2665,6 +2675,7 @@
 		pr->renderer->stereo_set(pr->renderer, PR_STEREO_NONE);
 		if (pr->renderer2) pr->renderer2->free(pr->renderer2);
 		pr->renderer2 = NULL;
+		pr->aspect_ratio = 1.0;
 		}
 	else
 		{
--- a/src/preferences.c	Sun Mar 20 11:31:08 2011 +0100
+++ b/src/preferences.c	Sun Mar 20 12:49:00 2011 +0100
@@ -311,14 +311,14 @@
 	options->metadata.confirm_on_dir_change = c_options->metadata.confirm_on_dir_change;
 	options->metadata.keywords_case_sensitive = c_options->metadata.keywords_case_sensitive;
 	options->metadata.write_orientation = c_options->metadata.write_orientation;
-	options->stereo.mode = (c_options->stereo.mode & (PR_STEREO_HORIZ | PR_STEREO_VERT | PR_STEREO_FIXED | PR_STEREO_ANAGLYPH)) |
+	options->stereo.mode = (c_options->stereo.mode & (PR_STEREO_HORIZ | PR_STEREO_VERT | PR_STEREO_FIXED | PR_STEREO_ANAGLYPH | PR_STEREO_HALF)) |
 	                       (c_options->stereo.tmp.mirror_right ? PR_STEREO_MIRROR_RIGHT : 0) |
 	                       (c_options->stereo.tmp.flip_right   ? PR_STEREO_FLIP_RIGHT : 0) |
 	                       (c_options->stereo.tmp.mirror_left  ? PR_STEREO_MIRROR_LEFT : 0) |
 	                       (c_options->stereo.tmp.flip_left    ? PR_STEREO_FLIP_LEFT : 0) |
 	                       (c_options->stereo.tmp.swap         ? PR_STEREO_SWAP : 0) |
 	                       (c_options->stereo.tmp.temp_disable ? PR_STEREO_TEMP_DISABLE : 0);
-	options->stereo.fsmode = (c_options->stereo.fsmode & (PR_STEREO_HORIZ | PR_STEREO_VERT | PR_STEREO_FIXED | PR_STEREO_ANAGLYPH)) |
+	options->stereo.fsmode = (c_options->stereo.fsmode & (PR_STEREO_HORIZ | PR_STEREO_VERT | PR_STEREO_FIXED | PR_STEREO_ANAGLYPH | PR_STEREO_HALF)) |
 	                       (c_options->stereo.tmp.fs_mirror_right ? PR_STEREO_MIRROR_RIGHT : 0) |
 	                       (c_options->stereo.tmp.fs_flip_right   ? PR_STEREO_FLIP_RIGHT : 0) |
 	                       (c_options->stereo.tmp.fs_mirror_left  ? PR_STEREO_MIRROR_LEFT : 0) |
@@ -572,9 +572,15 @@
 			*option = PR_STEREO_HORIZ;
 			break;
 		case 3:
+			*option = PR_STEREO_HORIZ | PR_STEREO_HALF;
+			break;
+		case 4:
 			*option = PR_STEREO_VERT;
 			break;
-		case 4:
+		case 5:
+			*option = PR_STEREO_VERT | PR_STEREO_HALF;
+			break;
+		case 6:
 			*option = PR_STEREO_FIXED;
 			break;
 		}
@@ -598,15 +604,25 @@
 	if (option & PR_STEREO_ANAGLYPH) current = 1;
 
 	gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Side by Side"));
-	if (option & PR_STEREO_HORIZ) current = 2;
-
-	gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Above - below"));
-	if (option & PR_STEREO_VERT) current = 3;
-	
+	gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Side by Side Half size"));
+	if (option & PR_STEREO_HORIZ) 
+		{
+		current = 2;
+		if (option & PR_STEREO_HALF) current = 3;
+		}
+
+	gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Top - Bottom"));
+	gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Top - Bottom Half size"));
+	if (option & PR_STEREO_VERT) 
+		{
+		current = 4;
+		if (option & PR_STEREO_HALF) current = 5;
+		}
+		
 	if (add_fixed)
 		{
 		gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Fixed position"));
-		if (option & PR_STEREO_FIXED) current = 4;
+		if (option & PR_STEREO_FIXED) current = 6;
 		}
 
 	gtk_combo_box_set_active(GTK_COMBO_BOX(combo), current);
--- a/src/typedefs.h	Sun Mar 20 11:31:08 2011 +0100
+++ b/src/typedefs.h	Sun Mar 20 12:49:00 2011 +0100
@@ -204,8 +204,8 @@
 	PR_STEREO_MIRROR         = PR_STEREO_MIRROR_LEFT | PR_STEREO_MIRROR_RIGHT, /* mirror mask*/
 	PR_STEREO_FLIP           = PR_STEREO_FLIP_LEFT | PR_STEREO_FLIP_RIGHT, /* flip mask*/
 	PR_STEREO_SWAP           = 1 << 10,  /* swap left and right buffers */
-	PR_STEREO_TEMP_DISABLE   = 1 << 11  /* temporarily disable stereo mode if source image is not stereo */
-	
+	PR_STEREO_TEMP_DISABLE   = 1 << 11,  /* temporarily disable stereo mode if source image is not stereo */
+	PR_STEREO_HALF           = 1 << 12
 } PixbufRendererStereoMode;
 
 typedef enum {