Capability Container Types

Top  Previous  Next

Since capability values can be of differing types (strings, integers, floating point values, etc.)  and can be stored in different containers (single values, arrays of values, etc.), the application must be familiar with how DTWAIN handles such differing value types and structures when setting or getting capability values.

 

For each device capability, the TWAIN specification states that setting data into or getting data from the Source requires that the data reside in a certain container (or in other words, data structure).  The data structure describes whether the capability values are single values, arrays of values or range definitions.    The names that TWAIN uses for these structures are TW_ONEVALUE, TW_RANGE, TW_ARRAY, and TW_ENUMERATION.

 

With DTWAIN, the actual TWAIN data structure is not used explicitly by the application.  So the question is:  how does DTWAIN handle these variant types when it is time to describe the structure for the capability values?  The answer is using a universal data structure called a DTWAIN_ARRAY.

 

When the application needs to set or retrieve capability values from the Source, the application needs to either store the values within the DTWAIN_ARRAY or retrieve the values from a DTWAIN_ARRAY, respectively.  This makes setting or retrieving the capability values a trivial task, since knowledge of the actual TWAIN data structure is not necessary.   However, the application must know the data type that the capability supports.  For example, integers, floating point numbers, strings, etc.  The data types for the different capabilities can be found here.