]> git.imager.perl.org - imager.git/blobdiff - lib/Imager/API.pod
use non-deprecated encoding ids for freetype 2
[imager.git] / lib / Imager / API.pod
index 7cb5d25b7605450ab2f4675be70a7b9886a1ca53..19f36e3209eb68aacd68bdeafd0d5499f32944b9 100644 (file)
@@ -181,6 +181,45 @@ type back to perl.
 
 See L</Context objects> for more information.
 
+=head2 i_polygon_t
+
+Represents a single polygon supplied to i_poly_poly_aa() and
+i_poly_poly_aa_cfill().
+
+This is a structure with 3 members:
+
+=over
+
+=item *
+
+C<x>, C<y> - pointers to the first elements of arrays of doubles that define
+the vertices of the polygon.
+
+=item *
+
+C<count> - the number of values in each of the C<x> and C<y> arrays.
+
+=back
+
+=head2 i_poly_fill_mode_t
+
+An enumerated type of the possible fill modes for polygons:
+
+=over
+
+=item *
+
+C<i_pfm_evenodd> - if areas overlap an odd number of times, they
+are filled, and are otherwise unfilled.
+
+=item *
+
+C<i_pfm_nonzero> - areas that have an unbalanced clockwise and
+anti-clockwise boundary are filled.  This is the same as
+C<WindingRule> for X and C<WINDING> for Win32 GDI.
+
+=back
+
 =head1 Create an XS module using the Imager API
 
 =head2 Foo.pm
@@ -386,7 +425,7 @@ stored in an L<image object|/i_img>, eg:
 =head2 C<dIMCTXio>
 
 Defines a local context variable and initializes it from the context
-stored in an L<I/O object|/i_io_glue_t> object.
+stored in an L<< IE<47>O object|/i_io_glue_t >> object.
 
   void f(i_io_glue_t *io) {
     dIMCTXio(io);
@@ -419,7 +458,7 @@ simple mutex functions.
 
 To create a mutex:
 
-  i_mutex_t m = i_mutex_create();
+  i_mutex_t m = i_mutex_new();
 
 To control or lock the mutex:
 
@@ -437,6 +476,34 @@ I most cases where you'd use these functions, your code would create
 the mutex in your BOOT section, then lock and unlock the mutex as
 needed to control access to the library.
 
+=head1 Context slots
+
+=for stopwords
+TLS APIs
+
+To avoid abstracting the platform TLS and thread clean up handling,
+Imager provides simple APIs for storing per-context information.
+
+To allocate a slot:
+
+  im_slot_t slot = im_context_slot_new(callback)
+
+where callback is a (possibly NULL) function pointer called when the
+context object is destroyed.
+
+By default, the stored value for a slot is NULL, whether for a new
+context or for a cloned context.
+
+To store a value:
+
+  im_context_slot_set(aIMCTX, slot, somevalue);
+
+where C<somevalue> can be represented as a C<void *>.
+
+To retrieve the value:
+
+  value = im_context_slot_get(aIMCTX, slot);
+
 =head1 AUTHOR
 
 Tony Cook <tonyc@cpan.org>