DIPlib Documentation - ©1995-2017 Quantitative Imaging Group, Delft University of Technology.

DIPlib's data types

Pixel values are represented by different types, called data types. DIPlib supports the data types given in the following table:

data typedip_DataTypedata type identifiersuffix
dip_bin8DIP_DT_BIN8DIP_DTID_BIN8_b8
dip_bin16DIP_DT_BIN16DIP_DTID_BIN16_b16
dip_bin32DIP_DT_BIN32DIP_DTID_BIN32_b32
dip_uint8DIP_DT_UINT8DIP_DTID_UINT8_u8
dip_uint16DIP_DT_UINT16DIP_DTID_UINT16_u16
dip_uint32DIP_DT_UINT32DIP_DTID_UINT32_u32
dip_sint8DIP_DT_SINT8DIP_DTID_SINT8_s8
dip_sint16DIP_DT_SINT16DIP_DTID_SINT16_s16
dip_sint32DIP_DT_SINT32DIP_DTID_SINT32_s32
dip_sfloatDIP_DT_SFLOATDIP_DTID_SFLOAT_sfl
dip_dfloatDIP_DT_DFLOATDIP_DTID_DFLOAT_dfl
dip_scomplexDIP_DT_SCOMPLEXDIP_DTID_SCOMPLEX_scx
dip_dcomplexDIP_DT_DCOMPLEXDIP_DTID_DCOMPLEX_dcx

The data types can be divided into five classes: the binary, unsigned integer, signed integer, floating point and complex classes. Different data types in the same class (e.g. dip_uint8 and dip_uint16) provide a different range of values they can represent.

The complex data types are defines as follows:

typedef struct                        typedef struct
{                                     {
   dip_sfloat re;                        dip_dfloat re;
   dip_sfloat im;                        dip_dfloat im;
} dip_scomplex;                       } dip_dcomplex;

The binary data types are simply aliases for a set of corresponding unsigned integer types. The reason for having a separate typedef for the binary types is that they are not used like ordinary integers. Each bit of the integer can store one binary value. When manipulating binary data, care must be taken not to change any of the other bits of the integer used for storing it.

The dip_DataType enumeration is used to represent data types symbolically. It is used in dip_Image's to indicate what the data type of the image is. Data type identifiers are used by the type iterator (see tpi.h) and overload schemes (see ovl.h and overload.h). Type suffixes are used to give type specific routines a unique name. Using a standard set of suffixes enables the type iterator and overload schemes to deal with these type specific routines. The dip_DataType enumeration, data type identifiers and suffixes can be found in the table above.

In addition to the data type identifiers for individual data types, there are also defines to represent an entire group. These are given in the following table:

Data type identifier groupdata types
DIP_DTGID_UINTunsigned integer
DIP_DTGID_UNSIGNEDunsigned integer
DIP_DTGID_SINTsigned integer
DIP_DTGID_INTsigned and unsigned integer
DIP_DTGID_INTEGERsigned and unsigned intege
DIP_DTGID_FLOATfloating-point
DIP_DTGID_REALinteger and floating-point
DIP_DTGID_COMPLEXcomplex floating-point
DIP_DTGID_SIGNEDsigned integer, floating-point and complex
DIP_DTGID_BINARYbinary
DIP_DTGID_ALLall

SEE ALSO

DataTypeGetInfo