3 Imager::Inline - using Imager with Inline::C.
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);
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);
22 =for stopwords inline Inline Inline's
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.
28 Imager's Inline C<with> support does the following:
34 add the installed Imager include directory to INC
38 add the Imager typemap to TYPEMAPS
42 include the headers needed by Imager C extension modules.
46 declare and initialize the Imager API function table pointer
50 filter the supplied code to replace Imager's class names with those
51 that Inline::C can handle.
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">.
65 Tony Cook <tony@imager.perl.org>
73 Imager, Imager::ExtUtils, Imager::API, Imager::APIRef,
74 samples/inline_replace_color.pl