


IMVFBFILL(3IM)         SDSC IMAGE LIBRARY          IMVFBFILL(3IM)



NAME
     ImVfbFill - fill part or all of a virtual frame buffer

SYNOPSIS
     #include "im.h"

     ImVfb *ImVfbFill( srcVfb, srcXLeft, srcYTop, srcDx, srcDy,
          fillField, fillStart, fillEnd, inOut, graduate, dstVfb )
          ImVfb     *srcVfb;
          int  srcXLeft;
          int  srcYTop;
          int  srcDx;
          int  srcDy;
          int  fillField;
          float     fieldStart;
          float     fieldEnd;
          int  inOut;
          int  graduate;
          ImVfb     *dstVfb;


DESCRIPTION
     ImVfbFill fills one or more fields  of  _s_r_c_V_f_b,  saving  the
     result in _d_s_t_V_f_b.

     _s_r_c_X_L_e_f_t and _s_r_c_Y_T_o_p are the upper-left  corner  of  a  fill
     region  _s_r_c_D_x  pixels  wide  and  _s_r_c_D_y pixels high.  Pixels
     within the region, or outside of the region will  be  filled
     based upon the value of _i_n_O_u_t:

          _i_n_O_u_t       Meaning
8          ______________________________________________
          IMINSIDE    Fill inside of the fill rectangle
          IMOUTSIDE   Fill outside of the fill rectangle

     Pixels will be filled with a gradation, or ramp,  of  values
     between  _f_i_l_l_S_t_a_r_t  and  _f_i_l_l_E_n_d depending upon the value of
     _g_r_a_d_u_a_t_e:

          _g_r_a_d_u_a_t_e      Meaning
8          _______________________________________________________
          IMGRADNONE    Constant fill with _f_i_l_l_S_t_a_r_t
          IMGRADHORIZ   Horizontal ramp from _f_i_l_l_S_t_a_r_t to _f_i_l_l_E_n_d
          IMGRADVERT    Vertical ramp from _f_i_l_l_S_t_a_r_t to _f_i_l_l_E_n_d

     Horizontal graduated fill's ramp from _f_i_l_l_S_t_a_r_t at the  left
     edge of the fill area, to _f_i_l_l_E_n_d at the right edge.  Verti-
     cal graduated fill's ramp from _f_i_l_l_S_t_a_r_t at the top edge  of
     the fill area, to _f_i_l_l_E_n_d at the bottom edge.

     _f_i_l_l_S_t_a_r_t and _f_i_l_l_E_n_d may have the  same  value.   _f_i_l_l_S_t_a_r_t
     need not be less than _f_i_l_l_E_n_d.




SDSC              Last change: August 31, 1992                  1






IMVFBFILL(3IM)         SDSC IMAGE LIBRARY          IMVFBFILL(3IM)



     _f_i_l_l_F_i_e_l_d selects the pixel fields to be filled:

          _f_i_l_l_F_i_e_l_d      Meaning
8          _____________________________________________________________
          IMMONO         Fill the IMVFBMONO field
8          _____________________________________________________________
          IMGRAY         Fill the IMVFBINDEX8 (IMVFBGRAY) field
          IMINDEX8       Fill the IMVFBINDEX8 field
          IMINDEX16      Fill the IMVFBINDEX16 field
8          _____________________________________________________________
          IMRED          Fill the IMVFBRGB red field
          IMGREEN        Fill the IMVFBRGB green field
          IMBLUE         Fill the IMVFBRGB blue field
8          _____________________________________________________________
          IMALPHA        Fill the IMVFBALPHA field
          IMWPROT        Fill the IMVFBWPROT field
          IMZ            Fill the IMVFBZ field
          IMIDATA        Fill the IMVFBIDATA field
          IMFDATA        Fill the IMVFBFDATA field
8          _____________________________________________________________
          IMHUE          Fill the IMVFBRGB fields based upon hue
          IMSATURATION   Fill the IMVFBRGB fields based upon saturation
          IMINTENSITY    Fill the IMVFBRGB fields based upon intensity

     The _s_r_c_V_f_b and _d_s_t_V_f_b must have the  field's  in  _f_i_l_l_F_i_e_l_d,
     with  the exception of IMHUE, IMSATURATION, and IMINTENSITY,
     which require that  the  _s_r_c_V_f_b  and  _d_s_t_V_f_b  have  IMVFBRGB
     fields.

     Fields in the source VFB not listed in _f_i_l_l_F_i_e_l_d are  copied
     to the destination VFB without modification.

     Fields not in the fill region are copied to the destionation
     VFB without modification.

NOTES
     _d_s_t_V_f_b may be the same  VFB  as  _s_r_c_V_f_b  without  unpleasant
     side-effects.

     If _d_s_t_V_f_b is IMVFBNEW, a new VFB is  created  by  ImVfbFill.
     The  new  _d_s_t_V_f_b  will have the same fields, dimensions, and
     initial contents as _s_r_c_V_f_b.

     The rectangle defined by _s_r_c_X_L_e_f_t, _s_r_c_Y_T_o_p, _s_r_c_D_x, and _s_r_c_D_y
     will  be  prevented  from extending beyond the bounds of the
     image.

     Different pixel components have  different  types  and  dif-
     ferent minimum and maximum values.

          Value        Type      Minimum   Maximum
8          ________________________________________
          red          Integer   0         255
          green        Integer   0         255
          blue         Integer   0         255



2                 Last change: August 31, 1992               SDSC






IMVFBFILL(3IM)         SDSC IMAGE LIBRARY          IMVFBFILL(3IM)



8          ________________________________________
          monochrome   Integer   0         1
          index 8      Integer   0         255
          index 16     Integer   0         65535
8          ________________________________________
          hue          Float     0.0       360.0
          saturation   Float     0.0       1.0
          intensity    Float     0.0       1.0
8          ________________________________________
          alpha        Integer   0         255
          wprot        Integer   0         255
          z-buffer     Integer   0         maxint
          idata        Integer   any       any
          fdata        Float     any       any

RETURNS
     Upon success, ImVfbFill returns a pointer to the destination
     VFB.  Upon failure, IMVFBNULL is returned and ImErrNo set to
     one of the following:

          IMEBADINOUT     Bad value for _i_n_O_u_t
          IMEGRADUATION   Bad value for _g_r_a_d_u_a_t_e
          IMEHEIGHT       Bad fill area height
          IMEMALLOC       Out of host memory; cannot malloc
          IMENOVFB        _s_r_c_V_f_b is IMVFBNULL
          IMEWIDTH        Bad fill area width

SEE ALSO
     ImIntro (3IM), ImErrNo (3IM), imadjust (1IM), imcomp  (1IM),
     imdissolve  (1IM),  imfill (1IM), impaste (1IM), ImVfbAdjust
     (3IM), ImVfbComp (3IM), ImVfbMix (3IM)

AUTHORS
     Chris Groening and Dave Nadeau
     San Diego Supercomputer Center

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















9


SDSC              Last change: August 31, 1992                  3



