Ejemplo n.º 1
0
 public virtual void Init(Camera camera, IEncoder encoder, CameraParameters param)
 {
     Width = param.cameraResolutionWidth;
     Height = param.cameraResolutionHeight;
     m_BlendMode = param.blendMode;
     m_TargetCamera = camera;
     m_Encoder = encoder;
     Shader blendshader;
     switch (m_BlendMode)
     {
         case BlendMode.RGBOnly:
             blendshader = Resources.Load<Shader>("Record/Shaders/NormalBlend");
             m_BlendMaterial = new Material(blendshader);
             BlendTexture = new RenderTexture(Width, Height, 24, RenderTextureFormat.ARGB32);
             break;
         case BlendMode.VirtualOnly:
             blendshader = Resources.Load<Shader>("Record/Shaders/NormalBlend");
             m_BlendMaterial = new Material(blendshader);
             BlendTexture = new RenderTexture(Width, Height, 24, RenderTextureFormat.ARGB32);
             break;
         case BlendMode.Blend:
             blendshader = Resources.Load<Shader>("Record/Shaders/AlphaBlend");
             m_BlendMaterial = new Material(blendshader);
             BlendTexture = new RenderTexture(Width, Height, 24, RenderTextureFormat.ARGB32);
             break;
         case BlendMode.WidescreenBlend:
             blendshader = Resources.Load<Shader>("Record/Shaders/NormalBlend");
             m_BlendMaterial = new Material(blendshader);
             BlendTexture = new RenderTexture(2 * Width, Height, 24, RenderTextureFormat.ARGB32);
             m_RGBSource = new RenderTexture(Width, Height, 24, RenderTextureFormat.ARGB32);
             m_TempCombineTex = new Texture2D(2 * Width, Height, TextureFormat.ARGB32, false);
             break;
         default:
             break;
     }
     m_TargetCamera.enabled = false;
     m_TargetCamera.targetTexture = new RenderTexture(Width, Height, 24, RenderTextureFormat.ARGB32);
 }
Ejemplo n.º 2
0
        public void StartPhotoModeAsync(CameraParameters setupParams, OnPhotoModeStartedCallback onPhotoModeStartedCallback)
        {
            PhotoCaptureResult result = new PhotoCaptureResult();

            try
            {
                setupParams.camMode = CamMode.PhotoMode;
                m_CaptureContext.StartCaptureMode(setupParams);
                m_CaptureContext.StartCapture();

                NRKernalUpdater.Instance.StartCoroutine(OnPhotoModeStartedReady(() =>
                {
                    result.resultType = CaptureResultType.Success;
                    onPhotoModeStartedCallback?.Invoke(result);
                }));
            }
            catch (Exception)
            {
                result.resultType = CaptureResultType.UnknownError;
                onPhotoModeStartedCallback?.Invoke(result);
                throw;
            }
        }
 public void SetConfig(CameraParameters cameraparm)
 {
     m_CameraParameters = cameraparm;
 }
 public void Config(CameraParameters param)
 {
     Config(new NativeEncodeConfig(param));
 }
Ejemplo n.º 5
0
 public void Config(CameraParameters param)
 {
     this.m_CameraParameters = param;
     m_Requests = new Queue <AsyncGPUReadbackRequest>();
     m_Tasks    = new Queue <CaptureTask>();
 }