]> git.imager.perl.org - imager.git/blobdiff - fills.c
missed a PERL_NO_GET_CONTEXT
[imager.git] / fills.c
diff --git a/fills.c b/fills.c
index 4298b64303e1b1ba6c49f8a2954f7b465d55bdc7..5ca4293473184e3f6bce8b06b30bc1180bab18a6 100644 (file)
--- a/fills.c
+++ b/fills.c
@@ -412,21 +412,23 @@ i_new_hatch_low(const i_color *fg, const i_color *bg, const i_fcolor *ffg, const
                 int dx, int dy);
 
 /*
-=item i_new_fill_hatch(fg, bg, combine, hatch, cust_hatch, dx, dy)
+=item i_new_fill_hatch(C<fg>, C<bg>, C<combine>, C<hatch>, C<cust_hatch>, C<dx>, C<dy>)
 
 =category Fills
 =synopsis i_fill_t *fill = i_new_fill_hatch(&fg_color, &bg_color, combine, hatch, custom_hatch, dx, dy);
 
-Creates a new hatched fill with the fg color used for the 1 bits in
-the hatch and bg for the 0 bits.  If combine is non-zero alpha values
-will be combined.
+Creates a new hatched fill with the C<fg> color used for the 1 bits in
+the hatch and C<bg> for the 0 bits.  If C<combine> is non-zero alpha
+values will be combined.
 
-If cust_hatch is non-NULL it should be a pointer to 8 bytes of the
+If C<cust_hatch> is non-NULL it should be a pointer to 8 bytes of the
 hash definition, with the high-bits to the left.
 
-If cust_hatch is NULL then one of the standard hatches is used.
+If C<cust_hatch> is NULL then one of the standard hatches is used.
 
-(dx, dy) are an offset into the hatch which can be used to unalign adjoining areas, or to align the origin of a hatch with the the side of a filled area.
+(C<dx>, C<dy>) are an offset into the hatch which can be used to hatch
+adjoining areas out of alignment, or to align the origin of a hatch
+with the the side of a filled area.
 
 =cut
 */
@@ -438,21 +440,23 @@ i_new_fill_hatch(const i_color *fg, const i_color *bg, int combine, int hatch,
 }
 
 /*
-=item i_new_fill_hatchf(fg, bg, combine, hatch, cust_hatch, dx, dy)
+=item i_new_fill_hatchf(C<fg>, C<bg>, C<combine>, C<hatch>, C<cust_hatch>, C<dx>, C<dy>)
 
 =category Fills
 =synopsis i_fill_t *fill = i_new_fill_hatchf(&fg_fcolor, &bg_fcolor, combine, hatch, custom_hatch, dx, dy);
 
-Creates a new hatched fill with the fg color used for the 1 bits in
-the hatch and bg for the 0 bits.  If combine is non-zero alpha values
-will be combined.
+Creates a new hatched fill with the C<fg> color used for the 1 bits in
+the hatch and C<bg> for the 0 bits.  If C<combine> is non-zero alpha
+values will be combined.
 
-If cust_hatch is non-NULL it should be a pointer to 8 bytes of the
+If C<cust_hatch> is non-NULL it should be a pointer to 8 bytes of the
 hash definition, with the high-bits to the left.
 
-If cust_hatch is NULL then one of the standard hatches is used.
+If C<cust_hatch> is NULL then one of the standard hatches is used.
 
-(dx, dy) are an offset into the hatch which can be used to unalign adjoining areas, or to align the origin of a hatch with the the side of a filled area.
+(C<dx>, C<dy>) are an offset into the hatch which can be used to hatch
+adjoining areas out of alignment, or to align the origin of a hatch
+with the the side of a filled area.
 
 =cut
 */
@@ -486,7 +490,7 @@ image_fill_proto =
   };
 
 /*
-=item i_new_fill_image(im, matrix, xoff, yoff, combine)
+=item i_new_fill_image(C<im>, C<matrix>, C<xoff>, C<yoff>, C<combine>)
 
 =category Fills
 =synopsis i_fill_t *fill = i_new_fill_image(src_img, matrix, x_offset, y_offset, combine);
@@ -495,7 +499,7 @@ Create an image based fill.
 
 matrix is an array of 9 doubles representing a transformation matrix.
 
-xoff and yoff are the offset into the image to start filling from.
+C<xoff> and C<yoff> are the offset into the image to start filling from.
 
 =cut
 */
@@ -938,7 +942,7 @@ static void
 fill_opacity(i_fill_t *fill, int x, int y, int width, int channels,
             i_color *data) {
   struct i_fill_opacity_t *f = (struct i_fill_opacity_t *)fill;
-  int alpha_chan = channels-1; /* channels is always 2 or 4 */
+  int alpha_chan = channels > 2 ? 3 : 1;
   i_color *datap = data;
   
   (f->other_fill->f_fill_with_color)(f->other_fill, x, y, width, channels, data);
@@ -957,7 +961,7 @@ static void
 fill_opacityf(i_fill_t *fill, int x, int y, int width, int channels,
            i_fcolor *data) {
   struct i_fill_opacity_t *f = (struct i_fill_opacity_t *)fill;
-  int alpha_chan = channels-1; /* channels is always 2 or 4 */
+  int alpha_chan = channels > 2 ? 3 : 1;
   i_fcolor *datap = data;
   
   (f->other_fill->f_fill_with_fcolor)(f->other_fill, x, y, width, channels, data);