++ed by:
ALEXBYK ANTIPASTA AWNCORP EGOR EMAZEP

25 PAUSE user(s)
13 non-PAUSE user(s).

Tony Cook

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>




Hosting generously
sponsored by Bytemark