1vpGetImage(3) Library Functions Manual vpGetImage(3)
2
3
4
6 vpGetImage - get a field of the intermediate image
7
9 #include <volpack.h>
10
11 vpResult
12 vpGetImage(vpc, image, width, height, scan_bytes, pixel_type,
13 image_type)
14 vpContext *vpc;
15 void *image;
16 int width, height;
17 int scan_bytes;
18 int pixel_type, image_type;
19
21 vpc VolPack context from vpCreateContext.
22
23 image 2D array for storing result image.
24
25 width Width of array in pixels.
26
27 height Height of array in pixels.
28
29 scan_bytes
30 Number of bytes per scanline in array.
31
32 pixel_type
33 Code indicating the format of each pixel in the array.
34
35 image_type
36 Code indicating the source of the image data (VP_IMAGE_BUFFER or
37 VP_SHADOW_BUFFER).
38
40 This is a debugging function. It is used to retrieve the contents of
41 one of the temporary rendering buffers used during rendering, namely
42 the intermediate image or the shadow buffer. Rendering consists of two
43 stages: the volume is resampled and composited into the intermediate
44 image to produce a distorted volume rendering, and then the intermedi‐
45 ate image is warped into the final image. If shadows are enabled then
46 the shadow buffer is used during the first stage to incrementally com‐
47 pute which voxels are illuminated by the light source. This function
48 returns images produced during the first stage, before the final warp.
49
50 This function may be called after a call to one of the rendering rou‐
51 tines (see vpRenderRawVolume(3)). If the image_type argument is
52 VP_IMAGE_BUFFER then data will be copied from the intermediate image.
53 The pixel_type argument specifies what information to copy and the for‐
54 mat for storing the data in the output array. The possible values for
55 pixel_type are the same as for the pixel_type argument to vpSetImage.
56 For instance, use VP_LUMINANCE to extract the grayscale intensity
57 (assuming the current shader produces grayscale pixels).
58
59 If the image_type argument is VP_SHADOW_BUFFER then data will be copied
60 from the shadow buffer. The only valid option for pixel_type is
61 VP_ALPHA, since no color information is stored in the shadow buffer.
62
63 See vpSetImage for details on the pixel formats, the layout of the out‐
64 put array, and the remaining arguments.
65
66 To find the required size for the result array, use vpGeti with the
67 VP_INTERMEDIATE_WIDTH and VP_INTERMEDIATE_HEIGHT options (when
68 image_type is VP_IMAGE_BUFFER) or the VP_SHADOW_WIDTH and
69 VP_SHADOW_HEIGHT options (when image_type is VP_SHADOW_BUFFER).
70
72 The normal return value is VP_OK. The following error return values
73 are possible:
74
75 VPERROR_BAD_SIZE
76 The destination array size is incorrect or there is no interme‐
77 diate image.
78
79 VPERROR_BAD_OPTION
80 The field argument is invalid.
81
83 VolPack(3), vpRenderRawVolume(3), vpGeti(3)
84
85
86
87VolPack vpGetImage(3)