The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
im_context_t =category Data Types

Imager's per-thread context.

im_slot_t =category Data Types

Represents a slot in the context object.

i_img_dim =category Data Types =synopsis i_img_dim x, y; =order 90

A signed integer type that represents an image dimension or ordinate.

May be larger than int on some platforms.

i_img_dim_u =category Data Types =synopsis i_img_dim_u limit; =order 90

An unsigned variant of "i_img_dim".

i_color =category Data Types =synopsis i_color black; =synopsis black.rgba.r = black.rgba.g = black.rgba.b = black.rgba.a = 0;

Type for 8-bit/sample color.

Samples as per;

  i_color c;

i_color is a union of:

  • gray - contains a single element gray_color, eg. c.gray.gray_color

  • rgb - contains three elements r, g, b, eg. c.rgb.r

  • rgba - contains four elements r, g, b, a, eg. c.rgba.a

  • cmyk - contains four elements c, m, y, k, eg. c.cmyk.y. Note that Imager never uses CMYK colors except when reading/writing files.

  • channels - an array of four channels, eg c.channels[2].

i_fcolor =category Data Types

This is the double/sample color type.

Its layout exactly corresponds to i_color.

i_img =category Data Types =synopsis i_img *img; =order 10

This is Imager's image type.

It contains the following members:

  • channels - the number of channels in the image

  • xsize, ysize - the width and height of the image in pixels

  • bytes - the number of bytes used to store the image data. Undefined where virtual is non-zero.

  • 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.

  • bits - the number of bits stored per sample. Should be one of i_8_bits, i_16_bits, i_double_bits.

  • type - either i_direct_type for direct color images, or i_palette_type for paletted images.

  • isvirtual - if zero then this image is-self contained. If non-zero then this image could be an interface to some other implementation.

  • 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.

  • tags - a structure storing the image's tags. This should only be accessed via the i_tags_*() functions.

  • ext_data - a pointer for use internal to an image implementation. This should be freed by the image's destroy handler.

  • im_data - data internal to Imager. This is initialized by i_img_init().

  • 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().

  • 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.

  • i_f_destroy - custom image destruction function. This should be used to release memory if necessary.

  • i_f_gsamp_bits - implements i_gsamp_bits() for this image.

  • i_f_psamp_bits - implements i_psamp_bits() for this image.

  • i_f_psamp - implements psamp() for this image.

  • i_f_psampf - implements psamp() for this image.

  • im_data - image specific data internal to Imager.

  • context - the Imager API context this image belongs to.

i_polygon_t =category Data Types

Represents a polygon. Has the following members:

  • x, y - arrays of x and y locations of vertices.

  • count - the number of entries in the x and y arrays.

i_poly_fill_mode_t =category Data Types

Control how polygons are filled. Has the following values:

  • i_pfm_evenodd - simple even-odd fills.

  • i_pfm_nonzero - non-zero winding rule fills.

i_fill_t =category Data Types =synopsis i_fill_t *fill;

This is the "abstract" base type for Imager's fill types.

Unless you're implementing a new fill type you'll typically treat this as an opaque type.

i_mutex_t =category mutex =synopsis i_mutex_t mutex;

Opaque type for Imager's mutex API.

i_transp =category Data Types

An enumerated type for controlling how transparency is handled during quantization.

This has the following possible values:

  • tr_none - ignore the alpha channel

  • tr_threshold - simple transparency thresholding.

  • tr_errdiff - use error diffusion to control which pixels are transparent.

  • tr_ordered - use ordered dithering to control which pixels are transparent.

i_make_colors =category Data Types

An enumerated type used to control the method used for produce the color map:

  • mc_none - the user supplied map is used.

  • mc_web_map - use the classic web map. Any existing fixed colors are ignored.

  • mc_median_cut - use median cut

  • mono - use a fixed black and white map.

  • gray - 256 step gray map.

  • gray4 - 4 step gray map.

  • gray16 - 16 step gray map.

i_translate =category Data Types

An enumerated type that controls how colors are translated:

  • pt_giflib - obsolete, forces make_colors to use median cut and acts like pt_closest.

  • pt_closest - always use the closest color.

  • pt_perturb - add random values to each sample and find the closest color.

  • pt_errdiff - error diffusion dither.

i_errdiff =category Data Types

Controls the type of error diffusion to use:

  • ed_floyd - floyd-steinberg

  • ed_jarvis - Jarvis, Judice and Ninke

  • ed_stucki - Stucki

  • ed_custom - not usable for transparency dithering, allows a custom error diffusion map to be used.

  • ed_bidir - or with the error diffusion type to use alternate directions on each line of the dither.

i_ord_dith =category Data Types

Which ordered dither map to use, currently only available for transparency. Values are:

  • od_random - a pre-generated random map.

  • od_dot8 - large dot dither.

  • od_dot4 - smaller dot dither

  • od_hline - horizontal line dither.

  • od_vline - vertical line dither.

  • od_slashline - / line dither.

  • od_backline - \ line dither.

  • od_tiny - small checkbox dither

  • od_custom - custom dither map.

i_quantize =category Data Types

A structure type used to supply image quantization, ie. when converting a direct color image to a paletted image.

This has the following members:

  • transp - how to handle transparency, see "i_transp".

  • threshold - when transp is tr_threshold, this is the alpha level at which pixels become transparent.

  • tr_errdiff - when transp is tr_errdiff this controls the type of error diffusion to be done. This may not be ed_custom for this member.

  • tr_orddith - when transp is tr_ordered this controls the patten used for dithering transparency.

  • tr_custom - when tr_orddith is tr_custom this is the ordered dither mask.

  • make_colors - the method used to generate the color palette, see "i_make_colors".

  • mc_colors - an array of mc_size "i_color" entries used to define the fixed colors (controlled by mc_count and to return the generated color list.

  • mc_size - the size of the buffer allocated to mc_colors in sizeof(i_color) units.

  • mc_count - the number of initialized colors in mc_colors.

  • translate - how RGB colors are translated to palette indexes, see "i_translate".

  • errdiff - when translate is pt_errdiff this controls the type of error diffusion to be done.

  • ed_map, ed_width, ed_height, ed_orig - when errdiff is ed_custom this controls the error diffusion map. ed_map is an array of ed_width * ed_height integers. ed_orig is the position of the current pixel in the error diffusion map, always on the top row.

  • perturb - the amount to perturb pixels when translate is mc_perturb.

i_color_model_t =category Data Types =order 95

Returned by "i_img_color_model(im)" to indicate the color model of the image.

An enumerated type with the following possible values:

  • icm_unknown - the image has no usable color data. In future versions of Imager this will be returned in a few limited cases, eg. when the source image is CMYK and the user has requested no color translation is done.

  • icm_gray - gray scale with no alpha channel.

  • icm_gray_alpha - gray scale with an alpha channel.

  • icm_rgb - RGB

  • icm_rgb_alpha - RGB with an alpha channel.

i_DF =category Data Types =synopsis printf("left %" i_DF "\n", i_DFc(x)); =order 95

This is a constant string that can be used with functions like printf() to format i_img_dim values after they're been cast with i_DFc().

Does not include the leading %.

i_DFc =category Data Types =order 95

Cast an i_img_dim value to a type for use with the i_DF format string.

i_DFp =category Data Types =synopsis printf("point (" i_DFp ")\n", i_DFcp(x, y)); =order 95

Format a pair of i_img_dim values. This format string does include the leading %.

i_DFcp =category Data Types =order 95

Casts two i_img_dim values for use with the i_DF (or i_DFp) format.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 14:

'=item' outside of any '=over'

=over without closing =back