]> git.imager.perl.org - imager.git/blob - lib/Imager/Inline.pod
allow box() to accept floating colors for filling areas
[imager.git] / lib / Imager / Inline.pod
1 =head1 NAME
2
3 Imager::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
22 =for stopwords inline Inline Inline's
23
24 Imager hooks into Inline's C<with> syntax to make it easier to write
25 Inline::C code that works with Imager, you can call Imager functions
26 without having to include headers or perform initialization.
27
28 Imager's Inline C<with> support does the following:
29
30 =over
31
32 =item *
33
34 add the installed Imager include directory to INC
35
36 =item *
37
38 add the Imager typemap to TYPEMAPS
39
40 =item *
41
42 include the headers needed by Imager C extension modules.
43
44 =item *
45
46 declare and initialize the Imager API function table pointer
47
48 =item *
49
50 filter the supplied code to replace Imager's class names with those
51 that Inline::C can handle.
52
53 =back
54
55 =head1 LIMITATIONS
56
57 The filtering mechanism is global, it will replace the class names
58 even inside string constants.  If you need a string matching the name
59 of one of Imager's classes, like C<"Imager::Color"> you will need to
60 split it into 2 to use C's string pasting mechanism, for example:
61 C<"Imager:" ":Color">.
62
63 =head1 AUTHOR
64
65 Tony Cook <tony@imager.perl.org>
66
67 =head1 REVISION
68
69 $Revision$
70
71 =head1 SEE ALSO
72
73 Imager, Imager::ExtUtils, Imager::API, Imager::APIRef,
74 samples/inline_replace_color.pl
75
76 =cut