95
sub brush_is_generated {
96
$blurb = "Tests if brush is generated";
97
$help = "Returns TRUE if this brush is parametric, FALSE for other types";
99
&bill_pdb_misc('2004', '2.4');
102
{ name => 'name', type => 'string',
103
desc => 'The brush name' }
107
{ name => 'generated', type => 'boolean',
108
desc => 'TRUE if the brush is generated' }
114
GimpBrush *brush = (GimpBrush *)
115
gimp_container_get_child_by_name (gimp->brush_factory->container, name);
118
generated = GIMP_IS_BRUSH_GENERATED (brush);
126
sub brush_is_editable {
127
$blurb = "Tests if brush can be edited";
128
$help = "Returns TRUE if you have permission to change the brush";
130
&bill_pdb_misc('2004', '2.4');
133
{ name => 'name', type => 'string',
134
desc => 'The brush name' }
138
{ name => 'editable', type => 'boolean',
139
desc => 'TRUE if the brush can be edited' }
145
GimpBrush *brush = (GimpBrush *)
146
gimp_container_get_child_by_name (gimp->brush_factory->container, name);
149
editable = GIMP_DATA (brush)->writable;
112
157
sub brush_rename {
113
158
$blurb = "Rename a brush";
114
159
$help = "This procedure renames a brush";
161
&mitch_pdb_misc('2004', '2.2');
164
{ name => 'name', type => 'string',
165
desc => 'The brush name' },
120
166
{ name => 'new_name', type => 'string',
121
desc => "The new name of the brush" }
167
desc => 'The new name of the brush' }
125
{ name => 'name', type => 'string',
126
desc => "The actual new name of the brush",
127
alias => 'g_strdup (GIMP_OBJECT (brush)->name)', no_declare => 1 },
171
{ name => 'actual_name', type => 'string',
172
desc => 'The actual new name of the brush' }
131
vars => [ 'GimpBrush *brush = NULL' ],
134
brush = (GimpBrush *)
178
GimpBrush *brush = (GimpBrush *)
135
179
gimp_container_get_child_by_name (gimp->brush_factory->container, name);
137
if (brush && GIMP_DATA (brush)->writable)
138
gimp_object_set_name (GIMP_OBJECT (brush), new_name);
181
if (brush && GIMP_DATA (brush)->writable && strlen (new_name))
183
gimp_object_set_name (GIMP_OBJECT (brush), new_name);
184
actual_name = g_strdup (gimp_object_get_name (GIMP_OBJECT (brush)));
184
232
sub brush_get_info {
185
233
$blurb = "Retrieve information about the specified brush.";
186
235
$help = <<'HELP';
187
236
This procedure retrieves information about the specified brush. This
188
237
includes the brush name, and the brush extents (width and height).
240
&mitch_pdb_misc('2004', '2.2');
243
{ name => 'name', type => 'string',
244
desc => 'The brush name' }
198
{ name => 'width', type => 'int32', no_declare => '1',
199
alias => 'brush->mask->width', void_ret => '1',
200
desc => "The brush width" },
201
{ name => 'height', type => 'int32', no_declare => '1',
202
alias => 'brush->mask->height',
203
desc => "The brush height" },
204
{ name => 'mask_bpp', type => 'int32', no_declare => '1',
205
alias => 'brush->mask->bytes',
206
desc => "The brush mask bpp" },
207
{ name => 'color_bpp', type => 'int32', no_declare => '1',
208
alias => 'brush->pixmap ? brush->pixmap->bytes : 0',
209
desc => "The brush color bpp" }
248
{ name => 'width', type => 'int32', void_ret => 1,
249
desc => 'The brush width' },
250
{ name => 'height', type => 'int32',
251
desc => 'The brush height' },
252
{ name => 'mask_bpp', type => 'int32',
253
desc => 'The brush mask bpp' },
254
{ name => 'color_bpp', type => 'int32',
255
desc => 'The brush color bpp' }
213
vars => [ 'GimpBrush *brush = NULL' ],
216
brush = (GimpBrush *)
261
GimpBrush *brush = (GimpBrush *)
217
262
gimp_container_get_child_by_name (gimp->brush_factory->container, name);
219
success = (brush != NULL);
266
width = brush->mask->width;
267
height = brush->mask->height;
268
mask_bpp = brush->mask->bytes;
269
color_bpp = brush->pixmap ? brush->pixmap->bytes : 0;
225
278
sub brush_get_pixels {
227
Retrieve information about the specified brush.
279
$blurb = 'Retrieve information about the specified brush.';
230
281
$help = <<'HELP';
231
282
This procedure retrieves information about the specified brush. This
232
283
includes the brush extents (width and height) and its pixels data.
286
&mitch_pdb_misc('2004', '2.2');
289
{ name => 'name', type => 'string',
290
desc => 'The brush name' }
242
{ name => 'width', type => 'int32', no_declare => '1',
243
alias => 'brush->mask->width', void_ret => '1',
244
desc => "The brush width" },
245
{ name => 'height', type => 'int32', no_declare => '1',
246
alias => 'brush->mask->height',
247
desc => "The brush height" },
248
{ name => 'mask_bpp', type => 'int32', init => '1',
249
desc => "The brush mask bpp" },
250
{ name => 'mask_bytes', type => 'int8array', init => '1',
294
{ name => 'width', type => 'int32', void_ret => '1',
295
desc => 'The brush width' },
296
{ name => 'height', type => 'int32',
297
desc => 'The brush height' },
298
{ name => 'mask_bpp', type => 'int32',
299
desc => 'The brush mask bpp' },
300
{ name => 'mask_bytes', type => 'int8array',
251
301
desc => 'The brush mask data',
252
array => { init => '1',
253
desc => 'Length of brush mask data' } },
254
{ name => 'color_bpp', type => 'int32', init => '1',
255
desc => "The brush color bpp" },
256
{ name => 'color_bytes', type => 'int8array', init => '1',
302
array => { desc => 'Length of brush mask data' } },
303
{ name => 'color_bpp', type => 'int32',
304
desc => 'The brush color bpp' },
305
{ name => 'color_bytes', type => 'int8array',
257
306
desc => 'The brush color data',
258
array => { init => '1',
259
desc => 'Length of brush color data' } }
307
array => { desc => 'Length of brush color data' } }
263
vars => [ 'GimpBrush *brush = NULL' ],
266
brush = (GimpBrush *)
313
GimpBrush *brush = (GimpBrush *)
267
314
gimp_container_get_child_by_name (gimp->brush_factory->container, name);
318
width = brush->mask->width;
319
height = brush->mask->height;
271
320
mask_bpp = brush->mask->bytes;
272
num_mask_bytes = brush->mask->height * brush->mask->width;
321
num_mask_bytes = brush->mask->height * brush->mask->width *
273
323
mask_bytes = g_memdup (temp_buf_data (brush->mask), num_mask_bytes);
275
325
if (brush->pixmap)
277
327
color_bpp = brush->pixmap->bytes;
278
num_color_bytes = brush->pixmap->height * brush->pixmap->width;
328
num_color_bytes = brush->pixmap->height * brush->pixmap->width *
329
brush->pixmap->bytes;
279
330
color_bytes = g_memdup (temp_buf_data (brush->pixmap),
280
331
num_color_bytes);
296
347
percentage of the maximum of the width and height of the mask.
308
$outargs[0]->{alias} = 'gimp_brush_get_spacing (brush)';
309
$outargs[0]->{no_declare} = 1;
310
$outargs[0]->{void_ret} = 1;
313
vars => [ 'GimpBrush *brush = NULL' ],
316
brush = (GimpBrush *)
317
gimp_container_get_child_by_name (gimp->brush_factory->container, name);
319
success = (brush != NULL);
350
&mitch_pdb_misc('2004', '2.2');
353
{ name => 'name', type => 'string',
354
desc => 'The brush name' }
358
{ name => 'spacing', type => '0 <= int32 <= 1000',
359
desc => 'The brush spacing',
366
GimpBrush *brush = (GimpBrush *)
367
gimp_container_get_child_by_name (gimp->brush_factory->container, name);
370
spacing = gimp_brush_get_spacing (brush);
378
sub brush_get_shape {
379
$blurb = 'Get the shape of a generated brush.';
382
This procedure gets the shape value for a generated brush. If
383
called for any other type of brush, it does not succeed. The
384
current possibilities are Circle (GIMP_BRUSH_GENERATED_CIRCLE),
385
Square (GIMP_BRUSH_GENERATED_SQUARE), and Diamond
386
(GIMP_BRUSH_GENERATED_DIAMOND). Other shapes are likely to be
390
&bill_pdb_misc('2004', '2.4');
393
{ name => 'name', type => 'string',
394
desc => 'The brush name' }
398
{ name => 'shape', type => 'enum GimpBrushGeneratedShape',
399
desc => 'The brush shape' }
405
GimpBrush *brush = (GimpBrush *)
406
gimp_container_get_child_by_name (gimp->brush_factory->container, name);
408
if (GIMP_IS_BRUSH_GENERATED (brush))
409
shape = GIMP_BRUSH_GENERATED (brush)->shape;
417
sub brush_get_radius {
418
$blurb = 'Get the radius of a generated brush.';
421
This procedure gets the radius value for a generated brush. If
422
called for any other type of brush, it does not succeed.
425
&bill_pdb_misc('2004', '2.4');
428
{ name => 'name', type => 'string',
429
desc => 'The brush name' }
433
{ name => 'radius', type => 'float',
434
desc => 'The radius of the brush in pixels' }
440
GimpBrush *brush = (GimpBrush *)
441
gimp_container_get_child_by_name (gimp->brush_factory->container, name);
443
if (GIMP_IS_BRUSH_GENERATED (brush))
444
radius = GIMP_BRUSH_GENERATED (brush)->radius;
452
sub brush_get_spikes {
453
$blurb = 'Get the number of spikes for a generated brush.';
456
This procedure gets the number of spikes for a generated brush.
457
If called for any other type of brush, it does not succeed.
460
&bill_pdb_misc('2004', '2.4');
463
{ name => 'name', type => 'string',
464
desc => 'The brush name' }
468
{ name => 'spikes', type => 'int32',
469
desc => 'The number of spikes on the brush.' }
475
GimpBrush *brush = (GimpBrush *)
476
gimp_container_get_child_by_name (gimp->brush_factory->container, name);
478
if (GIMP_IS_BRUSH_GENERATED (brush))
479
spikes = GIMP_BRUSH_GENERATED (brush)->spikes;
487
sub brush_get_hardness {
488
$blurb = 'Get the hardness of a generated brush.';
491
This procedure gets the hardness of a generated brush. The
492
hardness of a brush is the amount its intensity fades at the
493
outside edge. If called for any other type of brush, the function
497
&bill_pdb_misc('2004', '2.4');
500
{ name => 'name', type => 'string',
501
desc => 'The brush name' }
505
{ name => 'hardness', type => 'float',
506
desc => 'The hardness of the brush.' }
512
GimpBrush *brush = (GimpBrush *)
513
gimp_container_get_child_by_name (gimp->brush_factory->container, name);
515
if (GIMP_IS_BRUSH_GENERATED (brush))
516
hardness = GIMP_BRUSH_GENERATED (brush)->hardness;
524
sub brush_get_aspect_ratio {
525
$blurb = 'Get the aspect ratio of a generated brush.';
528
This procedure gets the aspect ratio of a generated brush.
529
If called for any other type of brush, it does not succeed.
532
&bill_pdb_misc('2004', '2.4');
535
{ name => 'name', type => 'string',
536
desc => 'The brush name' }
540
{ name => 'aspect_ratio', type => 'float',
541
desc => 'The aspect ratio of the brush.' }
547
GimpBrush *brush = (GimpBrush *)
548
gimp_container_get_child_by_name (gimp->brush_factory->container, name);
550
if (GIMP_IS_BRUSH_GENERATED (brush))
551
aspect_ratio = GIMP_BRUSH_GENERATED (brush)->aspect_ratio;
559
sub brush_get_angle {
560
$blurb = 'Get the rotation angle of a generated brush.';
563
This procedure gets the angle of rotation for a generated brush.
564
If called for any other type of brush, it does not succeed.
567
&bill_pdb_misc('2004', '2.4');
570
{ name => 'name', type => 'string',
571
desc => 'The brush name' }
575
{ name => 'angle', type => 'float',
576
desc => 'The rotation angle of the brush.' }
582
GimpBrush *brush = (GimpBrush *)
583
gimp_container_get_child_by_name (gimp->brush_factory->container, name);
585
if (GIMP_IS_BRUSH_GENERATED (brush))
586
angle = GIMP_BRUSH_GENERATED (brush)->angle;
626
sub brush_set_shape {
627
$blurb = 'Set the shape of a generated brush.';
630
This procedure sets the shape value for a generated brush. If
631
called for any other type of brush, it does not succeed. The
632
current possibilities are Circle (GIMP_BRUSH_GENERATED_CIRCLE),
633
Square (GIMP_BRUSH_GENERATED_SQUARE), and Diamond
634
(GIMP_BRUSH_GENERATED_DIAMOND). Other shapes are likely to be
638
&bill_pdb_misc('2004', '2.4');
641
{ name => 'name', type => 'string',
642
desc => 'The brush name' },
643
{ name => 'shape_in', type => 'enum GimpBrushGeneratedShape',
644
desc => 'The brush shape' }
648
{ name => 'shape_out', type => 'enum GimpBrushGeneratedShape',
649
desc => 'The brush shape actually assigned' }
655
GimpBrush *brush = (GimpBrush *)
656
gimp_container_get_child_by_name (gimp->brush_factory->container, name);
658
if (GIMP_IS_BRUSH_GENERATED (brush) && GIMP_DATA (brush)->writable)
660
gimp_brush_generated_set_shape (GIMP_BRUSH_GENERATED (brush),
662
shape_out = GIMP_BRUSH_GENERATED (brush)->shape;
671
sub brush_set_radius {
672
$blurb = 'Set the radius of a generated brush.';
675
This procedure sets the radius for a generated brush. If
676
called for any other type of brush, it does not succeed.
679
&bill_pdb_misc('2004', '2.4');
682
{ name => 'name', type => 'string',
683
desc => 'The brush name' },
684
{ name => 'radius_in', type => 'float',
685
desc => 'The desired brush radius' }
689
{ name => 'radius_out', type => 'float',
690
desc => 'The brush radius actually assigned' }
696
GimpBrush *brush = (GimpBrush *)
697
gimp_container_get_child_by_name (gimp->brush_factory->container, name);
699
if (GIMP_IS_BRUSH_GENERATED (brush) && GIMP_DATA (brush)->writable)
701
gimp_brush_generated_set_radius (GIMP_BRUSH_GENERATED (brush),
703
radius_out = GIMP_BRUSH_GENERATED (brush)->radius;
712
sub brush_set_spikes {
713
$blurb = 'Set the number of spikes for a generated brush.';
716
This procedure sets the number of spikes for a generated brush. If
717
called for any other type of brush, it does not succeed.
720
&bill_pdb_misc('2004', '2.4');
723
{ name => 'name', type => 'string',
724
desc => 'The brush name' },
725
{ name => 'spikes_in', type => 'int32',
726
desc => 'The desired number of spikes' }
730
{ name => 'spikes_out', type => 'int32',
731
desc => 'The number of spikes actually assigned' }
737
GimpBrush *brush = (GimpBrush *)
738
gimp_container_get_child_by_name (gimp->brush_factory->container, name);
740
if (GIMP_IS_BRUSH_GENERATED (brush) && GIMP_DATA (brush)->writable)
742
gimp_brush_generated_set_spikes (GIMP_BRUSH_GENERATED (brush),
744
spikes_out = GIMP_BRUSH_GENERATED (brush)->spikes;
753
sub brush_set_hardness {
754
$blurb = 'Set the hardness of a generated brush.';
757
This procedure sets the hardness for a generated brush. If
758
called for any other type of brush, it does not succeed.
761
&bill_pdb_misc('2004', '2.4');
764
{ name => 'name', type => 'string',
765
desc => 'The brush name' },
766
{ name => 'hardness_in', type => 'float',
767
desc => 'The desired brush hardness' }
771
{ name => 'hardness_out', type => 'float',
772
desc => 'The brush hardness actually assigned' }
778
GimpBrush *brush = (GimpBrush *)
779
gimp_container_get_child_by_name (gimp->brush_factory->container, name);
781
if (GIMP_IS_BRUSH_GENERATED (brush) && GIMP_DATA (brush)->writable)
783
gimp_brush_generated_set_hardness (GIMP_BRUSH_GENERATED (brush),
785
hardness_out = GIMP_BRUSH_GENERATED (brush)->hardness;
794
sub brush_set_aspect_ratio {
795
$blurb = 'Set the aspect ratio of a generated brush.';
798
This procedure sets the aspect ratio for a generated brush. If
799
called for any other type of brush, it does not succeed.
802
&bill_pdb_misc('2004', '2.4');
805
{ name => 'name', type => 'string',
806
desc => 'The brush name' },
807
{ name => 'aspect_ratio_in', type => 'float',
808
desc => 'The desired brush aspect ratio' }
812
{ name => 'aspect_ratio_out', type => 'float',
813
desc => 'The brush aspect ratio actually assigned' }
819
GimpBrush *brush = (GimpBrush *)
820
gimp_container_get_child_by_name (gimp->brush_factory->container, name);
822
if (GIMP_IS_BRUSH_GENERATED (brush) && GIMP_DATA (brush)->writable)
824
gimp_brush_generated_set_aspect_ratio (GIMP_BRUSH_GENERATED (brush),
826
aspect_ratio_out = GIMP_BRUSH_GENERATED (brush)->aspect_ratio;
835
sub brush_set_angle {
836
$blurb = 'Set the rotation angle of a generated brush.';
839
This procedure sets the rotation angle for a generated brush. If
840
called for any other type of brush, it does not succeed.
843
&bill_pdb_misc('2004', '2.4');
846
{ name => 'name', type => 'string',
847
desc => 'The brush name' },
848
{ name => 'angle_in', type => 'float',
849
desc => 'The desired brush rotation angle' }
853
{ name => 'angle_out', type => 'float',
854
desc => 'The brush rotation angle actually assigned' }
860
GimpBrush *brush = (GimpBrush *)
861
gimp_container_get_child_by_name (gimp->brush_factory->container, name);
863
if (GIMP_IS_BRUSH_GENERATED (brush) && GIMP_DATA (brush)->writable)
865
gimp_brush_generated_set_angle (GIMP_BRUSH_GENERATED (brush),
867
angle_out = GIMP_BRUSH_GENERATED (brush)->angle;
357
877
@headers = qw(<string.h> "base/temp-buf.h"
358
878
"core/gimp.h" "core/gimplist.h" "core/gimpbrush.h"
359
"core/gimpcontext.h" "core/gimpdatafactory.h");
879
"core/gimpbrushgenerated.h" "core/gimpcontext.h"
880
"core/gimpdatafactory.h");
361
@procs = qw(brush_new brush_duplicate brush_rename brush_delete
882
@procs = qw(brush_new brush_duplicate brush_is_generated
883
brush_rename brush_delete brush_is_editable
362
884
brush_get_info brush_get_pixels
363
brush_get_spacing brush_set_spacing);
885
brush_get_spacing brush_set_spacing
886
brush_get_shape brush_get_radius
887
brush_get_spikes brush_get_hardness
888
brush_get_aspect_ratio brush_get_angle
889
brush_set_shape brush_set_radius
890
brush_set_spikes brush_set_hardness
891
brush_set_aspect_ratio brush_set_angle);
364
893
%exports = (app => [@procs], lib => [@procs]);