QtGStreamer  1.2.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
colorbalance.cpp
1 /*
2  Copyright (C) 2010 George Kiagiadakis <kiagiadakis.george@gmail.com>
3 
4  This library is free software; you can redistribute it and/or modify
5  it under the terms of the GNU Lesser General Public License as published
6  by the Free Software Foundation; either version 2.1 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public License
15  along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17 #include "colorbalance.h"
18 #include <gst/video/colorbalance.h>
19 
20 namespace QGst {
21 
22 QString ColorBalanceChannel::label() const
23 {
24  return QString::fromUtf8(object<GstColorBalanceChannel>()->label);
25 }
26 
27 int ColorBalanceChannel::minValue() const
28 {
29  return object<GstColorBalanceChannel>()->min_value;
30 }
31 
32 int ColorBalanceChannel::maxValue() const
33 {
34  return object<GstColorBalanceChannel>()->max_value;
35 }
36 
37 
38 ColorBalanceType ColorBalance::type() const
39 {
40  return static_cast<ColorBalanceType>(gst_color_balance_get_balance_type(object<GstColorBalance>()));
41 }
42 
43 QList<ColorBalanceChannelPtr> ColorBalance::channels() const
44 {
45  QList<ColorBalanceChannelPtr> result;
46  const GList *list = gst_color_balance_list_channels(object<GstColorBalance>());
47  while(list) {
48  result.append(ColorBalanceChannelPtr::wrap(GST_COLOR_BALANCE_CHANNEL(list->data)));
49  list = list->next;
50  }
51  return result;
52 }
53 
54 int ColorBalance::value(const ColorBalanceChannelPtr & channel) const
55 {
56  return gst_color_balance_get_value(object<GstColorBalance>(), channel);
57 }
58 
59 void ColorBalance::setValue(const ColorBalanceChannelPtr & channel, int value)
60 {
61  gst_color_balance_set_value(object<GstColorBalance>(), channel, value);
62 }
63 
64 } //namespace QGst
static RefPointer< T > wrap(typename T::CType *nativePtr, bool increaseRef=true)
Definition: refpointer.h:326