PCOMB(1)                                                              PCOMB(1)



NNAAMMEE
       pcomb - combine RADIANCE pictures

SSYYNNOOPPSSIISS
       ppccoommbb  [  --hh ][ --ww ][ --xx xxrreess ][ --yy yyrreess ][ --ff ffiillee ][ --ee eexxpprr ] [ [ --oo
       ][ --ss ffaaccttoorr ][ --cc rr gg bb ] iinnppuutt ....  ]

DDEESSCCRRIIPPTTIIOONN
       _P_c_o_m_b combines equal-sized RADIANCE pictures and sends  the  result  to
       the  standard output.  By default, the result is just a linear combina-
       tion of the input pictures multiplied by _-_s and _-_c coefficients, but an
       arbitrary mapping can be assigned with the _-_e and _-_f options.  Negative
       coefficients and functions are allowed, and _p_c_o_m_b  will  produce  color
       values of zero where they would be negative.

       The variables _r_o_, _g_o and _b_o specify the red, green and blue output val-
       ues, respectively.  Alternatively, the single variable _l_o can  be  used
       to  specify  a brightness value for black and white output.  The prede-
       fined functions _r_i_(_n_)_, _g_i_(_n_) and _b_i_(_n_) give the  red,  green  and  blue
       input  values for picture _n_.  To access a pixel that is nearby the cur-
       rent one, these functions also accept optional x and  y  offsets.   For
       example,  _r_i_(_3_,_-_2_,_1_)  would  return the red component of the pixel from
       picture 3 that is left 2 and up 1 from the current position.   Although
       x  offsets  may be as large as width of the picture, y offsets are lim-
       ited to a small window (+/- 32 pixels)  due  to  efficiency  considera-
       tions.   However, it is not usually necessary to worry about this prob-
       lem -- if the requested offset is not available, the next best pixel is
       returned instead.

       For  additional convenience, the function _l_i_(_n_) is defined as the input
       brightness for picture _n_.  This function also accepts x and y  offsets.

       The  constant  _n_f_i_l_e_s  gives  the number of input files present, and _W_E
       gives the white efficacy (lumens/brightness) for  pixel  values,  which
       may  be used with the _-_o option or the le(n) values to convert to abso-
       lute photometric units (see below).  The variables _x  and  _y  give  the
       current output pixel location for use in spatially dependent functions,
       the constants _x_m_a_x and _y_m_a_x give the input  resolution,  and  the  con-
       stants  _x_r_e_s and _y_r_e_s give the output resolution (usually the same, but
       see below).  The constant functions _r_e_(_n_)_, _g_e_(_n_)_, _b_e_(_n_)_, and _l_e_(_n_) give
       the  exposure  values  for picture _n_, and _p_a_(_n_) gives the corresponding
       pixel aspect ratio.  Finally, for pictures with stored view parameters,
       the  functions  _O_x_(_n_)_,  _O_y_(_n_)  and _O_z_(_n_) return the ray origin in world
       coordinates for the current pixel in picture _n_, and  _D_x_(_n_)_,  _D_y_(_n_)  and
       _D_z_(_n_)  return  the normalized ray direction.  In addition, the function
       _T_(_n_) returns the distance from the origin to the aft clipping plane (or
       zero if there is no aft plane), and the function _S_(_n_) returns the solid
       angle of the current pixel in  steradians  (always  zero  for  parallel
       views).   If  the  current  pixel is outside the view region, _T_(_n_) will
       return a negative value, and _S_(_n_) will return zero.

       The _-_h option may be used to reduce the information header size,  which
       can  grow  disproportionately after multiple runs of _p_c_o_m_b and/or _p_c_o_m_-
       _p_o_s_(_1_)_.  The _-_w option can be used to suppress warning  messages  about
       invalid calculations.  The _-_o option indicates that original pixel val-
       ues are to be used for the next picture, undoing any previous  exposure
       changes or color correction.

       The _-_x and _-_y options can be used to specify the desired output resolu-
       tion, _x_r_e_s and _y_r_e_s_, and can be expressions involving  other  constants
       such  as _x_m_a_x and _y_m_a_x_.  The constants _x_r_e_s and _y_r_e_s may also be speci-
       fied in a file or expression.  The default  output  resolution  is  the
       same as the input resolution.

       The _-_x and _-_y options must be present if there are no input files, when
       the definitions of _r_o_, _g_o and _b_o will be used to  compute  each  output
       pixel.   This  is useful for producing simple test pictures for various
       purposes.  (Theoretically, one could write a  complete  renderer  using
       just the functional language...)

       The  standard  input  can  be specified with a hyphen ('-').  A command
       that produces a RADIANCE picture can be given in place  of  a  file  by
       preceeding it with an exclamation point ('!').

EEXXAAMMPPLLEESS
       To produce a picture showing the difference between pic1 and pic2:

         pcomb  -e  'ro=ri(1)-ri(2);go=gi(1)-gi(2);bo=bi(1)-bi(2)' pic1 pic2 >
         diff

       Or, more efficiently:

         pcomb pic1 -s -1 pic2 > diff

       To precompute the gamma correction for a picture:

         pcomb -e 'ro=ri(1)^.4;go=gi(1)^.4;bo=bi(1)^.4' inp.hdr > gam.hdr

       To perform some special filtering:

         pcomb -f myfilt.cal -x xmax/2 -y ymax/2 input.hdr > filtered.hdr

       To make a picture of a dot:

         pcomb          -x          100          -y           100           -e
         'ro=b;go=b;bo=b;b=if((x-50)^2+(y-50)^2-25^2,0,1)' > dot

AAUUTTHHOORR
       Greg Ward

SSEEEE AALLSSOO
       getinfo(1), icalc(1), pcompos(1), pfilt(1), rpict(1)



RADIANCE                            8/31/96                           PCOMB(1)
