diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-12-23 01:20:52 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-12-23 01:20:52 +0000 |
| commit | eb1a65ba718c15a831d6c99a9bf1a51998aa4f9a (patch) | |
| tree | baca1287b65958eb997c0faec02fd8d596f36907 /src/lib | |
| parent | 13b133de7fb5b953c23c58790c2d1f2a8bf4009c (diff) | |
Add top/bottom option for 3D frames.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/types.h | 3 | ||||
| -rw-r--r-- | src/lib/video_content.cc | 2 | ||||
| -rw-r--r-- | src/lib/video_decoder.cc | 7 |
3 files changed, 11 insertions, 1 deletions
diff --git a/src/lib/types.h b/src/lib/types.h index 448b6c154..96b993a8e 100644 --- a/src/lib/types.h +++ b/src/lib/types.h @@ -68,7 +68,8 @@ struct TimedAudioBuffers enum VideoFrameType { VIDEO_FRAME_TYPE_2D, - VIDEO_FRAME_TYPE_3D_LEFT_RIGHT + VIDEO_FRAME_TYPE_3D_LEFT_RIGHT, + VIDEO_FRAME_TYPE_3D_TOP_BOTTOM }; enum Eyes diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc index 0a19ffd69..cc075a34c 100644 --- a/src/lib/video_content.cc +++ b/src/lib/video_content.cc @@ -327,6 +327,8 @@ VideoContent::video_size_after_3d_split () const return s; case VIDEO_FRAME_TYPE_3D_LEFT_RIGHT: return libdcp::Size (s.width / 2, s.height); + case VIDEO_FRAME_TYPE_3D_TOP_BOTTOM: + return libdcp::Size (s.width, s.height / 2); } assert (false); diff --git a/src/lib/video_decoder.cc b/src/lib/video_decoder.cc index eaa4534e4..e7ddec5e6 100644 --- a/src/lib/video_decoder.cc +++ b/src/lib/video_decoder.cc @@ -47,6 +47,13 @@ VideoDecoder::video (shared_ptr<const Image> image, bool same, VideoContent::Fra Video (image->crop (Crop (half, 0, 0, 0), true), EYES_RIGHT, same, frame); break; } + case VIDEO_FRAME_TYPE_3D_TOP_BOTTOM: + { + int const half = image->size().height / 2; + Video (image->crop (Crop (0, 0, 0, half), true), EYES_LEFT, same, frame); + Video (image->crop (Crop (0, 0, half, 0), true), EYES_RIGHT, same, frame); + break; + } } _video_position = frame + 1; |
