public void SetInitialPostProcess(PostProcessType pType, float value)
    {
        switch (pType)
        {
        case PostProcessType.vignette:
            VignetteModel.Settings confv = profile.vignette.settings;
            confv.intensity           = value;
            profile.vignette.settings = confv;
            break;

        case PostProcessType.blackout:
            ColorGradingModel.Settings confg = profile.colorGrading.settings;
            confg.tonemapping.neutralBlackOut = value;
            profile.colorGrading.settings     = confg;
            break;

        case PostProcessType.chromatic:
            ChromaticAberrationModel.Settings confc = profile.chromaticAberration.settings;
            confc.intensity = value;
            profile.chromaticAberration.settings = confc;
            break;

        case PostProcessType.grain:
            GrainModel.Settings confgr = profile.grain.settings;
            confgr.intensity       = value;
            profile.grain.settings = confgr;
            break;
        }
    }
Exemple #2
0
    public void EnablePostProcessEff(PostProcessType pp)
    {
        DisableAllPostProcessEff();

        switch (pp)
        {
        case PostProcessType.playerViewEff:
            playerViewEff.gameObject.SetActive(true);
            break;

        case PostProcessType.playerDroneViewEff:
            playerDroneViewEff.gameObject.SetActive(true);
            break;

        case PostProcessType.droneTppEff:
            droneTpvEff.gameObject.SetActive(true);
            break;

        case PostProcessType.droneFppEff:
            droneFpvEff.gameObject.SetActive(true);
            break;

        default:
            break;
        }
    }
 public void StartInterpolationVector(PostProcessType pType, Vector3 target, float speed, float limit = 0.002f, InterpolationType iType = InterpolationType.damp)
 {
     isFading = true;
     switch (pType)
     {
     case PostProcessType.blue:
         StartCoroutine(InterpolateBlue(target, speed, limit, iType));
         break;
     }
 }
 public void SetInitialPostProcessVector(PostProcessType pType, Vector3 value)
 {
     switch (pType)
     {
     case PostProcessType.blue:
         ColorGradingModel.Settings confb = profile.colorGrading.settings;
         confb.channelMixer.blue       = value;
         profile.colorGrading.settings = confb;
         break;
     }
 }
Exemple #5
0
 private Report(string name, Repertoire reportoar, DateTime from, DateTime to, ReportDimension rows, ReportDimension columns, PostProcessType postprocess, OutputFormat format, string template)
 {
     Name        = name;
     Reportoar   = reportoar;
     From        = from;
     To          = to;
     Rows        = rows;
     Columns     = columns;
     PostProcess = postprocess;
     Format      = format;
     Template    = template;
 }
