next up previous contents
Next: Shared Library Up: Implementation Previous: Implementation   Contents

Multiple Data Types

Volumetric data can have a variety of data types. The data type can range from unsigned char to float to color. Our goal is to support all the commonly used data types and any new data types that a user might need. For this purpose, we have made use of C++ templates in our implementation. Templates allow writing code for one data type which can be used for other data types without any modifications.

In Section 3.1 we described the data layouts. Since these directly interact with the data, we use templates for this implementation. The volume data layout API is templatized over data type. The different layouts that implement this API can also templatize themselves over the data type enabling the layouts to support any data type. All the layouts which are built into OpenVL are templatized and can be used with any data type. The diagram in Figure 3 actually refers to just one instance of the templatized API. The diagram will replicate for each data type for which the code is instantiated.

The iterator API which provides access to the data in the layouts is also templatized over the data type. The diagram in Figure 4 shows the structure for only one particular data type. This whole structure repeats for all data types for which the code is instantiated.


next up previous contents
Next: Shared Library Up: Implementation Previous: Implementation   Contents
Sarang Lakare 2002-12-23