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