Skip to content
Browse files

huge spelling update and spell checking patch

  • Loading branch information...
1 parent 7468f3f commit 5715f7c346843625ebcd21c2d2d57edd6473cce0 Tony Cook committed Apr 12, 2010
Showing with 1,641 additions and 1,488 deletions.
  1. +4 −2 Changes
  2. +2 −2 Flines/Flines.pm
  3. +23 −14 Imager.pm
  4. +7 −7 Mandelbrot/Mandelbrot.pm
  5. +35 −33 draw.c
  6. +3 −3 error.c
  7. +20 −16 fills.c
  8. +1 −1 filters.im
  9. +19 −19 image.c
  10. +18 −17 imdatatypes.h
  11. +31 −31 imext.c
  12. +2 −2 immacros.h
  13. +23 −20 lib/Imager/API.pod
  14. +161 −153 lib/Imager/APIRef.pod
  15. +35 −34 lib/Imager/Color.pm
  16. +10 −9 lib/Imager/Color/Float.pm
  17. +2 −2 lib/Imager/Color/Table.pm
  18. +13 −12 lib/Imager/Cookbook.pod
  19. +170 −167 lib/Imager/Draw.pod
  20. +66 −51 lib/Imager/Engines.pod
  21. +14 −10 lib/Imager/Expr.pm
  22. +11 −11 lib/Imager/Expr/Assem.pm
  23. +112 −91 lib/Imager/Files.pod
  24. +46 −47 lib/Imager/Fill.pm
  25. +105 −88 lib/Imager/Filters.pod
  26. +110 −101 lib/Imager/Font.pm
  27. +2 −2 lib/Imager/Font/BBox.pm
  28. +10 −4 lib/Imager/Font/FreeType2.pm
  29. +3 −3 lib/Imager/Font/Truetype.pm
  30. +10 −8 lib/Imager/Font/Type1.pm
  31. +3 −1 lib/Imager/Font/Win32.pm
  32. +44 −42 lib/Imager/Font/Wrap.pm
  33. +44 −36 lib/Imager/Fountain.pm
  34. +6 −6 lib/Imager/Handy.pod
  35. +177 −178 lib/Imager/ImageTypes.pod
  36. +3 −1 lib/Imager/Inline.pod
  37. +3 −3 lib/Imager/Matrix2d.pm
  38. +15 −11 lib/Imager/Preprocess.pm
  39. +2 −2 lib/Imager/Regops.pm
  40. +8 −3 lib/Imager/Test.pm
  41. +5 −5 lib/Imager/Transform.pm
  42. +107 −105 lib/Imager/Transformations.pod
  43. +2 −0 lib/Imager/Tutorial.pod
  44. +76 −71 lib/Imager/interface.pod
  45. +14 −14 lib/Imager/regmach.pod
  46. +2 −2 palimg.c
  47. +6 −5 paste.im
  48. +12 −12 quant.c
  49. +2 −2 regops.perl
  50. +6 −6 rubthru.im
  51. +2 −2 samples/align-string.pl
  52. +4 −0 samples/anaglyph.pl
  53. +10 −12 samples/flasher.pl
  54. +4 −2 samples/gifscale.pl
  55. +1 −1 samples/inline_capture2image.pl
  56. +2 −0 samples/inline_replace_color.pl
  57. +2 −0 samples/interleave.pl
  58. +2 −0 samples/quad_to_square.pl
  59. +1 −0 samples/slant_text.pl
  60. +2 −0 samples/tk-photo.pl
  61. +1 −1 t/t93podcover.t
  62. +5 −5 tags.c
