Imager::Inline(3pm)

πŸ’– NAME πŸ’–

okay bestie, this is the Imager::Inline(3pm) page from the User Contributed Perl Documentation β€” it's literally Imager::Inline: using Imager with Inline::C. 🫢

✨ SYNOPSIS ✨

like, here's the whole vibe:

         use Inline with => 'Imager';
         use Inline C => <<'EOS';
         Imager some_func(Imager::Color c, Imager::Fill f) {
           Imager img = i_img_8_new(200, 200, 3);
           /* fill with color */
           i_box_filled(img, 0, 0, 199, 199, c);
           /* inner area with fill */
           i_box_cfill(img, 50, 50, 149, 149, f);

           return img;
         }
         EOS

🌸 DESCRIPTION 🌸

So Imager hooks into Inline's with syntax to make it easier to write Inline::C code that works with Imager β€” you can call Imager functions without having to include headers or perform initialization. ✨

Imager's Inline with support does the following:

  • add the installed Imager include directory to INC
  • add the Imager typemap to TYPEMAPS
  • include the headers needed by Imager C extension modules.
  • declare and initialize the Imager API function table pointer
  • filter the supplied code to replace Imager's class names with those that Inline::C can handle.

πŸ¦‹ LIMITATIONS πŸ¦‹

heads up, bestie β€” the filtering mechanism is global. It will replace the class names even inside string constants. 😭

If you need a string matching the name of one of Imager's classes, like Imager::Color, you will need to split it into 2 to use C's string pasting mechanism, for example: "Imager:" ":Color".

πŸ‘‘ AUTHOR πŸ‘‘

Tony Cook <tonyc@cpan.org> β€” icon behavior. πŸ’…

πŸŽ€ REVISION πŸŽ€

$Revision$

🌈 SEE ALSO 🌈

go peek at these, bestie:

  • Imager
  • Imager::ExtUtils
  • Imager::API
  • Imager::APIRef
  • samples/inline_replace_color.pl

and that's the whole page, bestie: source/version perl v5.42.3, dated 2026-08-19, and it's Imager::Inline(3pm) β€” mwah πŸ’‹

πŸ“¦ where this page comes from