示例#1
0
        unsafe void CopyState(Data.Value.Gradient.State dst, swig.GradientHDRState src)
        {
            dst.ColorMarkers = new Data.Value.Gradient.ColorMarker[src.GetColorCount()];
            dst.AlphaMarkers = new Data.Value.Gradient.AlphaMarker[src.GetAlphaCount()];

            for (int i = 0; i < src.GetColorCount(); i++)
            {
                var color = src.GetColorMarkerColor(i);
                dst.ColorMarkers[i].ColorR    = color.R;
                dst.ColorMarkers[i].ColorG    = color.G;
                dst.ColorMarkers[i].ColorB    = color.B;
                dst.ColorMarkers[i].Position  = src.GetColorMarkerPosition(i);
                dst.ColorMarkers[i].Intensity = src.GetColorMarkerIntensity(i);
            }

            for (int i = 0; i < src.GetAlphaCount(); i++)
            {
                dst.AlphaMarkers[i].Alpha    = src.GetAlphaMarkerAlpha(i);
                dst.AlphaMarkers[i].Position = src.GetAlphaMarkerPosition(i);
            }
        }
示例#2
0
        unsafe void CopyState(swig.GradientHDRState dst, Data.Value.Gradient.State src)
        {
            dst.SetColorCount(src.ColorMarkers.Length);
            for (int i = 0; i < src.ColorMarkers.Length; i++)
            {
                var color = new swig.ColorF();
                color.R = src.ColorMarkers[i].ColorR;
                color.G = src.ColorMarkers[i].ColorG;
                color.B = src.ColorMarkers[i].ColorB;

                dst.SetColorMarkerPosition(i, src.ColorMarkers[i].Position);
                dst.SetColorMarkerColor(i, color);
                dst.SetColorMarkerIntensity(i, src.ColorMarkers[i].Intensity);
            }

            dst.SetAlphaCount(src.AlphaMarkers.Length);
            for (int i = 0; i < src.AlphaMarkers.Length; i++)
            {
                dst.SetAlphaMarkerPosition(i, src.AlphaMarkers[i].Position);
                dst.SetAlphaMarkerAlpha(i, src.AlphaMarkers[i].Alpha);
            }
        }
示例#3
0
        public void SetBinding(object o)
        {
            if (Binding == o)
            {
                return;
            }

            if (Binding != null)
            {
                Binding.OnChanged -= Binding_OnChanged;
            }

            Binding       = o as Data.Value.Gradient;
            internalState = new swig.GradientHDRState();

            if (Binding != null)
            {
                guiState      = new swig.GradientHDRGUIState();
                guiPopupState = new swig.GradientHDRGUIState();

                CopyState(internalState, Binding.GetValue());
                Binding.OnChanged += Binding_OnChanged;
            }
        }