


IMCLTROLL(3IM)         SDSC IMAGE LIBRARY          IMCLTROLL(3IM)



NAME
     ImCltRoll - Roll a color lookup table by a number of entries

SYNOPSIS
     #include "im.h"

     ImClt *ImCltRoll( srcClt, nEntries, dstClt )
          ImClt     *srcClt ;
          int  nEntries;
          ImClt     *dstClt ;


DESCRIPTION
     ImCltRoll rolls, or cycles, a _s_r_c_C_l_t  color  lookup  table's
     entries  by  _n_E_n_t_r_i_e_s  entries  and  saves  the results into
     _d_s_t_C_l_t.  A pointer to the destination CLT is returned.

     Sometimes rgb images have color  lookup  tables.   When  you
     rotate  the  color  lookuptable  you  may  not  perceive any
     changes in the image  since  some  displaying  programs  may
     throw  this  color  lookup  table  out  and use just the rgb
     information.

     Rolling a CLT copies entry 0 to entry _n_E_n_t_r_i_e_s, entry  1  to
     entry  _n_E_n_t_r_i_e_s+1,  entry  2  to entry _n_E_n_t_r_i_e_s+2 and so on.
     Entries that roll off the bottom of the CLT wrap around  and
     are  placed  at  the  top of the CLT, creating a rolling, or
     cycling effect in the copy.

     _d_s_t_C_l_t is the CLT to contain the rolled color lookup  table.
     If  _d_s_t_C_l_t  is the constant IMCLTNEW, a new CLT is allocated
     with the same size as _s_r_c_C_l_t.  A pointer to the new  CLT  is
     returned.

     Otherwise, color lookup table entries in _s_r_c_C_l_t  are  rolled
     and copied into _d_s_t_C_l_t.  _d_s_t_C_l_t must have the same number of
     CLT entries as _s_r_c_C_l_t.

     Positive values of _n_E_n_t_r_i_e_s roll the CLT towards the bottom,
     while negative values roll it towards the top.

NOTES
     _s_r_c_C_l_t and _d_s_t_C_l_t may be the  same  CLT  without  unpleasant
     side-effects.

     To associate the new CLT with an image, use ImVfbSClt(3IM).

     CLT rolling is  a  technique  used  to  find  and  highlight
     aspects  of  an  image, such as one generated by a CAT-scan.
     For  example,  different  color  indexes   in   a   CAT-scan
     correspond  to different types of matter, such as bone, mus-
     cle, and air.  To highlight just the  bone,  a  CLT  may  be



SDSC             Last change: September 1, 1992                 1






IMCLTROLL(3IM)         SDSC IMAGE LIBRARY          IMCLTROLL(3IM)



     constructed  that  sets  a  range  of  color indexes to, say
     bright red, and the rest to black.

     When the red range of the CLT corresponds to the  CAT-scan's
     bone  indexes,  then  all  boney  matter  in  the  image  is
     highlighted in red.  To highlight a different set  of  image
     color  indexes,  roll  the  CLT far enough to bring the reds
     into the right index range, such as those  for  muscle.   By
     sweeping  the red values back and forth through the CLT, one
     can zero in on color indexes of interest.

     In typical use, an interactive tool would  display  a  color
     indexed  image  and  create such a red-and-black CLT for it.
     As a slider widget is dragged back and  forth,  the  image's
     CLT  is  rolled  back  and forth, with the image redisplayed
     each time the CLT is changed.

RETURNS
     Upon success, ImCltRoll returns a pointer to the destination
     CLT.  Upon failure, IMCLTNULL is returned and ImErrNo set to
     one of the following:

          IMEMALLOC   Cannot allocate enough memory for _d_s_t_C_l_t
          IMENOCLT    _s_r_c_C_l_t is IMCLTNULL

SEE ALSO
     ImIntro (3IM), ImErrNo  (3IM),  imcltroll  (1IM),  ImVfbRoll
     (3IM)

AUTHORS
     Chris Groening and Dave Nadeau
     San Diego Supercomputer Center

CONTACT
     SDSC consultants, (619)534-5100, consult@y1.sdsc.edu




















2                Last change: September 1, 1992              SDSC



