Ejemplo n.º 1
0
        void StoreValue()
        {
            var state = new Data.Value.Gradient.State();

            CopyState(state, internalState);
            Binding.SetValue(state, true);
        }
Ejemplo n.º 2
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);
            }
        }
Ejemplo n.º 3
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);
            }
        }