コード例 #1
0
ファイル: channel_cmds.c プロジェクト: Amerekanets/gimp
static GValueArray *
channel_get_opacity_invoker (GimpProcedure     *procedure,
                             Gimp              *gimp,
                             GimpContext       *context,
                             GimpProgress      *progress,
                             const GValueArray *args)
{
  gboolean success = TRUE;
  GValueArray *return_vals;
  GimpChannel *channel;
  gdouble opacity = 0.0;

  channel = gimp_value_get_channel (&args->values[0], gimp);

  if (success)
    {
      opacity = gimp_channel_get_opacity (channel) * 100;
    }

  return_vals = gimp_procedure_get_return_values (procedure, success);

  if (success)
    g_value_set_double (&return_vals->values[1], opacity);

  return return_vals;
}
コード例 #2
0
ファイル: channel-cmds.c プロジェクト: ChristianBusch/gimp
static GimpValueArray *
channel_get_opacity_invoker (GimpProcedure         *procedure,
                             Gimp                  *gimp,
                             GimpContext           *context,
                             GimpProgress          *progress,
                             const GimpValueArray  *args,
                             GError               **error)
{
  gboolean success = TRUE;
  GimpValueArray *return_vals;
  GimpChannel *channel;
  gdouble opacity = 0.0;

  channel = gimp_value_get_channel (gimp_value_array_index (args, 0), gimp);

  if (success)
    {
      opacity = gimp_channel_get_opacity (channel) * 100;
    }

  return_vals = gimp_procedure_get_return_values (procedure, success,
                                                  error ? *error : NULL);

  if (success)
    g_value_set_double (gimp_value_array_index (return_vals, 1), opacity);

  return return_vals;
}