View
6 Changes
@@ -9,8 +9,10 @@ Bug fixes:
aborting on failing to call i_readgif_multi_wiol() or
i_readtiff_multi_wiol().
- - fix spelling errors patched by Debian (please report the issues you
- patch)
+ - fix spelling errors patched by Debian
+ http://svn.debian.org/viewsvn/pkg-perl/trunk/libimager-perl/debian/patches/spelling.patch?revision=54839&view=markup
+
+ - add an (unshipped) author test to spellcheck Imager's POD.
Imager 0.73 - 15 Mar 2010
===========
View
4 Flines/Flines.pm
@@ -4,7 +4,7 @@ use Imager;
use vars qw($VERSION @ISA);
BEGIN {
- $VERSION = "0.01";
+ $VERSION = "0.02";
eval {
require XSLoader;
@@ -39,7 +39,7 @@ Imager::Filter::Flines - dim alternate lines to emulate a video display
=head1 DESCRIPTION
-This is an adaption of the flines dynamically loadable filter
+This is an adaption of the C<flines> dynamically loadable filter
provided in dynfilt/ in previous releases of Imager.
This filter has no parameters.
View
37 Imager.pm
@@ -4038,7 +4038,7 @@ C<transform()>, C<transform2()> and C<matrix_transform()>.
=item *
L<Imager::Filters> - Filters, sharpen, blur, noise, convolve etc. and
-filter plugins.
+filter plug-ins.
=item *
@@ -4091,11 +4091,11 @@ This example creates a completely black image of width 400 and height
=head1 ERROR HANDLING
In general a method will return false when it fails, if it does use
-the errstr() method to find out why:
+the C<errstr()> method to find out why:
=over
-=item errstr
+=item C<errstr>
Returns the last error message in that context.
@@ -4158,7 +4158,7 @@ image
crop() - L<Imager::Transformations/crop> - extract part of an image
def_guess_type() - L<Imager::Files/def_guess_type> - default function
-used to guess the output file format based on the output filename
+used to guess the output file format based on the output file name
deltag() - L<Imager::ImageTypes/deltag> - delete image tags
@@ -4203,10 +4203,10 @@ getpixel() - L<Imager::Draw/getpixel> - retrieve one or more pixel
colors
getsamples() - L<Imager::Draw/getsamples> - retrieve samples from a
-row or subrow of pixels.
+row or partial row of pixels.
getscanline() - L<Imager::Draw/getscanline> - retrieve colors for a
-row or subrow of pixels.
+row or partial row of pixels.
getwidth() - L<Imager::ImageTypes/getwidth> - width of the image in
pixels.
@@ -4217,8 +4217,8 @@ for a new image.
init() - L<Imager::ImageTypes/init>
is_bilevel() - L<Imager::ImageTypes/is_bilevel> - returns whether
-image write functions should write the image in their bi-level (blank
-and white, no grey levels) format
+image write functions should write the image in their bilevel (blank
+and white, no gray levels) format
line() - L<Imager::Draw/line> - draw an interval
@@ -4249,6 +4249,8 @@ NF() - L<Imager::Handy/NF>
open() - L<Imager::Files> - an alias for read()
+=for stopwords IPTC
+
parseiptc() - L<Imager::Files/parseiptc> - parse IPTC data from a JPEG
image
@@ -4407,7 +4409,7 @@ gradient fill - L<Imager::Fill/"Fountain fills">,
L<Imager::Filters/fountain>, L<Imager::Fountain>,
L<Imager::Filters/gradgen>
-grayscale, convert image to - L<Imager::Transformations/convert>
+gray scale, convert image to - L<Imager::Transformations/convert>
guassian blur - L<Imager::Filters/guassian>
@@ -4442,11 +4444,13 @@ L<Imager::Transformations/rubthrough>
pseudo-color image - L<Imager::ImageTypes/to_paletted>,
L<Imager::ImageTypes/new>
+=for stopwords posterize
+
posterize - L<Imager::Filters/postlevels>
-png files - L<Imager::Files>, L<Imager::Files/"PNG">
+PNG files - L<Imager::Files>, L<Imager::Files/"PNG">
-pnm - L<Imager::Files/"PNM (Portable aNy Map)">
+PNM - L<Imager::Files/"PNM (Portable aNy Map)">
rectangles, drawing - L<Imager::Draw/box>
@@ -4479,6 +4483,8 @@ text, measuring - L<Imager::Font/bounding_box>, L<Imager::Font::BBox>
tiles, color - L<Imager::Filters/mosaic>
+=for stopwords unsharp
+
unsharp mask - L<Imager::Filters/unsharpmask>
watermark - L<Imager::Filters/watermark>
@@ -4550,11 +4556,14 @@ at CPAN Ratings:
http://cpanratings.perl.org/dist/Imager
-This requires a Bitcard Account (http://www.bitcard.org).
+=for stopwords Bitcard
+
+This requires a Bitcard account (http://www.bitcard.org).
You can also send email to the maintainer below.
-If you send me a bug report via email, it will be copied to RT.
+If you send me a bug report via email, it will be copied to Request
+Tracker.
=head2 Patches
@@ -4571,7 +4580,7 @@ Tony Cook <tony@imager.perl.org> is the current maintainer for Imager.
Arnar M. Hrafnkelsson is the original author of Imager.
-Many others have contributed to Imager, please see the README for a
+Many others have contributed to Imager, please see the C<README> for a
complete list.
=head1 SEE ALSO
View
14 Mandelbrot/Mandelbrot.pm
@@ -4,7 +4,7 @@ use Imager;
use vars qw($VERSION @ISA);
BEGIN {
- $VERSION = "0.01";
+ $VERSION = "0.02";
eval {
require XSLoader;
@@ -56,25 +56,25 @@ Imager::Filter::Mandelbrot - filter that renders the Mandelbrot set.
=head1 DESCRIPTION
-This is a expansion of the mandelbrot dynamically loadable filter
-provided in dynfilt in previous releases of Imager.
+This is a expansion of the C<mandelbrot> dynamically loadable filter
+provided in C<dynfilt> in previous releases of Imager.
Valid filter parameters are:
=over
=item *
-minx, maxx - the range of x values to render. Defaults: -2.5, 1.5.
+C<minx>, C<maxx> - the range of x values to render. Defaults: -2.5, 1.5.
=item *
-miny, maxy - the range of y values to render. Defaults: -1.5, 1.5
+C<miny>, C<maxy> - the range of y values to render. Defaults: -1.5, 1.5
=item *
-maxiter - the maximum number of iterations to perform when checking if
-the sequence tend towards infinity.
+C<maxiter> - the maximum number of iterations to perform when checking
+if the sequence tend towards infinity.
=back
View
68 draw.c
@@ -346,7 +346,7 @@ arc_poly(int *count, double **xvals, double **yvals,
=category Drawing
=synopsis i_arc_aa(im, 50, 50, 35, 90, 135, &color);
-Antialias fills an arc centered at (x,y) with radius I<rad> covering
+Anti-alias fills an arc centered at (x,y) with radius I<rad> covering
the range of angles in degrees from d1 to d2, with the color.
=cut
@@ -372,7 +372,7 @@ i_arc_aa(i_img *im, double x, double y, double rad, double d1, double d2,
=category Drawing
=synopsis i_arc_aa_cfill(im, 50, 50, 35, 90, 135, fill);
-Antialias fills an arc centered at (x,y) with radius I<rad> covering
+Anti-alias fills an arc centered at (x,y) with radius I<rad> covering
the range of angles in degrees from d1 to d2, with the fill object.
=cut
@@ -478,7 +478,7 @@ i_pixel_coverage(i_mmarray *dot, int x, int y) {
=category Drawing
=synopsis i_circle_aa(im, 50, 50, 45, &color);
-Antialias fills a circle centered at (x,y) for radius I<rad> with
+Anti-alias fills a circle centered at (x,y) for radius I<rad> with
color.
=cut
@@ -1118,19 +1118,21 @@ i_box_cfill(i_img *im,int x1,int y1,int x2,int y2,i_fill_t *fill) {
}
/*
-=item i_line(im, x1, y1, x2, y2, val, endp)
+=item i_line(C<im>, C<x1>, C<y1>, C<x2>, C<y2>, C<color>, C<endp>)
=category Drawing
-Draw a line to image using bresenhams linedrawing algorithm
+=for stopwords Bresenham's
- im - image to draw to
- x1 - starting x coordinate
- y1 - starting x coordinate
- x2 - starting x coordinate
- y2 - starting x coordinate
- val - color to write to image
- endp - endpoint flag (boolean)
+Draw a line to image using Bresenham's line drawing algorithm
+
+ im - image to draw to
+ x1 - starting x coordinate
+ y1 - starting x coordinate
+ x2 - starting x coordinate
+ y2 - starting x coordinate
+ color - color to write to image
+ endp - endpoint flag (boolean)
=cut
*/
@@ -1238,13 +1240,13 @@ i_line_dda(i_img *im, int x1, int y1, int x2, int y2, i_color *val) {
}
/*
-=item i_line_aa(im, x1, x2, y1, y2, color, endp)
+=item i_line_aa(C<im>, C<x1>, C<x2>, C<y1>, C<y2>, C<color>, C<endp>)
=category Drawing
-Antialias draws a line from (x1,y1) to (x2, y2) in color.
+Anti-alias draws a line from (x1,y1) to (x2, y2) in color.
-The point (x2, y2) is drawn only if endp is set.
+The point (x2, y2) is drawn only if C<endp> is set.
=cut
*/
@@ -1687,15 +1689,15 @@ i_flood_fill_low(i_img *im,int seedx,int seedy,
}
/*
-=item i_flood_fill(im, seedx, seedy, color)
+=item i_flood_fill(C<im>, C<seedx>, C<seedy>, C<color>)
=category Drawing
=synopsis i_flood_fill(im, 50, 50, &color);
-Flood fills the 4-connected region starting from the point (seedx,
-seedy) with I<color>.
+Flood fills the 4-connected region starting from the point (C<seedx>,
+C<seedy>) with I<color>.
-Returns false if (seedx, seedy) are outside the image.
+Returns false if (C<seedx>, C<seedy>) are outside the image.
=cut
*/
@@ -1729,15 +1731,15 @@ i_flood_fill(i_img *im, int seedx, int seedy, const i_color *dcol) {
}
/*
-=item i_flood_cfill(im, seedx, seedy, fill)
+=item i_flood_cfill(C<im>, C<seedx>, C<seedy>, C<fill>)
=category Drawing
=synopsis i_flood_cfill(im, 50, 50, fill);
-Flood fills the 4-connected region starting from the point (seedx,
-seedy) with I<fill>.
+Flood fills the 4-connected region starting from the point (C<seedx>,
+C<seedy>) with C<fill>.
-Returns false if (seedx, seedy) are outside the image.
+Returns false if (C<seedx>, C<seedy>) are outside the image.
=cut
*/
@@ -1769,16 +1771,16 @@ i_flood_cfill(i_img *im, int seedx, int seedy, i_fill_t *fill) {
}
/*
-=item i_flood_fill_border(im, seedx, seedy, color, border)
+=item i_flood_fill_border(C<im>, C<seedx>, C<seedy>, C<color>, C<border>)
=category Drawing
=synopsis i_flood_fill_border(im, 50, 50, &color, &border);
-Flood fills the 4-connected region starting from the point (seedx,
-seedy) with I<color>, fill stops when the fill reaches a pixels with
-color I<border>.
+Flood fills the 4-connected region starting from the point (C<seedx>,
+C<seedy>) with C<color>, fill stops when the fill reaches a pixels
+with color C<border>.
-Returns false if (seedx, seedy) are outside the image.
+Returns false if (C<seedx>, C<seedy>) are outside the image.
=cut
*/
@@ -1809,16 +1811,16 @@ i_flood_fill_border(i_img *im, int seedx, int seedy, const i_color *dcol,
}
/*
-=item i_flood_cfill_border(im, seedx, seedy, fill, border)
+=item i_flood_cfill_border(C<im>, C<seedx>, C<seedy>, C<fill>, C<border>)
=category Drawing
=synopsis i_flood_cfill_border(im, 50, 50, fill, border);
-Flood fills the 4-connected region starting from the point (seedx,
-seedy) with I<fill>, the fill stops when it reaches pixels of color
-I<border>.
+Flood fills the 4-connected region starting from the point (C<seedx>,
+C<seedy>) with C<fill>, the fill stops when it reaches pixels of color
+C<border>.
-Returns false if (seedx, seedy) are outside the image.
+Returns false if (C<seedx>, C<seedy>) are outside the image.
=cut
*/
View
6 error.c
@@ -188,7 +188,7 @@ the mark.
Clears the error stack.
-Called by any imager function before doing any other processing.
+Called by any Imager function before doing any other processing.
=cut
*/
@@ -247,7 +247,7 @@ void i_push_error(int code, char const *msg) {
}
/*
-=item i_push_errorvf(int code, char const *fmt, va_list ap)
+=item i_push_errorvf(int C<code>, char const *C<fmt>, va_list C<ap>)
=category Error handling
@@ -277,7 +277,7 @@ void i_push_errorvf(int code, char const *fmt, va_list ap) {
=synopsis i_push_errorf(errno, "Cannot open file %s: %d", filename, errno);
=category Error handling
-A version of i_push_error() that does printf() like formating.
+A version of i_push_error() that does printf() like formatting.
Does not support perl specific format codes.
View
36 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
*/
View
2 filters.im
@@ -1725,7 +1725,7 @@ fount_fill_proto =
/*
-=item i_new_fill_fount(xa, ya, xb, yb, type, repeat, combine, super_sample, ssample_param, count, segs)
+=item i_new_fill_fount(C<xa>, C<ya>, C<xb>, C<yb>, C<type>, C<repeat>, C<combine>, C<super_sample>, C<ssample_param>, C<count>, C<segs>)
=category Fills
=synopsis fill = i_new_fill_fount(0, 0, 100, 100, i_ft_linear, i_ft_linear,
View
38 image.c
@@ -86,10 +86,10 @@ i_img_alloc(void) {
}
/*
-=item i_img_init(img)
+=item i_img_init(C<img>)
=category Image Implementation
-Imager interal initialization of images.
+Imager internal initialization of images.
Currently this does very little, in the future it may be used to
support threads, or color profiles.
@@ -479,7 +479,7 @@ i_img_exorcise(i_img *im) {
}
/*
-=item i_img_destroy(img)
+=item i_img_destroy(C<img>)
=order 90
=category Image creation/destruction
=synopsis i_img_destroy(img)
@@ -536,12 +536,12 @@ i_img_info(i_img *im,int *info) {
}
/*
-=item i_img_setmask(im, ch_mask)
+=item i_img_setmask(C<im>, C<ch_mask>)
=category Image Information
=synopsis // only channel 0 writeable
=synopsis i_img_setmask(img, 0x01);
-Set the image channel mask for I<im> to I<ch_mask>.
+Set the image channel mask for C<im> to C<ch_mask>.
The image channel mask gives some control over which channels can be
written to in the image.
@@ -553,31 +553,31 @@ i_img_setmask(i_img *im,int ch_mask) { im->ch_mask=ch_mask; }
/*
-=item i_img_getmask(im)
+=item i_img_getmask(C<im>)
=category Image Information
=synopsis int mask = i_img_getmask(img);
-Get the image channel mask for I<im>.
+Get the image channel mask for C<im>.
=cut
*/
int
i_img_getmask(i_img *im) { return im->ch_mask; }
/*
-=item i_img_getchannels(im)
+=item i_img_getchannels(C<im>)
=category Image Information
=synopsis int channels = i_img_getchannels(img);
-Get the number of channels in I<im>.
+Get the number of channels in C<im>.
=cut
*/
int
i_img_getchannels(i_img *im) { return im->channels; }
/*
-=item i_img_get_width(im)
+=item i_img_get_width(C<im>)
=category Image Information
=synopsis i_img_dim width = i_img_get_width(im);
@@ -591,7 +591,7 @@ i_img_get_width(i_img *im) {
}
/*
-=item i_img_get_height(im)
+=item i_img_get_height(C<im>)
=category Image Information
=synopsis i_img_dim height = i_img_get_height(im);
@@ -605,13 +605,13 @@ i_img_get_height(i_img *im) {
}
/*
-=item i_copyto_trans(im, src, x1, y1, x2, y2, tx, ty, trans)
+=item i_copyto_trans(C<im>, C<src>, C<x1>, C<y1>, C<x2>, C<y2>, C<tx>, C<ty>, C<trans>)
=category Image
-(x1,y1) (x2,y2) specifies the region to copy (in the source coordinates)
-(tx,ty) specifies the upper left corner for the target image.
-pass NULL in trans for non transparent i_colors.
+(C<x1>,C<y1>) (C<x2>,C<y2>) specifies the region to copy (in the
+source coordinates) (C<tx>,C<ty>) specifies the upper left corner for
+the target image. pass NULL in C<trans> for non transparent i_colors.
=cut
*/
@@ -647,11 +647,11 @@ i_copyto_trans(i_img *im,i_img *src,int x1,int y1,int x2,int y2,int tx,int ty,co
}
/*
-=item i_copy(src)
+=item i_copy(source)
=category Image
-Creates a new image that is a copy of src.
+Creates a new image that is a copy of the image C<source>.
Tags are not copied, only the image data.
@@ -916,7 +916,7 @@ i_scale_nn(i_img *im, float scx, float scy) {
}
/*
-=item i_sametype(i_img *im, int xsize, int ysize)
+=item i_sametype(C<im>, C<xsize>, C<ysize>)
=category Image creation/destruction
=synopsis i_img *img = i_sametype(src, width, height);
@@ -959,7 +959,7 @@ i_img *i_sametype(i_img *src, int xsize, int ysize) {
}
/*
-=item i_sametype_chans(i_img *im, int xsize, int ysize, int channels)
+=item i_sametype_chans(C<im>, C<xsize>, C<ysize>, C<channels>)
=category Image creation/destruction
=synopsis i_img *img = i_sametype_chans(src, width, height, channels);
View
35 imdatatypes.h
@@ -40,20 +40,21 @@ i_color is a union of:
=item *
-gray - contains a single element gray_color, eg. c.gray.gray_color
+gray - contains a single element gray_color, eg. C<c.gray.gray_color>
=item *
-rgb - contains three elements r, g, b, eg. c.rgb.r
+C<rgb> - contains three elements C<r>, C<g>, C<b>, eg. C<c.rgb.r>
=item *
-rgba - contains four elements r, g, b, a, eg. c.rgba.a
+C<rgba> - contains four elements C<r>, C<g>, C<b>, C<a>, eg. C<c.rgba.a>
=item *
-cmyk - contains four elements c, m, y, k, eg. C<c.cmyk.y>. Note that
-Imager never uses CMYK colors except when reading/writing files.
+C<cmyk> - contains four elements C<c>, C<m>, C<y>, C<k>,
+eg. C<c.cmyk.y>. Note that Imager never uses CMYK colors except when
+reading/writing files.
=item *
@@ -188,57 +189,57 @@ It contains the following members:
=item *
-channels - the number of channels in the image
+C<channels> - the number of channels in the image
=item *
-xsize, ysize - the width and height of the image in pixels
+C<xsize>, C<ysize> - the width and height of the image in pixels
=item *
-bytes - the number of bytes used to store the image data. Undefined
+C<bytes> - the number of bytes used to store the image data. Undefined
where virtual is non-zero.
=item *
-ch_mask - a mask of writable channels. eg. if this is 6 then only
+C<ch_mask> - a mask of writable channels. eg. if this is 6 then only
channels 1 and 2 are writable. There may be bits set for which there
are no channels in the image.
=item *
-bits - the number of bits stored per sample. Should be one of
+C<bits> - the number of bits stored per sample. Should be one of
i_8_bits, i_16_bits, i_double_bits.
=item *
-type - either i_direct_type for direct color images, or i_palette_type
+C<type> - either i_direct_type for direct color images, or i_palette_type
for paletted images.
=item *
-virtual - if zero then this image is-self contained. If non-zero then
-this image could be an interface to some other implementation.
+C<virtual> - if zero then this image is-self contained. If non-zero
+then this image could be an interface to some other implementation.
=item *
-idata - the image data. This should not be directly accessed. A new
+C<idata> - the image data. This should not be directly accessed. A new
image implementation can use this to store its image data.
i_img_destroy() will myfree() this pointer if it's non-null.
=item *
-tags - a structure storing the image's tags. This should only be
+C<tags> - a structure storing the image's tags. This should only be
accessed via the i_tags_*() functions.
=item *
-ext_data - a pointer for use internal to an image implementation.
+C<ext_data> - a pointer for use internal to an image implementation.
This should be freed by the image's destroy handler.
=item *
-im_data - data internal to Imager. This is initialized by
+C<im_data> - data internal to Imager. This is initialized by
i_img_init().
=item *
View
62 imext.c
@@ -148,11 +148,11 @@ int
}
/*
-=item i_gpix(im, x, y, color)
+=item i_gpix(im, C<x>, C<y>, C<color>)
=category Drawing
-Retrieves the I<color> of the pixel (x,y).
+Retrieves the C<color> of the pixel (x,y).
Returns 0 if the pixel was retrieved, or -1 if not.
@@ -165,11 +165,11 @@ int
}
/*
-=item i_ppixf(im, x, y, fcolor)
+=item i_ppixf(im, C<x>, C<y>, C<fcolor>)
=category Drawing
-Sets the pixel at (x,y) to the floating point color I<fcolor>.
+Sets the pixel at (C<x>,C<y>) to the floating point color C<fcolor>.
Returns 0 if the pixel was drawn, or -1 if not.
@@ -184,12 +184,12 @@ int
}
/*
-=item i_gpixf(im, x, y, fcolor)
+=item i_gpixf(im, C<x>, C<y>, C<fcolor>)
=category Drawing
Retrieves the color of the pixel (x,y) as a floating point color into
-I<fcolor>.
+C<fcolor>.
Returns 0 if the pixel was retrieved, or -1 if not.
@@ -237,12 +237,12 @@ int
}
/*
-=item i_plinf(im, l, r, fcolors)
+=item i_plinf(im, C<left>, C<right>, C<fcolors>)
=category Drawing
-Sets (r-l) pixels starting from (l,y) using (r-l) floating point
-colors from I<colors>.
+Sets (right-left) pixels starting from (left,y) using (right-left)
+floating point colors from C<fcolors>.
Returns the number of pixels set.
@@ -273,19 +273,19 @@ int
}
/*
-=item i_gsamp(im, l, r, y, samp, chans, chan_count)
+=item i_gsamp(im, left, right, y, samples, channels, channel_count)
=category Drawing
-Reads sample values from im for the horizontal line (l, y) to (r-1,y)
-for the channels specified by chans, an array of int with chan_count
-elements.
+Reads sample values from C<im> for the horizontal line (left, y) to
+(right-1,y) for the channels specified by C<channels>, an array of int
+with C<channel_count> elements.
-If chans is NULL then the first chan_count channels are retrieved for
+If channels is NULL then the first channels_count channels are retrieved for
each pixel.
-Returns the number of samples read (which should be (r-l) *
-chan_count)
+Returns the number of samples read (which should be (right-left) *
+channel_count)
=cut
*/
@@ -296,19 +296,19 @@ int
}
/*
-=item i_gsampf(im, l, r, y, samp, chans, chan_count)
+=item i_gsampf(im, left, right, y, samples, channels, channel_count)
=category Drawing
-Reads floating point sample values from im for the horizontal line (l,
-y) to (r-1,y) for the channels specified by chans, an array of int
-with chan_count elements.
+Reads floating point sample values from C<im> for the horizontal line
+(left, y) to (right-1,y) for the channels specified by C<channels>, an
+array of int with channel_count elements.
-If chans is NULL then the first chan_count channels are retrieved for
-each pixel.
+If C<channels> is NULL then the first C<channel_count> channels are
+retrieved for each pixel.
-Returns the number of samples read (which should be (r-l) *
-chan_count)
+Returns the number of samples read (which should be (C<right>-C<left>)
+* C<channel_count>)
=cut
*/
@@ -319,12 +319,12 @@ int
}
/*
-=item i_gpal(im, x, r, y, indexes)
+=item i_gpal(im, left, right, y, indexes)
=category Drawing
-Reads palette indexes for the horizontal line (x, y) to (r-1, y) into
-indexes.
+Reads palette indexes for the horizontal line (left, y) to (right-1,
+y) into C<indexes>.
Returns the number of indexes read.
@@ -338,12 +338,12 @@ int
}
/*
-=item i_ppal(im, x, r, y, indexes)
+=item i_ppal(im, left, right, y, indexes)
=category Drawing
-Writes palette indexes for the horizontal line (x, y) to (r-1, y) from
-indexes.
+Writes palette indexes for the horizontal line (left, y) to (right-1,
+y) from C<indexes>.
Returns the number of indexes written.
@@ -464,7 +464,7 @@ int
Sets I<count> colors starting from I<index> in the image's palette.
-On sucess returns true.
+On success returns true.
On failure returns false.
View
4 immacros.h
@@ -7,7 +7,7 @@
#define IMAGER_IMMACROS_H_
/*
-=item i_img_has_alpha(im)
+=item i_img_has_alpha(C<im>)
=category Image Information
@@ -19,7 +19,7 @@ Return true if the image has an alpha channel.
#define i_img_has_alpha(im) ((im)->channels == 2 || (im)->channels == 4)
/*
-=item i_img_color_channels(im)
+=item i_img_color_channels(C<im>)
=category Image Information
View
43 lib/Imager/API.pod
@@ -19,6 +19,8 @@ Imager::API - Imager's C API - introduction.
=head1 DESCRIPTION
+=for stopwords XS
+
The API allows you to access Imager functions at the C level from XS
and from Inline::C.
@@ -38,7 +40,7 @@ core Imager object, for example, Imager::SDL.
=item *
-write C code that hooks into Imagers existing methods, such as filter
+write C code that hooks into Imager's existing methods, such as filter
or file format handlers.
=back
@@ -86,15 +88,16 @@ font functions are not visible through Imager's API.
=head2 i_img - images
-This contains the dimensions of the image (xsize, ysize, channels),
-image metadata (ch_mask, bits, type, virtual), potentially image data
-(idata) and the a function table, with pointers to functions to
-perform various low level image operations.
+This contains the dimensions of the image (C<xsize>, C<ysize>,
+C<channels>), image metadata (C<ch_mask>, C<bits>, C<type>,
+C<virtual>), potentially image data (C<idata>) and the a function
+table, with pointers to functions to perform various low level image
+operations.
The only time you should directly write to any value in this type is
if you're implementing your own image type.
-The typemap includes typenames Imager and Imager::ImgRaw as typedefs
+The typemap includes type names Imager and Imager::ImgRaw as typedefs
for C<i_img *>.
For incoming parameters the typemap will accept either Imager or
@@ -104,7 +107,7 @@ For return values the typemap will produce a full Imager object for an
Imager return type and a raw image object for an Imager::ImgRaw return
type.
-=head2 i_color - 8-bit color
+=head2 C<i_color> - 8-bit color
Represents an 8-bit per sample color. This is a union containing
several different structs for access to components of a color:
@@ -113,32 +116,32 @@ several different structs for access to components of a color:
=item *
-gray - single member gray_color.
+C<gray> - single member C<gray_color>.
=item *
-rgb - r, g, b members.
+C<rgb> - C<r>, C<g>, C<b> members.
=item *
-rgba - r, g, b, a members.
+C<rgba> - C<r>, C<g>, C<b>, C<a> members.
=item *
-channels - array of channels.
+C<channels> - array of channels.
=back
Use Imager::Color for parameter and return value types.
-=head2 i_fcolor - floating point color
+=head2 C<i_fcolor> - floating point color
-Similar to i_color except that each component is a double instead of
+Similar to C<i_color> except that each component is a double instead of
an unsigned char.
Use Imager::Color::Float for parameter and return value types.
-=head2 i_fill_t - fill objects
+=head2 C<i_fill_t> - fill objects
Abstract type containing pointers called to perform low level fill
operations.
@@ -160,7 +163,7 @@ Load Imager:
and bootstrap your XS code - see L<XSLoader> or L<DynaLoader>.
-=head2 Foo.xs
+=head2 C<Foo.xs>
You'll need the following in your XS source:
@@ -181,7 +184,7 @@ create the variables used to hold the callback table:
=item *
-initialize the callback table in your BOOT code:
+initialize the callback table in your C<BOOT> code:
BOOT:
PERL_INITIALIZE_IMAGER_CALLBACKS;
@@ -203,10 +206,10 @@ include the Imager external API header:
=back
-=head2 Makefile.PL
+=head2 C<Makefile.PL>
If you're creating an XS module that depends on Imager's API your
-Makefile.PL will need to do the following:
+C<Makefile.PL> will need to do the following:
=over
@@ -237,8 +240,8 @@ include Imager 0.48 as a PREREQ_PM:
=item *
-Since you use Imager::ExtUtils in Makefile.PL (or Build.PL) you should
-include Imager in your configure_requires:
+Since you use Imager::ExtUtils in C<Makefile.PL> (or C<Build.PL>) you
+should include Imager in your configure_requires:
META_MERGE =>
{
View
314 lib/Imager/APIRef.pod
@@ -104,57 +104,57 @@ It contains the following members:
=item *
-channels - the number of channels in the image
+C<channels> - the number of channels in the image
=item *
-xsize, ysize - the width and height of the image in pixels
+C<xsize>, C<ysize> - the width and height of the image in pixels
=item *
-bytes - the number of bytes used to store the image data. Undefined
+C<bytes> - the number of bytes used to store the image data. Undefined
where virtual is non-zero.
=item *
-ch_mask - a mask of writable channels. eg. if this is 6 then only
+C<ch_mask> - a mask of writable channels. eg. if this is 6 then only
channels 1 and 2 are writable. There may be bits set for which there
are no channels in the image.
=item *
-bits - the number of bits stored per sample. Should be one of
+C<bits> - the number of bits stored per sample. Should be one of
i_8_bits, i_16_bits, i_double_bits.
=item *
-type - either i_direct_type for direct color images, or i_palette_type
+C<type> - either i_direct_type for direct color images, or i_palette_type
for paletted images.
=item *
-virtual - if zero then this image is-self contained. If non-zero then
-this image could be an interface to some other implementation.
+C<virtual> - if zero then this image is-self contained. If non-zero
+then this image could be an interface to some other implementation.
=item *
-idata - the image data. This should not be directly accessed. A new
+C<idata> - the image data. This should not be directly accessed. A new
image implementation can use this to store its image data.
i_img_destroy() will myfree() this pointer if it's non-null.
=item *
-tags - a structure storing the image's tags. This should only be
+C<tags> - a structure storing the image's tags. This should only be
accessed via the i_tags_*() functions.
=item *
-ext_data - a pointer for use internal to an image implementation.
+C<ext_data> - a pointer for use internal to an image implementation.
This should be freed by the image's destroy handler.
=item *
-im_data - data internal to Imager. This is initialized by
+C<im_data> - data internal to Imager. This is initialized by
i_img_init().
=item *
@@ -203,20 +203,21 @@ i_color is a union of:
=item *
-gray - contains a single element gray_color, eg. c.gray.gray_color
+gray - contains a single element gray_color, eg. C<c.gray.gray_color>
=item *
-rgb - contains three elements r, g, b, eg. c.rgb.r
+C<rgb> - contains three elements C<r>, C<g>, C<b>, eg. C<c.rgb.r>
=item *
-rgba - contains four elements r, g, b, a, eg. c.rgba.a
+C<rgba> - contains four elements C<r>, C<g>, C<b>, C<a>, eg. C<c.rgba.a>
=item *
-cmyk - contains four elements c, m, y, k, eg. C<c.cmyk.y>. Note that
-Imager never uses CMYK colors except when reading/writing files.
+C<cmyk> - contains four elements C<c>, C<m>, C<y>, C<k>,
+eg. C<c.cmyk.y>. Note that Imager never uses CMYK colors except when
+reading/writing files.
=item *
@@ -279,7 +280,7 @@ From: File draw.c
=item i_arc_aa(im, x, y, rad, d1, d2, color)
-Antialias fills an arc centered at (x,y) with radius I<rad> covering
+Anti-alias fills an arc centered at (x,y) with radius I<rad> covering
the range of angles in degrees from d1 to d2, with the color.
@@ -289,7 +290,7 @@ From: File draw.c
=item i_arc_aa_cfill(im, x, y, rad, d1, d2, fill)
-Antialias fills an arc centered at (x,y) with radius I<rad> covering
+Anti-alias fills an arc centered at (x,y) with radius I<rad> covering
the range of angles in degrees from d1 to d2, with the fill object.
@@ -336,58 +337,58 @@ From: File draw.c
=item i_circle_aa(im, x, y, rad, color)
-Antialias fills a circle centered at (x,y) for radius I<rad> with
+Anti-alias fills a circle centered at (x,y) for radius I<rad> with
color.
=for comment
From: File draw.c
-=item i_flood_cfill(im, seedx, seedy, fill)
+=item i_flood_cfill(C<im>, C<seedx>, C<seedy>, C<fill>)
-Flood fills the 4-connected region starting from the point (seedx,
-seedy) with I<fill>.
+Flood fills the 4-connected region starting from the point (C<seedx>,
+C<seedy>) with C<fill>.
-Returns false if (seedx, seedy) are outside the image.
+Returns false if (C<seedx>, C<seedy>) are outside the image.
=for comment
From: File draw.c
-=item i_flood_cfill_border(im, seedx, seedy, fill, border)
+=item i_flood_cfill_border(C<im>, C<seedx>, C<seedy>, C<fill>, C<border>)
-Flood fills the 4-connected region starting from the point (seedx,
-seedy) with I<fill>, the fill stops when it reaches pixels of color
-I<border>.
+Flood fills the 4-connected region starting from the point (C<seedx>,
+C<seedy>) with C<fill>, the fill stops when it reaches pixels of color
+C<border>.
-Returns false if (seedx, seedy) are outside the image.
+Returns false if (C<seedx>, C<seedy>) are outside the image.
=for comment
From: File draw.c
-=item i_flood_fill(im, seedx, seedy, color)
+=item i_flood_fill(C<im>, C<seedx>, C<seedy>, C<color>)
-Flood fills the 4-connected region starting from the point (seedx,
-seedy) with I<color>.
+Flood fills the 4-connected region starting from the point (C<seedx>,
+C<seedy>) with I<color>.
-Returns false if (seedx, seedy) are outside the image.
+Returns false if (C<seedx>, C<seedy>) are outside the image.
=for comment
From: File draw.c
-=item i_flood_fill_border(im, seedx, seedy, color, border)
+=item i_flood_fill_border(C<im>, C<seedx>, C<seedy>, C<color>, C<border>)
-Flood fills the 4-connected region starting from the point (seedx,
-seedy) with I<color>, fill stops when the fill reaches a pixels with
-color I<border>.
+Flood fills the 4-connected region starting from the point (C<seedx>,
+C<seedy>) with C<color>, fill stops when the fill reaches a pixels
+with color C<border>.
-Returns false if (seedx, seedy) are outside the image.
+Returns false if (C<seedx>, C<seedy>) are outside the image.
=for comment
@@ -416,11 +417,11 @@ Returns the number of pixels retrieved.
=for comment
From: File imext.c
-=item i_gpal(im, x, r, y, indexes)
+=item i_gpal(im, left, right, y, indexes)
-Reads palette indexes for the horizontal line (x, y) to (r-1, y) into
-indexes.
+Reads palette indexes for the horizontal line (left, y) to (right-1,
+y) into C<indexes>.
Returns the number of indexes read.
@@ -430,86 +431,88 @@ Always returns 0 for direct color images.
=for comment
From: File imext.c
-=item i_gpix(im, x, y, color)
+=item i_gpix(im, C<x>, C<y>, C<color>)
-Retrieves the I<color> of the pixel (x,y).
+Retrieves the C<color> of the pixel (x,y).
Returns 0 if the pixel was retrieved, or -1 if not.
=for comment
From: File imext.c
-=item i_gpixf(im, x, y, fcolor)
+=item i_gpixf(im, C<x>, C<y>, C<fcolor>)
Retrieves the color of the pixel (x,y) as a floating point color into
-I<fcolor>.
+C<fcolor>.
Returns 0 if the pixel was retrieved, or -1 if not.
=for comment
From: File imext.c
-=item i_gsamp(im, l, r, y, samp, chans, chan_count)
+=item i_gsamp(im, left, right, y, samples, channels, channel_count)
-Reads sample values from im for the horizontal line (l, y) to (r-1,y)
-for the channels specified by chans, an array of int with chan_count
-elements.
+Reads sample values from C<im> for the horizontal line (left, y) to
+(right-1,y) for the channels specified by C<channels>, an array of int
+with C<channel_count> elements.
-If chans is NULL then the first chan_count channels are retrieved for
+If channels is NULL then the first channels_count channels are retrieved for
each pixel.
-Returns the number of samples read (which should be (r-l) *
-chan_count)
+Returns the number of samples read (which should be (right-left) *
+channel_count)
=for comment
From: File imext.c
-=item i_gsampf(im, l, r, y, samp, chans, chan_count)
+=item i_gsampf(im, left, right, y, samples, channels, channel_count)
-Reads floating point sample values from im for the horizontal line (l,
-y) to (r-1,y) for the channels specified by chans, an array of int
-with chan_count elements.
+Reads floating point sample values from C<im> for the horizontal line
+(left, y) to (right-1,y) for the channels specified by C<channels>, an
+array of int with channel_count elements.
-If chans is NULL then the first chan_count channels are retrieved for
-each pixel.
+If C<channels> is NULL then the first C<channel_count> channels are
+retrieved for each pixel.
-Returns the number of samples read (which should be (r-l) *
-chan_count)
+Returns the number of samples read (which should be (C<right>-C<left>)
+* C<channel_count>)
=for comment
From: File imext.c
-=item i_line(im, x1, y1, x2, y2, val, endp)
+=item i_line(C<im>, C<x1>, C<y1>, C<x2>, C<y2>, C<color>, C<endp>)
+
+=for stopwords Bresenham's
-Draw a line to image using bresenhams linedrawing algorithm
+Draw a line to image using Bresenham's line drawing algorithm
- im - image to draw to
- x1 - starting x coordinate
- y1 - starting x coordinate
- x2 - starting x coordinate
- y2 - starting x coordinate
- val - color to write to image
- endp - endpoint flag (boolean)
+ im - image to draw to
+ x1 - starting x coordinate
+ y1 - starting x coordinate
+ x2 - starting x coordinate
+ y2 - starting x coordinate
+ color - color to write to image
+ endp - endpoint flag (boolean)
=for comment
From: File draw.c
-=item i_line_aa(im, x1, x2, y1, y2, color, endp)
+=item i_line_aa(C<im>, C<x1>, C<x2>, C<y1>, C<y2>, C<color>, C<endp>)
-Antialias draws a line from (x1,y1) to (x2, y2) in color.
+Anti-alias draws a line from (x1,y1) to (x2, y2) in color.
-The point (x2, y2) is drawn only if endp is set.
+The point (x2, y2) is drawn only if C<endp> is set.
=for comment
@@ -527,23 +530,23 @@ Returns the number of pixels set.
=for comment
From: File imext.c
-=item i_plinf(im, l, r, fcolors)
+=item i_plinf(im, C<left>, C<right>, C<fcolors>)
-Sets (r-l) pixels starting from (l,y) using (r-l) floating point
-colors from I<colors>.
+Sets (right-left) pixels starting from (left,y) using (right-left)
+floating point colors from C<fcolors>.
Returns the number of pixels set.
=for comment
From: File imext.c
-=item i_ppal(im, x, r, y, indexes)
+=item i_ppal(im, left, right, y, indexes)
-Writes palette indexes for the horizontal line (x, y) to (r-1, y) from
-indexes.
+Writes palette indexes for the horizontal line (left, y) to (right-1,
+y) from C<indexes>.
Returns the number of indexes written.
@@ -567,10 +570,10 @@ color to the image.
=for comment
From: File imext.c
-=item i_ppixf(im, x, y, fcolor)
+=item i_ppixf(im, C<x>, C<y>, C<fcolor>)
-Sets the pixel at (x,y) to the floating point color I<fcolor>.
+Sets the pixel at (C<x>,C<y>) to the floating point color C<fcolor>.
Returns 0 if the pixel was drawn, or -1 if not.
@@ -592,7 +595,7 @@ From: File imext.c
Clears the error stack.
-Called by any imager function before doing any other processing.
+Called by any Imager function before doing any other processing.
=for comment
@@ -612,15 +615,15 @@ From: File error.c
=item i_push_errorf(int code, char const *fmt, ...)
-A version of i_push_error() that does printf() like formating.
+A version of i_push_error() that does printf() like formatting.
Does not support perl specific format codes.
=for comment
From: File error.c
-=item i_push_errorvf(int code, char const *fmt, va_list ap)
+=item i_push_errorvf(int C<code>, char const *C<fmt>, va_list C<ap>)
Intended for use by higher level functions, takes a varargs pointer
@@ -687,7 +690,7 @@ From: File limits.c
=over
-=item i_new_fill_fount(xa, ya, xb, yb, type, repeat, combine, super_sample, ssample_param, count, segs)
+=item i_new_fill_fount(C<xa>, C<ya>, C<xb>, C<yb>, C<type>, C<repeat>, C<combine>, C<super_sample>, C<ssample_param>, C<count>, C<segs>)
@@ -697,50 +700,54 @@ Creates a new general fill which fills with a fountain fill.
=for comment
From: File filters.im
-=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>)
-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.
=for comment
From: File fills.c
-=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>)
-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.
=for comment
From: File fills.c
-=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>)
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.
=for comment
@@ -783,10 +790,10 @@ From: File fills.c
=over
-=item i_copy(src)
+=item i_copy(source)
-Creates a new image that is a copy of src.
+Creates a new image that is a copy of the image C<source>.
Tags are not copied, only the image data.
@@ -796,25 +803,26 @@ Returns: i_img *
=for comment
From: File image.c
-=item i_copyto(dest, src, x1, y1, x2, y2, tx, ty)
+=item i_copyto(C<dest>, C<src>, C<x1>, C<y1>, C<x2>, C<y2>, C<tx>, C<ty>)
-Copies image data from the area (x1,y1)-[x2,y2] in the source image to
-a rectangle the same size with it's top-left corner at (tx,ty) in the
-destination image.
+Copies image data from the area (C<x1>,C<y1>)-[C<x2>,C<y2>] in the
+source image to a rectangle the same size with it's top-left corner at
+(C<tx>,C<ty>) in the destination image.
-If x1 > x2 or y1 > y2 then the corresponding co-ordinates are swapped.
+If C<x1> > C<x2> or C<y1> > C<y2> then the corresponding co-ordinates
+are swapped.
=for comment
From: File paste.im
-=item i_copyto_trans(im, src, x1, y1, x2, y2, tx, ty, trans)
+=item i_copyto_trans(C<im>, C<src>, C<x1>, C<y1>, C<x2>, C<y2>, C<tx>, C<ty>, C<trans>)
-(x1,y1) (x2,y2) specifies the region to copy (in the source coordinates)
-(tx,ty) specifies the upper left corner for the target image.
-pass NULL in trans for non transparent i_colors.
+(C<x1>,C<y1>) (C<x2>,C<y2>) specifies the region to copy (in the
+source coordinates) (C<tx>,C<ty>) specifies the upper left corner for
+the target image. pass NULL in C<trans> for non transparent i_colors.
=for comment
@@ -839,15 +847,15 @@ info is an array of 4 integers with the following values:
=for comment
From: File image.c
-=item i_rubthru(im, src, tx, ty, src_minx, src_miny, src_maxx, src_maxy )
+=item i_rubthru(C<im>, C<src>, C<tx>, C<ty>, C<src_minx>, C<src_miny>, C<src_maxx>, C<src_maxy>)
-Takes the sub image I<src[src_minx, src_maxx)[src_miny, src_maxy)> and
-overlays it at (I<tx>,I<ty>) on the image object.
+Takes the sub image C<src>[C<src_minx>, C<src_maxx>)[C<src_miny>, C<src_maxy>)> and
+overlays it at (C<tx>,C<ty>) on the image object.
-The alpha channel of each pixel in I<src> is used to control how much
-the existing colour in I<im> is replaced, if it is 255 then the colour
-is completely replaced, if it is 0 then the original colour is left
+The alpha channel of each pixel in C<src> is used to control how much
+the existing color in C<im> is replaced, if it is 255 then the color
+is completely replaced, if it is 0 then the original color is left
unmodified.
@@ -891,20 +899,20 @@ Creates a new double per sample image.
=for comment
From: File imgdouble.c
-=item i_img_pal_new(x, y, channels, maxpal)
+=item i_img_pal_new(C<x>, C<y>, C<channels>, C<maxpal>)
Creates a new paletted image of the supplied dimensions.
-I<maxpal> is the maximum palette size and should normally be 256.
+C<maxpal> is the maximum palette size and should normally be 256.
Returns a new image or NULL on failure.
=for comment
From: File palimg.c
-=item i_sametype(i_img *im, int xsize, int ysize)
+=item i_sametype(C<im>, C<xsize>, C<ysize>)
Returns an image of the same type (sample size, channels, paletted/direct).
@@ -915,7 +923,7 @@ For paletted images the palette is copied from the source.
=for comment
From: File image.c
-=item i_sametype_chans(i_img *im, int xsize, int ysize, int channels)
+=item i_sametype_chans(C<im>, C<xsize>, C<ysize>, C<channels>)
Returns an image of the same type (sample size).
@@ -926,7 +934,7 @@ For paletted images the equivalent direct type is returned.
=for comment
From: File image.c
-=item i_img_destroy(img)
+=item i_img_destroy(C<img>)
Destroy an image object
@@ -970,9 +978,9 @@ object.
=for comment
From: File image.c
-=item i_img_init(img)
+=item i_img_init(C<img>)
-Imager interal initialization of images.
+Imager internal initialization of images.
Currently this does very little, in the future it may be used to
support threads, or color profiles.
@@ -988,7 +996,7 @@ From: File image.c
=over
-=item i_img_color_channels(im)
+=item i_img_color_channels(C<im>)
The number of channels holding color information.
@@ -997,39 +1005,39 @@ The number of channels holding color information.
=for comment
From: File immacros.h
-=item i_img_get_height(im)
+=item i_img_get_height(C<im>)
Returns the height in pixels of the image.
=for comment
From: File image.c
-=item i_img_get_width(im)
+=item i_img_get_width(C<im>)
Returns the width in pixels of the image.
=for comment
From: File image.c
-=item i_img_getchannels(im)
+=item i_img_getchannels(C<im>)
-Get the number of channels in I<im>.
+Get the number of channels in C<im>.
=for comment
From: File image.c
-=item i_img_getmask(im)
+=item i_img_getmask(C<im>)
-Get the image channel mask for I<im>.
+Get the image channel mask for C<im>.
=for comment
From: File image.c
-=item i_img_has_alpha(im)
+=item i_img_has_alpha(C<im>)
Return true if the image has an alpha channel.
@@ -1038,9 +1046,9 @@ Return true if the image has an alpha channel.
=for comment
From: File immacros.h
-=item i_img_setmask(im, ch_mask)
+=item i_img_setmask(C<im>, C<ch_mask>)
-Set the image channel mask for I<im> to I<ch_mask>.
+Set the image channel mask for C<im> to C<ch_mask>.
The image channel mask gives some control over which channels can be
written to in the image.
@@ -1056,24 +1064,24 @@ From: File image.c
=over
-=item i_quant_makemap(quant, imgs, count)
+=item i_quant_makemap(C<quant>, C<imgs>, C<count>)
-Analyzes the I<count> images in I<imgs> according to the rules in
-I<quant> to build a color map (optimal or not depending on
-quant->make_colors).
+Analyzes the C<count> images in C<imgs> according to the rules in
+C<quant> to build a color map (optimal or not depending on
+C<< quant->make_colors >>).
=for comment
From: File quant.c
-=item i_quant_translate(quant, img)
+=item i_quant_translate(C<quant>, C<img>)
-Quantize the image given the palette in quant.
+Quantize the image given the palette in C<quant>.
-On success returns a pointer to a memory block of img->xsize *
-img->ysize i_palidx entries.
+On success returns a pointer to a memory block of C<< img->xsize *
+img->ysize >> C<i_palidx> entries.
On failure returns NULL.
@@ -1086,13 +1094,13 @@ This function will fail if the supplied palette contains no colors.
=for comment
From: File quant.c
-=item i_quant_transparent(quant, data, img, trans_index)
+=item i_quant_transparent(C<quant>, C<data>, C<img>, C<trans_index>)
-Dither the alpha channel on I<img> into the palette indexes in
-I<data>. Pixels to be transparent are replaced with I<trans_pixel>.
+Dither the alpha channel on C<img> into the palette indexes in
+C<data>. Pixels to be transparent are replaced with C<trans_pixel>.
-The method used depends on the tr_* members of quant.
+The method used depends on the tr_* members of C<quant>.
=for comment
@@ -1217,7 +1225,7 @@ From: File imext.c
Sets I<count> colors starting from I<index> in the image's palette.
-On sucess returns true.
+On success returns true.
On failure returns false.
@@ -1282,7 +1290,7 @@ From: File tags.c
=item i_tags_find(tags, name, start, &entry)
-Searchs for a tag of the given I<name> starting from index I<start>.
+Searches for a tag of the given I<name> starting from index I<start>.
On success returns true and sets *I<entry>.
@@ -1295,7 +1303,7 @@ From: File tags.c
=item i_tags_findn(tags, code, start, &entry)
-Searchs for a tag of the given I<code> starting from index I<start>.
+Searches for a tag of the given I<code> starting from index I<start>.
On success returns true and sets *I<entry>.
@@ -1360,7 +1368,7 @@ On failure returns false.
value_size must be at least large enough for a string representation
of an integer.
-The copied value is always NUL terminated.
+The copied value is always C<NUL> terminated.
=for comment
@@ -1425,11 +1433,11 @@ storage at the precision specified by C<places>.
=for comment
From: File tags.c
-=item i_tags_setn(tags, name, idata)
+=item i_tags_setn(C<tags>, C<name>, C<idata>)
-Sets the given tag to the integer I<idata>
+Sets the given tag to the integer C<idata>
-Even on failure, if an existing tag I<name> exists, it will be
+Even on failure, if an existing tag C<name> exists, it will be
removed.
View
69 lib/Imager/Color.pm
@@ -4,7 +4,7 @@ use Imager;
use strict;
use vars qw($VERSION);
-$VERSION = "1.010";
+$VERSION = "1.011";
# It's just a front end to the XS creation functions.
@@ -397,9 +397,9 @@ Imager::Color - Color handling for Imager.
=head1 DESCRIPTION
-This module handles creating color objects used by imager. The idea is
-that in the future this module will be able to handle colorspace calculations
-as well.
+This module handles creating color objects used by Imager. The idea
+is that in the future this module will be able to handle color space
+calculations as well.
An Imager color consists of up to four components, each in the range 0
to 255. Unfortunately the meaning of the components can change
@@ -435,13 +435,14 @@ This creates a color object to pass to functions that need a color argument.
This changes an already defined color. Note that this does not affect any places
where the color has been used previously.
-=item rgba
+=item rgba()
-This returns the rgba code of the color the object contains.
+This returns the red, green, blue and alpha channels of the color the
+object contains.
=item info
-Calling info merely dumps the relevant colorcode to the log.
+Calling info merely dumps the relevant color to the log.
=item equals(other=>$other_color)
@@ -466,20 +467,20 @@ simple numeric parameters - if you supply 3 or 4 numeric arguments, you get a co
=item *
-a six hex digit web color, either 'RRGGBB' or '#RRGGBB'
+a six hex digit web color, either C<RRGGBB> or C<#RRGGBB>
=item *
-an eight hex digit web color, either 'RRGGBBAA' or '#RRGGBBAA'.
+an eight hex digit web color, either C<RRGGBBAA> or C<#RRGGBBAA>.
=item *
-a 3 hex digit web color, '#RGB' - a value of F becomes 255.
+a 3 hex digit web color, C<#RGB> - a value of F becomes 255.
=item *
-a color name, from whichever of the gimp Named_Colors file or X
-rgb.txt is found first. The same as using the name keyword.
+a color name, from whichever of the gimp C<Named_Colors> file or X
+C<rgb.txt> is found first. The same as using the C<name> keyword.
=back
@@ -499,8 +500,8 @@ The color components in the range 0 to 255.
=item *
-'hue', 'saturation' and 'value', optionally shortened to 'h', 's' and
-'v', to specify a HSV color. 0 <= hue < 360, 0 <= s <= 1 and 0 <= v
+C<hue>, C<saturation> and C<value>, optionally shortened to C<h>, C<s> and
+C<v>, to specify a HSV color. 0 <= hue < 360, 0 <= s <= 1 and 0 <= v
<= 1.
# the same as RGB(127,255,127)
@@ -509,22 +510,22 @@ The color components in the range 0 to 255.
=item *
-'web', which can specify a 6 or 3 hex digit web color, in any of the
-forms '#RRGGBB', '#RGB', 'RRGGBB' or 'RGB'.
+C<web>, which can specify a 6 or 3 hex digit web color, in any of the
+forms C<#RRGGBB>, C<#RGB>, C<RRGGBB> or C<RGB>.
my $c1 = Imager::Color->new(web=>'#FFC0C0'); # pale red
=item *
-'gray' or 'grey' which specifies a single channel, from 0 to 255.
+C<gray> or C<grey> which specifies a single channel, from 0 to 255.
# exactly the same
my $c1 = Imager::Color->new(gray=>128);
my $c1 = Imager::Color->new(grey=>128);
=item *
-'rgb' which takes a 3 member arrayref, containing each of the red,
+C<rgb> which takes a 3 member arrayref, containing each of the red,
green and blue values.
# the same
@@ -533,7 +534,7 @@ green and blue values.
=item *
-'hsv' which takes a 3 member arrayref, containting each of hue,
+C<hsv> which takes a 3 member arrayref, containing each of hue,
saturation and value.
# the same
@@ -542,37 +543,37 @@ saturation and value.
=item *
-'gimp' which specifies a color from a GIMP palette file. You can
-specify the filename of the palette file with the 'palette' parameter,
-or let Imager::Color look in various places, typically
-"$HOME/gimp-1.x/palettes/Named_Colors" with and without the version
-number, and in /usr/share/gimp/palettes/. The palette file must have
-color names.
+C<gimp> which specifies a color from a GIMP palette file. You can
+specify the file name of the palette file with the 'palette'
+parameter, or let Imager::Color look in various places, typically
+C<$HOME/gimp-1.x/palettes/Named_Colors> with and without the version
+number, and in C</usr/share/gimp/palettes/>. The palette file must
+have color names.
my $c1 = Imager::Color->new(gimp=>'snow');
my $c1 = Imager::Color->new(gimp=>'snow', palette=>'testimg/test_gimp_pal);
=item *
-'xname' which specifies a color from an X11 rgb.txt file. You can
-specify the filename of the rgb.txt file with the 'palette' parameter,
-or let Imager::Color look in various places, typically
-'/usr/lib/X11/rgb.txt'.
+C<xname> which specifies a color from an X11 C<rgb.txt> file. You can
+specify the file name of the C<rgb.txt> file with the C<palette>
+parameter, or let Imager::Color look in various places, typically
+C</usr/lib/X11/rgb.txt>.
my $c1 = Imager::Color->new(xname=>'blue') # usually RGB(0, 0, 255)
=item *
-'builtin' which specifies a color from the built-in color table in
+C<builtin> which specifies a color from the built-in color table in
Imager::Color::Table. The colors in this module are the same as the
-default X11 rgb.txt file.
+default X11 C<rgb.txt> file.
my $c1 = Imager::Color->new(builtin=>'black') # always RGB(0, 0, 0)
=item *
-'name' which specifies a name from either a GIMP palette, an X rgb.txt
-file or the built-in color table, whichever is found first.
+C<name> which specifies a name from either a GIMP palette, an X
+C<rgb.txt> file or the built-in color table, whichever is found first.
=item *
@@ -594,7 +595,7 @@ set() method.
=head1 AUTHOR