vpGetImage (3) - Linux Man Pages
vpGetImage: get a field of the intermediate image
NAMEvpGetImage - get a field of the intermediate image
vpGetImage(vpc, image, width, height, scan_bytes,
- pixel_type, image_type)
- vpContext *vpc;
- void *image;
- int width, height;
- int scan_bytes;
- int pixel_type, image_type;
- VolPack context from vpCreateContext.
- 2D array for storing result image.
- Width of array in pixels.
- 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 VP_SHADOW_BUFFER).
DESCRIPTIONThis 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).
ERRORSThe 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.