Exemple #6
0
        void ChangeBlitMaterial(PostProcessType type)
        {
            if (blitMaterial != null)
            {
                blitMaterial = null;
            }
            if (processProperties != null)
            {
                processProperties.Dispose();
                processProperties = null;
            }
            processProperties = processes[(int)type];

            if (processProperties != null)
            {
                processProperties.Create();
                blitMaterial = processProperties.OnUpdateMaterial();
            }
        }
    public void StartInterpolation(PostProcessType pType, float target, float speed, float limit = 0.002f, InterpolationType iType = InterpolationType.damp)
    {
        isFading = true;
        switch (pType)
        {
        case PostProcessType.vignette:
            StartCoroutine(InterpolateVignette(target, speed, limit, iType));
            break;

        case PostProcessType.blackout:
            StartCoroutine(InterpolateBlackOut(target, speed, limit, iType));
            break;

        case PostProcessType.chromatic:
            StartCoroutine(InterpolateChromatic(target, speed, limit, iType));
            break;

        case PostProcessType.grain:
            StartCoroutine(InterpolateGrain(target, speed, limit, iType));
            break;
        }
    }
        /// <summary>
        /// Create the temp dir
        /// Save the WebGrab XML config
        /// Save the Wgmulti JSON config
        /// Save the dummy.ini grabbing file
        /// Save the
        /// Start the http service listening on localhost:19801
        /// </summary>
        /// <param name="postProcessName"></param>
        public TestEnvironment(PostProcessType ppType = PostProcessType.NONE, bool copyChannel = false)
        {
            var path = "";

            if (String.IsNullOrEmpty(wgFolder))
            {
                throw new Exception("%WGPATH% variable does not exist!");
            }

            File.Copy(Path.Combine(wgFolder, wgExe), Path.Combine(Directory.GetCurrentDirectory(), wgExe));
            File.Copy(Path.Combine(wgFolder, wgDll), Path.Combine(Directory.GetCurrentDirectory(), wgDll));

            //Create temp config dir with appropriate files inside
            configFolder   = Path.Combine(temp, configFolderName);
            configFileXml  = Path.Combine(configFolder, configFileXml);
            configFileJson = Path.Combine(configFolder, configFileJson);
            outputEpg      = Path.Combine(configFolder, outputEpg);


            Destroy(); //Clean up

            // If post processing is enabled, create the directory and config files
            if (ppType != PostProcessType.NONE)
            {
                var ppDir = Path.Combine(configFolder, postProcessName);

                postProcessName    = ppType.ToString().ToLower();
                ppConfigFile       = Path.Combine(ppDir, postProcessName + ".config.xml");
                postprocessEnabled = true;

                if (!Directory.Exists(ppDir))
                {
                    Directory.CreateDirectory(ppDir);
                }

                outputEpgAfterPostProcess = Path.Combine(ppDir, "epg.xml");
                var xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?><settings>\r\n  <filename>epg.xml</filename>\r\n  <desc>{'title'...}</desc>\r\n</settings>";
                File.WriteAllText(ppConfigFile, xml);
            }

            //outputEpg = Path.Combine(configFolder, outputEpg);

            if (!Directory.Exists(configFolder))
            {
                Directory.CreateDirectory(configFolder);
            }
            testReportFilePath = Path.Combine(configFolder, "wgmulti.report.json");


            //ws = new HttpServer(5);
            //ws.Start(19801);


            // Save global XML config
            path = (@"..\..\Test Files\WebGrab++.config.xml");
            var buff = File.ReadAllText(path);

            buff = buff.Replace("epg.xml", outputEpg);
            buff = buff.Replace("rex", postProcessName);
            buff = buff.Replace("run=\"n", "run=\"" + postprocessEnabled.ToString().ToLower());
            File.WriteAllText(configFileXml, buff);

            //Save global JSON config
            path = (@"..\..\Test Files\wgmulti.config.json");
            buff = File.ReadAllText(path);
            buff = buff.Replace("epg.xml", outputEpg.Replace("\\", "\\\\"));
            buff = buff.Replace("rex", postProcessName);
            buff = buff.Replace("run\":false", "run\":" + postprocessEnabled.ToString().ToLower());

            // If copyChannel is enabled use grab type COPY otherwise use a regular siteini
            if (copyChannel)
            {
                var siteini = "{\r\n          \"name\": \"siteini\",\r\n          \"site_id\": \"channel_1\"\r\n        }";

                var siteini_copy = "{\r\n          \"name\": \"Channel3Epg\",\r\n          \"site_id\": \"Channel 3 ID\"\r\n        }";

                buff = buff.Replace(siteini, siteini_copy);

                var globalSiteini = "{\r\n          \"grab_type\": \"copy\",\r\n          \"name\": \"Channel3Epg\",\r\n          \"path\": \"http://localhost/epg/epg-cet.xml.gz\"\r\n        }";
                buff = buff.Replace("siteinis\": [ ]", "siteinis\": [" + globalSiteini + "]");

                var epg   = File.ReadAllText(@"..\..\Test Files\epg-cet.xml");
                var now   = DateTime.Now;
                var today = now.ToString("yyyyMMdd");
                now = now.AddDays(1);
                var tomorrow = now.ToString("yyyyMMdd");
                epg = epg.Replace("##TODAY##", today).Replace("##TOMORROW##", tomorrow);
                File.WriteAllText(@"C:\wamp64\www\epg\epg-cet.xml", epg);
                var gzippedFile = @"C:\wamp64\www\epg\epg-cet.xml.gz";
                if (File.Exists(gzippedFile))
                {
                    File.Delete(gzippedFile);
                }

                var bytes = File.ReadAllBytes(@"C:\wamp64\www\epg\epg-cet.xml");
                using (FileStream fs = new FileStream(gzippedFile, FileMode.CreateNew))
                    using (var zipStream = new System.IO.Compression.GZipStream(fs, System.IO.Compression.CompressionMode.Compress, false))
                    {
                        zipStream.Write(bytes, 0, bytes.Length);
                    }
            }

            File.WriteAllText(configFileJson, buff);

            //config = new Config(configFolder);

            // Create 2 test ini files. First save the EEST site ini
            buff = File.ReadAllText(@"..\..\Test Files\siteini.ini");
            File.WriteAllText(Path.Combine(configFolder, "siteini.ini"), buff);
            // Save CET siteini
            buff = File.ReadAllText(@"..\..\Test Files\siteiniCET.ini");
            File.WriteAllText(Path.Combine(configFolder, "siteiniCET.ini"), buff);

            File.Copy(@"..\..\Test Files\siteiniEmpty.ini", Path.Combine(configFolder, "siteiniEmpty.ini"));

            File.Copy(@"..\..\Test Files\siteini2.ini", Path.Combine(configFolder, "siteini2.ini"));

            Debug.WriteLine("Environment created in {0}", configFolder);
        }
        /// <summary>
        /// Create the temp dir
        /// Save the WebGrab XML config
        /// Save the Wgmulti JSON config
        /// Save the dummy.ini grabbing file
        /// Save the
        /// Start the http service listening on localhost:19801
        /// </summary>
        /// <param name="postProcessName"></param>
        public TestEnvironment(PostProcessType ppType = PostProcessType.NONE, bool copyChannel = false, String subdir = "")
        {
            //var guid = Guid.NewGuid().ToString().Substring(8);

            var path = "";

            if (String.IsNullOrEmpty(wgFolder))
            {
                throw new Exception("%WGPATH% variable does not exist!");
            }

            nunitAssets = Environment.GetEnvironmentVariable("nunitassetsfolder", EnvironmentVariableTarget.Machine);
            if (String.IsNullOrEmpty(nunitAssets))
            {
                throw new Exception("%testbindebug% variable not defined!");
            }


            //Create temp config dir with appropriate files inside
            configFolder       = Path.Combine(temp, configFolderName, subdir);
            configFileXml      = Path.Combine(configFolder, configFileXml);
            configFileJson     = Path.Combine(configFolder, configFileJson);
            outputEpg          = Path.Combine(configFolder, outputEpg);
            testReportFilePath = Path.Combine(configFolder, "wgmulti.report.json");

            Destroy(); //Clean up

            if (!Directory.Exists(configFolder))
            {
                Directory.CreateDirectory(configFolder);
            }


            // If post processing is enabled, create the directory and config files
            if (ppType != PostProcessType.NONE)
            {
                var ppDir = Path.Combine(configFolder, postProcessName);

                postProcessName    = ppType.ToString().ToLower();
                ppConfigFile       = Path.Combine(ppDir, postProcessName + ".config.xml");
                postprocessEnabled = true;

                if (!Directory.Exists(ppDir))
                {
                    Directory.CreateDirectory(ppDir);
                }

                outputEpgAfterPostProcess = Path.Combine(ppDir, "epg.xml");
                var xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<settings>\r\n  <filename>epg.xml</filename>\r\n  <desc>{'title'...}</desc>\r\n</settings>";
                File.WriteAllText(ppConfigFile, xml);
            }



            // Save global XML config
            path = Path.Combine(nunitAssets, "WebGrab++.config.xml");
            var buff = File.ReadAllText(path);

            buff = buff.Replace("epg.xml", outputEpg);
            if (postprocessEnabled)
            {
                buff = buff.Replace("postprocess run=\"n\"", "postprocess run =\"y\"");
            }
            File.WriteAllText(configFileXml, buff);

            //Save global JSON config
            path = Path.Combine(nunitAssets, "wgmulti.config.json");
            buff = File.ReadAllText(path);
            buff = buff.Replace("epg.xml", outputEpg.Replace("\\", "\\\\"));
            if (postprocessEnabled)
            {
                buff = buff.Replace("run\":false", "run\":true");
            }

            var siteini = "";

            // If copyChannel is enabled use grab type COPY otherwise use a regular siteini
            if (copyChannel)
            {
                siteini = "{\r\n          \"name\": \"Channel3Epg\",\r\n          \"site_id\": \"Channel 3 ID\"\r\n        }";
                buff    = buff.Replace("##siteini##", siteini);

                var globalSiteini = "{\r\n          \"grab_type\": \"copy\",\r\n          \"name\": \"Channel3Epg\",\r\n          \"path\": \"http://localhost/epg/epg-cet.xml.gz\"\r\n        }";
                buff = buff.Replace("siteinis\": []", "siteinis\": [" + globalSiteini + "]");

                // Get server EPG folder - where we will extract the newly generated raw EPG content for COPY type grabbing
                serverEpgFolder = Environment.GetEnvironmentVariable("serverEpgFolder", EnvironmentVariableTarget.Machine);
                if (String.IsNullOrEmpty(serverEpgFolder))
                {
                    throw new Exception("%testbindebug% variable not defined!");
                }

                var epg   = File.ReadAllText(Path.Combine(nunitAssets, "epg-cet.xml"));
                var now   = DateTime.Now;
                var today = now.ToString("yyyyMMdd");
                now = now.AddDays(1);
                var tomorrow = now.ToString("yyyyMMdd");
                epg = epg.Replace("##TODAY##", today).Replace("##TOMORROW##", tomorrow);
                File.WriteAllText(Path.Combine(serverEpgFolder, "epg-cet.xml"), epg);
                var gzippedFile = Path.Combine(serverEpgFolder, "epg-cet.xml.gz");
                if (File.Exists(gzippedFile))
                {
                    File.Delete(gzippedFile);
                }

                var bytes = File.ReadAllBytes(Path.Combine(serverEpgFolder, "epg-cet.xml"));
                using (FileStream fs = new FileStream(gzippedFile, FileMode.CreateNew))
                    using (var zipStream = new System.IO.Compression.GZipStream(fs, System.IO.Compression.CompressionMode.Compress, false))
                    {
                        zipStream.Write(bytes, 0, bytes.Length);
                    }
            }
            else
            {
                siteini = "{\r\n          \"name\": \"siteini\",\r\n          \"site_id\": \"channel_1\"\r\n          }";
                buff    = buff.Replace("##siteini##", siteini);
            }

            File.WriteAllText(configFileJson, buff);

            // Create 2 test ini files. First save the EEST site ini
            if (!Directory.Exists(SiteiniFolder))
            {
                Directory.CreateDirectory(SiteiniFolder);
            }

            File.Copy(
                Path.Combine(nunitAssets, "siteini.ini"),
                Path.Combine(SiteiniFolder, "siteini.ini"),
                true);

            // Save CET siteini
            File.Copy(
                Path.Combine(nunitAssets, "siteiniCET.ini"),
                Path.Combine(SiteiniFolder, "siteiniCET.ini"),
                true);

            File.Copy(
                Path.Combine(nunitAssets, "siteiniEmpty.ini"),
                Path.Combine(SiteiniFolder, "siteiniEmpty.ini"),
                true);

            File.Copy(
                Path.Combine(nunitAssets, "siteini2.ini"),
                Path.Combine(SiteiniFolder, "siteini2.ini"),
                true);
        }