public int GetValue(Gst.Video.ColorBalanceChannel channel)
        {
            int raw_ret = gst_color_balance_get_value(Handle, channel == null ? IntPtr.Zero : channel.Handle);
            int ret     = raw_ret;

            return(ret);
        }
Exemplo n.º 2
0
        // Process a color balance command
        static void UpdateColorChannel(string channelName, bool increase, Gst.Video.IColorBalance cb)
        {
            // Retrieve the list of channels and locate the requested one
            var channels = cb.ListChannels();

            Gst.Video.ColorBalanceChannel channel = null;
            foreach (var ch in channels)
            {
                var label = ch.Label;

                if (label.Contains(channelName))
                {
                    channel = ch;
                    break;
                }
            }
            if (channel == null)
            {
                return;
            }

            // Change the channel's value
            var step  = 0.1 * (channel.MaxValue - channel.MinValue);
            var value = cb.GetValue(channel);

            if (increase)
            {
                value = (int)(value + step);
                if (value > channel.MaxValue)
                {
                    value = channel.MaxValue;
                }
            }
            else
            {
                value = (int)(value - step);
                if (value < channel.MinValue)
                {
                    value = channel.MinValue;
                }
            }
            cb.SetValue(channel, value);
        }
 public void ValueChanged(Gst.Video.ColorBalanceChannel channel, int value)
 {
     gst_color_balance_value_changed(Handle, channel == null ? IntPtr.Zero : channel.Handle, value);
 }
 public void SetValue(Gst.Video.ColorBalanceChannel channel, int value)
 {
     gst_color_balance_set_value(Handle, channel == null ? IntPtr.Zero : channel.Handle, value);
 }