1vpSetVoxelSize(3) Library Functions Manual vpSetVoxelSize(3)
2
3
4
6 vpSetVoxelSize - define the size of a voxel
7
9 #include <volpack.h>
10
11 vpResult
12 vpSetVoxelSize(vpc, bytes_per_voxel, num_voxel_fields,
13 num_shade_fields, num_classify_fields)
14 vpContext *vpc;
15 int bytes_per_voxel;
16 int num_voxel_fields;
17 int num_shade_fields;
18 int num_classify_fields;
19
21 vpc VolPack context from vpCreateContext.
22
23 bytes_per_voxel
24 Size of one voxel in bytes.
25
26 num_voxel_fields
27 Number of fields in a voxel.
28
29 num_shade_fields
30 Number of voxel fields that are arguments to the shading func‐
31 tion.
32
33 num_classify_fields
34 Number of voxel fields that are arguments to the opacity trans‐
35 fer function.
36
38 vpSetVoxelSize is used to define the size in bytes and the number of
39 fields in a voxel. Each voxel field is analogous to a field in a C
40 structure and the contents of each field is user-defined. See the
41 vpSetVoxelField function (vpSetVoxelField(3)) for setting the size and
42 offset of each field. vpSetVoxelSize should be called before vpSetVox‐
43 elField and before any functions that access the contents of a voxel.
44
45 Typically, some of the voxel fields are used as arguments to a shading
46 function and some (possibly the same) fields are used as arguments to
47 an opacity transfer function (for classification). The fields that are
48 used for shading should come first, i.e. they should have the smallest
49 offsets, followed by any fields that are only used for classification.
50 The classification fields can then be stripped off to save space during
51 the precomputation stage for the fast rendering algorithm. The parame‐
52 ter num_shade_fields indicates the number of fields (starting from the
53 first) that must not be stripped off.
54
55 The parameter num_clsfy_fields indicates the total number of fields
56 that are used as parameters to the opacity transfer function. These
57 fields do not necessarily have to be contiguous, although any fields
58 that are not also used for shading should be the last fields in the
59 voxel.
60
61 If the call to vpSetVoxelSize succeeds, any existing precomputed volume
62 data structures in the context are destroyed.
63
65 The current voxel size parameters can be retrieved with the following
66 state variable codes (see vpGeti(3)): VP_BYTES_PER_VOXEL,
67 VP_VOXEL_FIELD_COUNT, VP_SHADE_FIELD_COUNT, VP_CLASSIFY_FIELD_COUNT.
68
70 The normal return value is VP_OK. The following error return values
71 are possible:
72
73 VPERROR_LIMIT_EXCEEDED
74 The number of voxel fields exceeds the implementation limit.
75 This limit can be increased by editing volpack.h and recompiling
76 the library.
77
78 VPERROR_BAD_VALUE
79 Either num_clsfy_fields or num_shade_fields is out of range.
80
82 VolPack(3), vpCreateContext(3), vpSetVoxelField(3)
83
84
85
86VolPack vpSetVoxelSize(3)