Exemplo n.º 1
0
        /// <summary>
        /// Initialize the image capturing tool.
        /// </summary>
        /// <returns></returns>
        public static int Initial()
        {
            GetParameters();
            SRWorkModule_API.CreateCopyD3D11TextureBuffer();
            SetTextureFromHandleReady = false;

            RingBufferSize = SRWorkModule_API.GetRingBufferSize();
            for (int i = 0; i < RingBufferSize; i++)
            {
                UndistortedTextureDataBuffer.Add(new UndistortedTextureData());
            }

            if (SeeThrough.SRWork_SeeThrough.b4KImageReady)
            {
                TextureDistortedLeft    = new Texture2D(DistortedImageWidth, DistortedImageHeight, TextureFormat.BGRA32, false);
                TextureDistortedRight   = new Texture2D(DistortedImageWidth, DistortedImageHeight, TextureFormat.BGRA32, false);
                TextureUndistortedLeft  = new Texture2D(UndistortedImageWidth, UndistortedImageHeight, TextureFormat.RGBA32, false);
                TextureUndistortedRight = new Texture2D(UndistortedImageWidth, UndistortedImageHeight, TextureFormat.RGBA32, false);
            }
            else
            {
                TextureDistortedLeft    = new Texture2D(DistortedImageWidth, DistortedImageHeight, TextureFormat.RGBA32, false);
                TextureDistortedRight   = new Texture2D(DistortedImageWidth, DistortedImageHeight, TextureFormat.RGBA32, false);
                TextureUndistortedLeft  = new Texture2D(UndistortedImageWidth, UndistortedImageHeight, TextureFormat.RGBA32, false);
                TextureUndistortedRight = new Texture2D(UndistortedImageWidth, UndistortedImageHeight, TextureFormat.RGBA32, false);
            }

            TextureDepth = new Texture2D(DepthImageWidth, DepthImageHeight, TextureFormat.RFloat, false);
            return((int)Error.WORK);
        }