~ubuntu-branches/ubuntu/vivid/gimp/vivid

« back to all changes in this revision

Viewing changes to tools/pdbgen/pdb/gradients.pdb

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach
  • Date: 2012-05-08 18:50:03 UTC
  • mto: (1.1.26) (0.5.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 71.
  • Revision ID: package-import@ubuntu.com-20120508185003-tltkvbaysf8d2426
ImportĀ upstreamĀ versionĀ 2.8.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# GIMP - The GNU Image Manipulation Program
2
2
# Copyright (C) 1995 Spencer Kimball and Peter Mattis
3
3
 
4
 
# This program is free software; you can redistribute it and/or modify
 
4
# This program is free software: you can redistribute it and/or modify
5
5
# it under the terms of the GNU General Public License as published by
6
 
# the Free Software Foundation; either version 2 of the License, or
 
6
# the Free Software Foundation; either version 3 of the License, or
7
7
# (at your option) any later version.
8
8
 
9
9
# This program is distributed in the hope that it will be useful,
12
12
# GNU General Public License for more details.
13
13
 
14
14
# You should have received a copy of the GNU General Public License
15
 
# along with this program; if not, write to the Free Software
16
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
16
 
18
17
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
19
18
 
30
29
    %invoke = (
31
30
        code => <<'CODE'
32
31
{
33
 
  gimp_data_factory_data_refresh (gimp->gradient_factory);
 
32
  gimp_data_factory_data_refresh (gimp->gradient_factory, context);
34
33
}
35
34
CODE
36
35
    );
63
62
        headers => [ qw("core/gimpcontainer-filter.h") ],
64
63
        code => <<'CODE'
65
64
{
66
 
  gradient_list = gimp_container_get_filtered_name_array (gimp->gradient_factory->container,
 
65
  gradient_list = gimp_container_get_filtered_name_array (gimp_data_factory_get_container (gimp->gradient_factory),
67
66
                                                          filter, &num_gradients);
68
67
}
69
68
CODE
129
128
    @inargs = (
130
129
        { name  => 'positions', type  => 'floatarray',
131
130
          desc  => 'The list of positions to sample along the gradient',
132
 
          array => { name => 'num_samples', type => 'int32',
 
131
          array => { name => 'num_samples',
133
132
                     desc => 'The number of samples to take' } },
134
133
        { name => 'reverse', type => 'boolean',
135
134
          desc => 'Use the reverse gradient' }
219
218
      pos   = 0.0;
220
219
      delta = 1.0 / (sample_size - 1);
221
220
 
222
 
      actual_name = g_strdup (gimp_object_get_name (GIMP_OBJECT (gradient)));
 
221
      actual_name = g_strdup (gimp_object_get_name (gradient));
223
222
      grad_data   = g_new (gdouble, sample_size * 4);
224
223
      width       = sample_size * 4;
225
224
 
226
225
      pv = grad_data;
227
226
 
228
 
      while (sample_size)
 
227
      while (sample_size--)
229
228
        {
230
229
          seg = gimp_gradient_get_color_at (gradient, context, seg,
231
230
                                            pos, reverse, &color);
262
261
%exports = (app => [@procs], lib => [@procs]);
263
262
 
264
263
$desc = 'Gradients';
 
264
$doc_title = 'gimpgradients';
 
265
$doc_short_desc = 'Operations related to gradients.';
 
266
$doc_long_desc = 'Operations related to gradients.';
265
267
 
266
268
1;