예제 #1
0
        /// <summary>
        /// Extract both eyes and creates a stereo equirectangular image.
        /// The resulting image is suitable for viewing in viewers supporting omni-stereo content.
        /// </summary>
        private static void Example3(string filename)
        {
            // Extract both eyes and create an equirectangular stereo image.
            int    maxWidth  = 8192;
            bool   fillPoles = true;
            Bitmap composite = VrJpegHelper.CreateStereoEquirectangular(filename, EyeImageGeometry.OverUnder, fillPoles, maxWidth);

            // Save the result.
            string compositeFilename = string.Format("{0}_TB.png", Path.GetFileNameWithoutExtension(filename));
            string compositeFile     = Path.Combine(Path.GetDirectoryName(filename), compositeFilename);

            composite.Save(compositeFile);
        }
예제 #2
0
        private static void ConvertStereoImageEquirectangular(string sourceFilename, string destinationName)
        {
            // Extract both eyes and create an equirectangular stereo image.
            int    maxWidth  = 8192;
            bool   fillPoles = true;
            Bitmap composite = VrJpegHelper.CreateStereoEquirectangular(sourceFilename, EyeImageGeometry.LeftRight, fillPoles, maxWidth);

            if (composite == null)
            {
                throw new Exception("Failed to create equirectangular image.");
            }

            // Save the result.
            string compositeFilename = destinationName;
            string compositeFile     = Path.Combine(Path.GetDirectoryName(sourceFilename), compositeFilename);

            composite.Save(compositeFile);
        }