Do not edit this file, it is generated automatically by apidocs.perl
from Imager's source files.
-Each function description has a comment listing the source file and
-line number where you can find the documentation.
+Each function description has a comment listing the source file where
+you can find the documentation.
=head1 NAME
i_color color;
color.rgba.red = 255; color.rgba.green = 0; color.rgba.blue = 255;
- i_fill_t *fill = i_new_fill_...(...);
+ # Data Types
+ i_img *img;
+
# Drawing
i_arc(im, 50, 50, 20, 45, 135, &color);
i_arc_aa(im, 50, 50, 35, 90, 135, &color);
i_set_image_file_limits(500, 500, 1000000);
# Fills
+ i_fill_destroy(fill);
fill = i_new_fill_fount(0, 0, 100, 100, i_ft_linear, i_ft_linear,
i_fr_triangle, 0, i_fts_grid, 9, 1, segs);
+ i_fill_t *fill = i_new_fill_hatch(&fg_color, &bg_color, combine, hatch, custom_hatch, dx, dy);
+ i_fill_t *fill = i_new_fill_hatchf(&fg_fcolor, &bg_fcolor, combine, hatch, custom_hatch, dx, dy);
+ i_fill_t *fill = i_new_fill_image(src_img, matrix, x_offset, y_offset, combine);
+ i_fill_t *fill = i_new_fill_solid(&color, combine);
+ i_fill_t *fill = i_new_fill_solidf(&fcolor, combine);
# Image
# Image creation
+ i_img *img = i_img_16_new(width, height, channels);
+
+ # Image creation/destruction
+ i_img *img = i_img_8_new(width, height, channels);
+ i_img_destroy(img)
+ i_img *img = i_img_double_new(width, height, channels);
+ i_img *img = i_img_pal_new(width, height, channels, max_palette_size)
+ i_img *img = i_sametype(src, width, height);
+ i_img *img = i_sametype_chans(src, width, height, channels);
+
+ # Image Implementation
+
+ # Image Information
# Image quantization
+ # Logging
+
# Paletted images
# Tags
- i_fill_destroy(fill);
-
=head1 DESCRIPTION
+=head2 Data Types
+
+=over
+
+=item i_img
+
+This is Imager's image type.
+
+It contains the following members:
+
+=over
+
+=item *
+
+channels - the number of channels in the image
+
+=item *
+
+xsize, ysize - the width and height of the image in pixels
+
+=item *
+
+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
+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
+i_8_bits, i_16_bits, i_double_bits.
+
+=item *
+
+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.
+
+=item *
+
+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
+accessed via the i_tags_*() functions.
+
+=item *
+
+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
+i_img_init().
+
+=item *
+
+i_f_ppix, i_f_ppixf, i_f_plin, i_f_plinf, i_f_gpix, i_f_gpixf,
+i_f_glin, i_f_glinf, i_f_gsamp, i_f_gampf - implementations for each
+of the required image functions. An image implementation should
+initialize these between calling i_img_alloc() and i_img_init().
+
+=item *
+
+i_f_gpal, i_f_ppal, i_f_addcolors, i_f_getcolors, i_f_colorcount,
+i_f_maxcolors, i_f_findcolor, i_f_setcolors - implementations for each
+paletted image function.
+
+=item *
+
+i_f_destroy - custom image destruction function. This should be used
+to release memory if necessary.
+
+=item *
+
+i_f_gsamp_bits - implements i_gsamp_bits() for this image.
+
+=item *
+
+i_f_psamp_bits - implements i_psamp_bits() for this image.
+
+=back
+
+
+=for comment
+From: File imdatatypes.h
+
+
+=back
+
=head2 Drawing
=over
=for comment
-From: Line 209 in draw.c
+From: File draw.c
=item i_arc_aa(im, x, y, rad, d1, d2, color)
=for comment
-From: Line 334 in draw.c
+From: File draw.c
=item i_arc_aa_cfill(im, x, y, rad, d1, d2, fill)
=for comment
-From: Line 360 in draw.c
+From: File draw.c
=item i_arc_cfill(im, x, y, rad, d1, d2, fill)
=for comment
-From: Line 234 in draw.c
+From: File draw.c
=item i_box(im, x1, y1, x2, y2, color)
=for comment
-From: Line 520 in draw.c
+From: File draw.c
=item i_box_cfill(im, x1, y1, x2, y2, fill)
=for comment
-From: Line 563 in draw.c
+From: File draw.c
=item i_box_filled(im, x1, y1, x2, y2, color)
=for comment
-From: Line 545 in draw.c
+From: File draw.c
=item i_circle_aa(im, x, y, rad, color)
=for comment
-From: Line 466 in draw.c
+From: File draw.c
=item i_flood_cfill(im, seedx, seedy, fill)
=for comment
-From: Line 1329 in draw.c
+From: File draw.c
=item i_flood_cfill_border(im, seedx, seedy, fill, border)
=for comment
-From: Line 1409 in draw.c
+From: File draw.c
=item i_flood_fill(im, seedx, seedy, color)
=for comment
-From: Line 1287 in draw.c
+From: File draw.c
=item i_flood_fill_border(im, seedx, seedy, color, border)
=for comment
-From: Line 1369 in draw.c
+From: File draw.c
=item i_glin(im, l, r, y, colors)
=for comment
-From: Line 210 in imext.c
+From: File imext.c
=item i_glinf(im, l, r, y, colors)
=for comment
-From: Line 245 in imext.c
+From: File imext.c
=item i_gpal(im, x, r, y, indexes)
=for comment
-From: Line 309 in imext.c
+From: File imext.c
=item i_gpix(im, x, y, color)
=for comment
-From: Line 138 in imext.c
+From: File imext.c
=item i_gpixf(im, x, y, fcolor)
=for comment
-From: Line 174 in imext.c
+From: File imext.c
=item i_gsamp(im, l, r, y, samp, chans, chan_count)
=for comment
-From: Line 263 in imext.c
+From: File imext.c
=item i_gsampf(im, l, r, y, samp, chans, chan_count)
=for comment
-From: Line 286 in imext.c
+From: File imext.c
=item i_line(im, x1, y1, x2, y2, val, endp)
=for comment
-From: Line 634 in draw.c
+From: File draw.c
=item i_line_aa(im, x1, x2, y1, y2, color, endp)
=for comment
-From: Line 838 in draw.c
+From: File draw.c
=item i_plin(im, l, r, y, colors)
=for comment
-From: Line 192 in imext.c
+From: File imext.c
=item i_plinf(im, l, r, fcolors)
=for comment
-From: Line 227 in imext.c
+From: File imext.c
=item i_ppal(im, x, r, y, indexes)
=for comment
-From: Line 328 in imext.c
+From: File imext.c
=item i_ppix(im, x, y, color)
=for comment
-From: Line 118 in imext.c
+From: File imext.c
=item i_ppixf(im, x, y, fcolor)
=for comment
-From: Line 155 in imext.c
+From: File imext.c
=back
=for comment
-From: Line 185 in error.c
+From: File error.c
=item i_push_error(int code, char const *msg)
=for comment
-From: Line 211 in error.c
+From: File error.c
=item i_push_errorf(int code, char const *fmt, ...)
=for comment
-From: Line 273 in error.c
+From: File error.c
=item i_push_errorvf(int code, char const *fmt, va_list ap)
=for comment
-From: Line 249 in error.c
+From: File error.c
=back
=for comment
-From: Line 74 in limits.c
+From: File limits.c
=item i_int_check_image_file_limits(width, height, channels, sample_size)
=for comment
-From: Line 96 in limits.c
+From: File limits.c
=item i_set_image_file_limits(width, height, bytes)
=for comment
-From: Line 33 in limits.c
+From: File limits.c
=back
=for comment
-From: Line 196 in fills.c
+From: File fills.c
=item i_new_fill_fount(xa, ya, xb, yb, type, repeat, combine, super_sample, ssample_param, count, segs)
=for comment
-From: Line 1713 in filters.c
+From: File filters.im
=item i_new_fill_hatch(fg, bg, combine, hatch, cust_hatch, dx, dy)
=for comment
-From: Line 427 in fills.c
+From: File fills.c
=item i_new_fill_hatchf(fg, bg, combine, hatch, cust_hatch, dx, dy)
=for comment
-From: Line 452 in fills.c
+From: File fills.c
=item i_new_fill_image(im, matrix, xoff, yoff, combine)
=for comment
-From: Line 489 in fills.c
+From: File fills.c
=item i_new_fill_solid(color, combine)
=for comment
-From: Line 244 in fills.c
+From: File fills.c
=item i_new_fill_solidf(color, combine)
=for comment
-From: Line 213 in fills.c
+From: File fills.c
=back
=for comment
-From: Line 626 in image.c
+From: File image.c
=item i_copyto(dest, src, x1, y1, x2, y2, tx, ty)
=for comment
-From: Line 557 in image.c
+From: File paste.im
=item i_copyto_trans(im, src, x1, y1, x2, y2, tx, ty, trans)
=for comment
-From: Line 515 in image.c
-
-=item i_img_destroy(im)
-
-
-Destroy image and free data via exorcise.
-
- im - Image pointer
-
-
-=for comment
-From: Line 424 in image.c
+From: File image.c
=item i_img_info(im, info)
=for comment
-From: Line 443 in image.c
+From: File image.c
=item i_rubthru(im, src, tx, ty, src_minx, src_miny, src_maxx, src_maxy )
=for comment
-From: Line 701 in image.c
+From: File rubthru.im
=back
=for comment
-From: Line 192 in img16.c
+From: File img16.c
+
+
+=back
+
+=head2 Image creation/destruction
+
+=over
=item i_img_8_new(x, y, ch)
+
Creates a new image object I<x> pixels wide, and I<y> pixels high with
I<ch> channels.
=for comment
-From: Line 257 in image.c
+From: File image.c
+
+=item i_img_destroy(img)
+
+
+Destroy an image object
-=item i_img_double_new(int x, int y, int ch)
+=for comment
+From: File image.c
+
+=item i_img_double_new(int x, int y, int ch)
Creates a new double per sample image.
=for comment
-From: Line 82 in imgdouble.c
+From: File imgdouble.c
=item i_img_pal_new(x, y, channels, maxpal)
Creates a new paletted image of the supplied dimensions.
+I<maxpal> is the maximum palette size and should normally be 256.
+
Returns a new image or NULL on failure.
=for comment
-From: Line 136 in palimg.c
+From: File palimg.c
=item i_sametype(i_img *im, int xsize, int ysize)
=for comment
-From: Line 1107 in image.c
+From: File image.c
=item i_sametype_chans(i_img *im, int xsize, int ysize, int channels)
=for comment
-From: Line 1149 in image.c
+From: File image.c
+
+
+=back
+
+=head2 Image Implementation
+
+=over
+
+=item i_img_alloc()
+
+Allocates a new i_img structure.
+
+When implementing a new image type perform the following steps in your
+image object creation function:
+
+=over
+
+=item 1.
+
+allocate the image with i_img_alloc().
+
+=item 2.
+
+initialize any function pointers or other data as needed, you can
+overwrite the whole block if you need to.
+
+=item 3.
+
+initialize Imager's internal data by calling i_img_init() on the image
+object.
+
+=back
+
+
+=for comment
+From: File image.c
+
+=item i_img_init(img)
+
+Imager interal initialization of images.
+
+Currently this does very little, in the future it may be used to
+support threads, or color profiles.
+
+
+=for comment
+From: File image.c
+
+
+=back
+
+=head2 Image Information
+
+=over
+
+=item i_img_color_channels(im)
+
+
+The number of channels holding color information.
+
+
+=for comment
+From: File immacros.h
+
+=item i_img_has_alpha(im)
+
+
+Return true if the image has an alpha channel.
+
+
+=for comment
+From: File immacros.h
=back
=for comment
-From: Line 30 in quant.c
+From: File quant.c
=item i_quant_translate(quant, img)
=for comment
-From: Line 86 in quant.c
+From: File quant.c
=item i_quant_transparent(quant, data, img, trans_index)
=for comment
-From: Line 1470 in quant.c
+From: File quant.c
+
+
+=back
+
+=head2 Logging
+
+=over
+
+=item i_loog(level, format, ...)
+
+This is an internal function called by the mm_log() macro.
+
+
+=for comment
+From: File log.c
+
+=item mm_log((level, format, ...))
+
+This is the main entry point to logging. Note that the extra set of
+parentheses are required due to limitations in C89 macros.
+
+This will format a string with the current file and line number to the
+log file if logging is enabled.
+
+
+=for comment
+From: File log.h
=back
=for comment
-From: Line 347 in imext.c
+From: File imext.c
=item i_colorcount(im)
=for comment
-From: Line 393 in imext.c
+From: File imext.c
=item i_findcolor(im, color, &entry)
=for comment
-From: Line 428 in imext.c
+From: File imext.c
=item i_getcolors(im, index, colors, count)
=for comment
-From: Line 368 in imext.c
+From: File imext.c
=item i_maxcolors(im)
=for comment
-From: Line 410 in imext.c
+From: File imext.c
=item i_setcolors(im, index, colors, count)
=for comment
-From: Line 448 in imext.c
+From: File imext.c
=back
=for comment
-From: Line 294 in tags.c
+From: File tags.c
=item i_tags_delbyname(tags, name)
=for comment
-From: Line 264 in tags.c
+From: File tags.c
=item i_tags_delete(tags, index)
=for comment
-From: Line 235 in tags.c
+From: File tags.c
=item i_tags_destroy(tags)
=for comment
-From: Line 158 in tags.c
+From: File tags.c
=item i_tags_find(tags, name, start, &entry)
=for comment
-From: Line 181 in tags.c
+From: File tags.c
=item i_tags_findn(tags, code, start, &entry)
=for comment
-From: Line 208 in tags.c
+From: File tags.c
=item i_tags_get_color(tags, name, code, &value)
=for comment
-From: Line 505 in tags.c
+From: File tags.c
=item i_tags_get_float(tags, name, code, value)
=for comment
-From: Line 320 in tags.c
+From: File tags.c
=item i_tags_get_int(tags, name, code, &value)
=for comment
-From: Line 406 in tags.c
+From: File tags.c
=item i_tags_get_string(tags, name, code, value, value_size)
=for comment
-From: Line 569 in tags.c
+From: File tags.c
=item i_tags_new(i_img_tags *tags)
=for comment
-From: Line 61 in tags.c
+From: File tags.c
=item i_tags_set(tags, name, data, size)
=for comment
-From: Line 617 in tags.c
+From: File tags.c
=item i_tags_set_color(tags, name, code, &value)
=for comment
-From: Line 545 in tags.c
+From: File tags.c
=item i_tags_set_float(tags, name, code, value)
=for comment
-From: Line 359 in tags.c
+From: File tags.c
=item i_tags_set_float2(tags, name, code, value, places)
=for comment
-From: Line 374 in tags.c
+From: File tags.c
=item i_tags_setn(tags, name, idata)
=for comment
-From: Line 634 in tags.c
+From: File tags.c
+
+
+=back
+
+=head2 Uncategorized functions
+
+=over
+
+=item i_img_get_height(im)
+
+
+Returns the height in pixels of the image.
+
+
+=for comment
+From: File image.c
+
+=item i_img_get_width(im)
+
+
+Returns the width in pixels of the image.
+
+
+=for comment
+From: File image.c
+
+=item i_img_getchannels(im)
+
+
+Get the number of channels in I<im>.
+
+
+=for comment
+From: File image.c
+
+=item i_img_getmask(im)
+
+
+Get the image channel mask for I<im>.
+
+
+=for comment
+From: File image.c
+
+=item i_img_setmask(im, ch_mask)
+
+
+Set the image channel mask for I<im> to I<ch_mask>.
+
+
+=for comment
+From: File image.c
+
+
+
+=back
+
+
+=head1 UNDOCUMENTED
+
+The following API functions are undocumented so far, hopefully this
+will change:
+
+=over
+
+=item *
+
+B<i_color>
+
+=item *
+
+B<i_fcolor>
+
+=item *
+
+B<i_fill_t>
+
+=item *
+
+B<i_lhead>
+
=back