added half-size (3dtv) stereo mode
authorVladimir Nadvornik <nadvornik@suse.cz>
Sun, 20 Mar 2011 11:49:00 +0000 (12:49 +0100)
committerVladimir Nadvornik <nadvornik@suse.cz>
Tue, 27 Sep 2011 12:30:08 +0000 (14:30 +0200)
src/pixbuf-renderer.c
src/preferences.c
src/typedefs.h

index ce60bff..f074e2b 100644 (file)
@@ -2621,6 +2621,16 @@ static void pr_stereo_set(PixbufRenderer *pr)
                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 @@ static void pr_stereo_temp_disable(PixbufRenderer *pr, gboolean disable)
                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
                {
index d26aa0d..83a2cfe 100644 (file)
@@ -311,14 +311,14 @@ static void config_window_apply(void)
        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 @@ static void stereo_mode_menu_cb(GtkWidget *combo, gpointer data)
                        *option = PR_STEREO_HORIZ;
                        break;
                case 3:
-                       *option = PR_STEREO_VERT;
+                       *option = PR_STEREO_HORIZ | PR_STEREO_HALF;
                        break;
                case 4:
+                       *option = PR_STEREO_VERT;
+                       break;
+               case 5:
+                       *option = PR_STEREO_VERT | PR_STEREO_HALF;
+                       break;
+               case 6:
                        *option = PR_STEREO_FIXED;
                        break;
                }
@@ -598,15 +604,25 @@ static void add_stereo_mode_menu(GtkWidget *table, gint column, gint row, const
        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), _("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), _("Above - below"));
-       if (option & PR_STEREO_VERT) 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);
index 3e7d304..cdc2205 100644 (file)
@@ -204,8 +204,8 @@ typedef enum {
        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 {