]> git.imager.perl.org - imager.git/blame - lib/Imager/Inline.pod
avoid ignoring the result of i_io_getc()
[imager.git] / lib / Imager / Inline.pod
CommitLineData
92bda632
TC
1=head1 NAME
2
3Imager::Inline - using Imager with Inline::C.
4
5=head1 SYNOPSIS
6
7 use Inline with => 'Imager';
8 use Inline C => <<'EOS';
9 Imager some_func(Imager::Color c, Imager::Fill f) {
10 Imager img = i_img_8_new(200, 200, 3);
11 /* fill with color */
12 i_box_filled(img, 0, 0, 199, 199, c);
13 /* inner area with fill */
14 i_box_cfill(img, 50, 50, 149, 149, f);
15
16 return img;
17 }
18 EOS
19
20=head1 DESCRIPTION
21
5715f7c3
TC
22=for stopwords inline Inline Inline's
23
92bda632
TC
24Imager hooks into Inline's C<with> syntax to make it easier to write
25Inline::C code that works with Imager, you can call Imager functions
26without having to include headers or perform initialization.
27
5715f7c3 28Imager's Inline C<with> support does the following:
92bda632
TC
29
30=over
31
32=item *
33
34add the installed Imager include directory to INC
35
36=item *
37
38add the Imager typemap to TYPEMAPS
39
40=item *
41
42include the headers needed by Imager C extension modules.
43
44=item *
45
46declare and initialize the Imager API function table pointer
47
48=item *
49
50filter the supplied code to replace Imager's class names with those
51that Inline::C can handle.
52
53=back
54
55=head1 LIMITATIONS
56
57The filtering mechanism is global, it will replace the class names
58even inside string constants. If you need a string matching the name
59of one of Imager's classes, like C<"Imager::Color"> you will need to
60split it into 2 to use C's string pasting mechanism, for example:
61C<"Imager:" ":Color">.
62
63=head1 AUTHOR
64
5b480b14 65Tony Cook <tonyc@cpan.org>
92bda632
TC
66
67=head1 REVISION
68
69$Revision$
70
71=head1 SEE ALSO
72
7327d4b0
TC
73Imager, Imager::ExtUtils, Imager::API, Imager::APIRef,
74samples/inline_replace_color.pl
92bda632
TC
75
76=cut