18
18
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
21
$author = 'Michael Natterer <mitch@gimp.org>';
22
$copyright = 'Michael Natterer';
30
desc => 'The pattern name.'
36
20
sub pattern_get_info {
37
21
$blurb = 'Retrieve information about the specified pattern.';
39
24
This procedure retrieves information about the specified pattern.
40
25
This includes the pattern extents (width and height).
28
&mitch_pdb_misc('2004', '2.2');
31
{ name => 'name', type => 'string',
32
desc => 'The pattern name.' }
50
{ name => 'width', type => 'int32', no_declare => '1',
51
alias => 'pattern->mask->width', void_ret => '1',
36
{ name => 'width', type => 'int32', void_ret => '1',
52
37
desc => "The pattern width" },
53
{ name => 'height', type => 'int32', no_declare => '1',
54
alias => 'pattern->mask->height',
38
{ name => 'height', type => 'int32',
55
39
desc => "The pattern height" },
56
{ name => 'bpp', type => 'int32', no_declare => '1',
57
alias => 'pattern->mask->bytes',
40
{ name => 'bpp', type => 'int32',
58
41
desc => "The pattern bpp" }
62
vars => [ 'GimpPattern *pattern = NULL' ],
65
pattern = (GimpPattern *)
47
GimpPattern *pattern = (GimpPattern *)
66
48
gimp_container_get_child_by_name (gimp->pattern_factory->container, name);
68
success = (pattern != NULL);
52
width = pattern->mask->width;
53
height = pattern->mask->height;
54
bpp = pattern->mask->bytes;
74
&mitch_pdb_misc('2004', '2.2');
77
{ name => 'name', type => 'string',
78
desc => 'The pattern name.' }
92
{ name => 'width', type => 'int32', no_declare => '1',
93
alias => 'pattern->mask->width', void_ret => '1',
82
{ name => 'width', type => 'int32', void_ret => '1',
94
83
desc => "The pattern width" },
95
{ name => 'height', type => 'int32', no_declare => '1',
96
alias => 'pattern->mask->height',
84
{ name => 'height', type => 'int32',
97
85
desc => "The pattern height" },
98
{ name => 'bpp', type => 'int32', no_declare => '1',
99
alias => 'pattern->mask->bytes',
86
{ name => 'bpp', type => 'int32',
100
87
desc => "The pattern bpp" },
101
{ name => 'color_bytes', type => 'int8array', init => 1,
88
{ name => 'color_bytes', type => 'int8array',
102
89
desc => 'The pattern data.',
103
array => { init => 1,
104
desc => 'Number of pattern bytes' } }
90
array => { desc => 'Number of pattern bytes' } }
108
vars => [ 'GimpPattern *pattern = NULL' ],
111
pattern = (GimpPattern *)
96
GimpPattern *pattern = (GimpPattern *)
112
97
gimp_container_get_child_by_name (gimp->pattern_factory->container, name);
101
width = pattern->mask->width;
102
height = pattern->mask->height;
103
bpp = pattern->mask->bytes;
116
104
num_color_bytes = pattern->mask->height * pattern->mask->width *
117
105
pattern->mask->bytes;
118
106
color_bytes = g_memdup (temp_buf_data (pattern->mask),