Tony Cook > Imager-0.95 > convert.im

Download:
Imager-0.95.tar.gz

Annotate this POD

Website

CPAN RT

New  39
Open  16
View/Report Bugs
Source   Latest Release: Imager-1.000

NAME ^

  convert.im - image conversions

SYNOPSIS ^

  out = i_convert(srcimage, coeff, outchans, inchans)

DESCRIPTION ^

Converts images from one format to another, typically in this case for converting from RGBA to greyscale and back.

i_convert(src, coeff, outchan, inchan)

Converts the image src into another image.

coeff contains the co-efficients of an outchan x inchan matrix, for each output pixel:

              coeff[0], coeff[1] ...
  im[x,y] = [ coeff[inchan], coeff[inchan+1]...        ] * [ src[x,y], 1]
              ...              coeff[inchan*outchan-1]

If im has the wrong number of channels or is the wrong size then i_convert() will re-create it.

Now handles images with more than 8-bits/sample.

is_channel_copy(coeff, outchan, inchan, chan_copy_info)

Test if the coefficients represent just copying channels around, and initialize lists of the channels to copy, zero or set to max.

convert_via_copy(im, src, chan_copy_info)

Perform a convert that only requires channel copies.

SEE ALSO ^

Imager(3)

AUTHOR ^

Tony Cook <tony@develop-help.com>

syntax highlighting: