예제 #1
0
        protected virtual void Update()
        {
            var finalCounters = counters.Count > 0 ? counters : null;

            switch (output)
            {
            case OutputType.Percentage:
            {
                var ratios = P3dChannelCounter.GetRatioRGBA(finalCounters);

                switch (channel)
                {
                case ChannelType.Red:   OutputRatio(ratios.x); break;

                case ChannelType.Green: OutputRatio(ratios.y); break;

                case ChannelType.Blue:  OutputRatio(ratios.z); break;

                case ChannelType.Alpha: OutputRatio(ratios.w); break;

                case ChannelType.InverseAlpha: OutputRatio(1.0f - ratios.w); break;
                }
            }
            break;

            case OutputType.Pixels:
            {
                switch (channel)
                {
                case ChannelType.Red:   OutputSolid(P3dChannelCounter.GetSolidR(finalCounters)); break;

                case ChannelType.Green: OutputSolid(P3dChannelCounter.GetSolidG(finalCounters)); break;

                case ChannelType.Blue:  OutputSolid(P3dChannelCounter.GetSolidB(finalCounters)); break;

                case ChannelType.Alpha: OutputSolid(P3dChannelCounter.GetSolidA(finalCounters)); break;

                case ChannelType.InverseAlpha: OutputSolid(P3dChannelCounter.GetTotal(finalCounters) - P3dChannelCounter.GetSolidA(finalCounters)); break;
                }
            }
            break;
            }
        }
예제 #2
0
        protected virtual void Update()
        {
            switch (output)
            {
            case OutputType.Percentage:
            {
                var ratios = P3dChannelCounter.GetRatioRGBA();

                switch (channel)
                {
                case ChannelType.Red:   OutputRatio(ratios.x); break;

                case ChannelType.Green: OutputRatio(ratios.y); break;

                case ChannelType.Blue:  OutputRatio(ratios.z); break;

                case ChannelType.Alpha: OutputRatio(ratios.w); break;
                }
            }
            break;

            case OutputType.Pixels:
            {
                switch (channel)
                {
                case ChannelType.Red:   OutputSolid(P3dChannelCounter.GetSolidR()); break;

                case ChannelType.Green: OutputSolid(P3dChannelCounter.GetSolidG()); break;

                case ChannelType.Blue:  OutputSolid(P3dChannelCounter.GetSolidB()); break;

                case ChannelType.Alpha: OutputSolid(P3dChannelCounter.GetSolidA()); break;
                }
            }
            break;
            }
        }