Man Linux: Main Page and Category List


       vpGetImage - get a field of the intermediate image


       #include <volpack.h>

       vpGetImage(vpc,   image,   width,   height,   scan_bytes,   pixel_type,
           vpContext *vpc;
           void *image;
           int width, height;
           int scan_bytes;
           int pixel_type, image_type;


       vpc    VolPack context from vpCreateContext.

       image  2D array for storing result image.

       width  Width of array in pixels.

       height Height of array in pixels.

              Number of bytes per scanline in array.

              Code indicating the format of each pixel in the array.

              Code indicating the source of the image data (VP_IMAGE_BUFFER or


       This  is  a debugging function.  It is used to retrieve the contents of
       one of the temporary rendering buffers used  during  rendering,  namely
       the intermediate image or the shadow buffer.  Rendering consists of two
       stages: the volume is resampled and composited  into  the  intermediate
       image   to   produce   a  distorted  volume  rendering,  and  then  the
       intermediate image is warped into the  final  image.   If  shadows  are
       enabled  then  the  shadow  buffer  is  used  during the first stage to
       incrementally compute which voxels are illuminated by the light source.
       This  function  returns  images produced during the first stage, before
       the final warp.

       This function may be called after  a  call  to  one  of  the  rendering
       routines  (see  vpRenderRawVolume(3)).   If  the image_type argument is
       VP_IMAGE_BUFFER then data will be copied from the  intermediate  image.
       The  pixel_type  argument  specifies  what  information to copy and the
       format for storing the data in the output array.  The  possible  values
       for  pixel_type  are  the  same  as  for  the  pixel_type  argument  to
       vpSetImage.  For instance, use VP_LUMINANCE to  extract  the  grayscale
       intensity (assuming the current shader produces grayscale pixels).

       If the image_type argument is VP_SHADOW_BUFFER then data will be copied
       from the shadow buffer.   The  only  valid  option  for  pixel_type  is
       VP_ALPHA, since no color information is stored in the shadow buffer.

       See  vpSetImage  for  details  on  the pixel formats, the layout of the
       output array, and the remaining arguments.

       To find the required size for the result array,  use  vpGeti  with  the
       VP_INTERMEDIATE_WIDTH    and   VP_INTERMEDIATE_HEIGHT   options   (when
       image_type   is   VP_IMAGE_BUFFER)   or   the    VP_SHADOW_WIDTH    and
       VP_SHADOW_HEIGHT options (when image_type is VP_SHADOW_BUFFER).


       The  normal  return  value is VP_OK.  The following error return values
       are possible:

              The  destination  array  size  is  incorrect  or  there  is   no
              intermediate image.

              The field argument is invalid.


       VolPack(3), vpRenderRawVolume(3), vpGeti(3)