gst_plugins_base/gst-libs/gst/interfaces/colorbalance.c
changeset 8 4a7fac7dd34a
parent 0 0e761a78d257
child 30 7e817e7e631c
equal deleted inserted replaced
7:71e347f905f2 8:4a7fac7dd34a
    28 #include "interfaces-marshal.h"
    28 #include "interfaces-marshal.h"
    29 
    29 
    30 /**
    30 /**
    31  * SECTION:gstcolorbalance
    31  * SECTION:gstcolorbalance
    32  * @short_description: Interface for adjusting color balance settings
    32  * @short_description: Interface for adjusting color balance settings
       
    33  *
       
    34  * <refsect2><para>
       
    35  * This interface is implemented by elements which can perform some color
       
    36  * balance operation on video frames they process. For example, modifying
       
    37  * the brightness, contrast, hue or saturation.
       
    38  * </para><para>
       
    39  * Example elements are 'xvimagesink' and 'colorbalance'
       
    40  * </para>
       
    41  * </refsect2>
    33  */
    42  */
    34 
    43 
    35 enum
    44 enum
    36 {
    45 {
    37   VALUE_CHANGED,
    46   VALUE_CHANGED,
    77 gst_color_balance_class_init (GstColorBalanceClass * klass)
    86 gst_color_balance_class_init (GstColorBalanceClass * klass)
    78 {
    87 {
    79   static gboolean initialized = FALSE;
    88   static gboolean initialized = FALSE;
    80 
    89 
    81   if (!initialized) {
    90   if (!initialized) {
       
    91     /**
       
    92      * GstColorBalance::value-changed:
       
    93      * @colorbalance: The GstColorBalance instance
       
    94      * @channel: The #GstColorBalanceChannel
       
    95      * @value: The new value
       
    96      *
       
    97      * Fired when the value of the indicated channel has changed.
       
    98      */
    82     gst_color_balance_signals[VALUE_CHANGED] =
    99     gst_color_balance_signals[VALUE_CHANGED] =
    83         g_signal_new ("value-changed",
   100         g_signal_new ("value-changed",
    84         GST_TYPE_COLOR_BALANCE, G_SIGNAL_RUN_LAST,
   101         GST_TYPE_COLOR_BALANCE, G_SIGNAL_RUN_LAST,
    85         G_STRUCT_OFFSET (GstColorBalanceClass, value_changed),
   102         G_STRUCT_OFFSET (GstColorBalanceClass, value_changed),
    86         NULL, NULL,
   103         NULL, NULL,
    95   /* default virtual functions */
   112   /* default virtual functions */
    96   klass->list_channels = NULL;
   113   klass->list_channels = NULL;
    97   klass->set_value = NULL;
   114   klass->set_value = NULL;
    98   klass->get_value = NULL;
   115   klass->get_value = NULL;
    99 }
   116 }
   100 #ifdef __SYMBIAN32__
   117 
   101 EXPORT_C
   118 /**
   102 #endif
   119  * gst_color_balance_list_channels:
   103 
   120  * @balance: A #GstColorBalance instance
       
   121  * 
       
   122  * Retrieve a list of the available channels.
       
   123  *
       
   124  * Returns: A GList containing pointers to #GstColorBalanceChannel objects.
       
   125  *          The list is owned by the #GstColorBalance instance and must not
       
   126  *          be freed.
       
   127  */
       
   128 #ifdef __SYMBIAN32__
       
   129 EXPORT_C
       
   130 #endif
   104 
   131 
   105 const GList *
   132 const GList *
   106 gst_color_balance_list_channels (GstColorBalance * balance)
   133 gst_color_balance_list_channels (GstColorBalance * balance)
   107 {
   134 {
   108   GstColorBalanceClass *klass = GST_COLOR_BALANCE_GET_CLASS (balance);
   135   GstColorBalanceClass *klass = GST_COLOR_BALANCE_GET_CLASS (balance);
   111     return klass->list_channels (balance);
   138     return klass->list_channels (balance);
   112   }
   139   }
   113 
   140 
   114   return NULL;
   141   return NULL;
   115 }
   142 }
   116 #ifdef __SYMBIAN32__
   143 
   117 EXPORT_C
   144 /**
   118 #endif
   145  * gst_color_balance_set_value:
   119 
   146  * @balance: A #GstColorBalance instance
       
   147  * @channel: A #GstColorBalanceChannel instance
       
   148  * @value: The new value for the channel.
       
   149  *
       
   150  * Sets the current value of the channel to the passed value, which must
       
   151  * be between min_value and max_value.
       
   152  * 
       
   153  * See Also: The #GstColorBalanceChannel::min_value and
       
   154  *         #GstColorBalanceChannel::max_value members of the
       
   155  *         #GstColorBalanceChannel object.
       
   156  */
       
   157 #ifdef __SYMBIAN32__
       
   158 EXPORT_C
       
   159 #endif
   120 
   160 
   121 void
   161 void
   122 gst_color_balance_set_value (GstColorBalance * balance,
   162 gst_color_balance_set_value (GstColorBalance * balance,
   123     GstColorBalanceChannel * channel, gint value)
   163     GstColorBalanceChannel * channel, gint value)
   124 {
   164 {
   126 
   166 
   127   if (klass->set_value) {
   167   if (klass->set_value) {
   128     klass->set_value (balance, channel, value);
   168     klass->set_value (balance, channel, value);
   129   }
   169   }
   130 }
   170 }
   131 #ifdef __SYMBIAN32__
   171 
   132 EXPORT_C
   172 /**
   133 #endif
   173  * gst_color_balance_get_value:
   134 
   174  * @balance: A #GstColorBalance instance
       
   175  * @channel: A #GstColorBalanceChannel instance
       
   176  *
       
   177  * Retrieve the current value of the indicated channel, between min_value
       
   178  * and max_value.
       
   179  * 
       
   180  * See Also: The #GstColorBalanceChannel::min_value and
       
   181  *         #GstColorBalanceChannel::max_value members of the
       
   182  *         #GstColorBalanceChannel object.
       
   183  * 
       
   184  * Returns: The current value of the channel.
       
   185  */
       
   186 #ifdef __SYMBIAN32__
       
   187 EXPORT_C
       
   188 #endif
   135 
   189 
   136 gint
   190 gint
   137 gst_color_balance_get_value (GstColorBalance * balance,
   191 gst_color_balance_get_value (GstColorBalance * balance,
   138     GstColorBalanceChannel * channel)
   192     GstColorBalanceChannel * channel)
   139 {
   193 {
   143     return klass->get_value (balance, channel);
   197     return klass->get_value (balance, channel);
   144   }
   198   }
   145 
   199 
   146   return channel->min_value;
   200   return channel->min_value;
   147 }
   201 }
   148 #ifdef __SYMBIAN32__
   202 
   149 EXPORT_C
   203 /**
   150 #endif
   204  * gst_color_balance_get_balance_type:
   151 
   205  * @balance: The #GstColorBalance implementation
       
   206  *
       
   207  * Get the #GstColorBalanceType of this implementation.
       
   208  *
       
   209  * Returns: A the #GstColorBalanceType.
       
   210  *
       
   211  * Since: 0.10.24
       
   212  */
       
   213  
       
   214  #ifdef __SYMBIAN32__
       
   215 EXPORT_C
       
   216 #endif
       
   217 
       
   218 GstColorBalanceType
       
   219 gst_color_balance_get_balance_type (GstColorBalance * balance)
       
   220 {
       
   221   GstColorBalanceClass *klass = GST_COLOR_BALANCE_GET_CLASS (balance);
       
   222 
       
   223   return klass->balance_type;
       
   224 }
       
   225 
       
   226 /**
       
   227  * gst_color_balance_value_changed:
       
   228  * @balance: A #GstColorBalance instance
       
   229  * @channel: A #GstColorBalanceChannel whose value has changed
       
   230  * @value: The new value of the channel
       
   231  *
       
   232  * A helper function called by implementations of the GstColorBalance
       
   233  * interface. It fires the #GstColorBalance::value-changed signal on the
       
   234  * instance, and the #GstColorBalanceChannel::value-changed signal on the
       
   235  * channel object.
       
   236  */
       
   237 #ifdef __SYMBIAN32__
       
   238 EXPORT_C
       
   239 #endif
   152 
   240 
   153 void
   241 void
   154 gst_color_balance_value_changed (GstColorBalance * balance,
   242 gst_color_balance_value_changed (GstColorBalance * balance,
   155     GstColorBalanceChannel * channel, gint value)
   243     GstColorBalanceChannel * channel, gint value)
   156 {
   244 {