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 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.
26 Imager's inline C<with> support does the following:
32 add the installed Imager include directory to INC
36 add the Imager typemap to TYPEMAPS
40 include the headers needed by Imager C extension modules.
44 declare and initialize the Imager API function table pointer
48 filter the supplied code to replace Imager's class names with those
49 that Inline::C can handle.
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">.
63 Tony Cook <tony@imager.perl.org>
71 Imager, Imager::ExtUtils, Imager::API, Imager::APIRef,
72 samples/inline_replace_color.pl