Skip to content

Commit

Permalink
added half-size (3dtv) stereo mode
Browse files Browse the repository at this point in the history
  • Loading branch information
nadvornik committed Sep 27, 2011
1 parent 797e4db commit 19f041e
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 10 deletions.
11 changes: 11 additions & 0 deletions src/pixbuf-renderer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
{
Expand Down
32 changes: 24 additions & 8 deletions src/preferences.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
Expand Down Expand Up @@ -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;
}
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/typedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 19f041e

Please sign in to comment.