Cortex  10.0.0-a4
Public Member Functions | List of all members
IECore::DataConvert< From, To, Conversion, Enable > Struct Template Reference

#include <DataConvert.h>

Public Member Functions

To::Ptr operator() (typename From::ConstPtr from)
 
To::Ptr operator() (typename From::ConstPtr from, Conversion &c)
 

Detailed Description

template<typename From, typename To, typename Conversion, typename Enable = void>
struct IECore::DataConvert< From, To, Conversion, Enable >

DataConvert is a function object able to convert Simple- and VectorTypedData from one type to another, using a specified Conversion. The ImageReader subclasses, for example use this extensively in order to convert various signed and unsigned data arrays into float arrays in a consistent manner. An example usage might be:

DataConvert< UIntVectorData, FloatVectorData, ScaledDataConversion< unsigned int, float > > converter;
FloatVectorPataPtr result = convert( myUIntVectorDataPtr );

The "Enable" template parameter is for internal use only.

There are two variants of the function, one which constructs the conversion using its default constructor, the other takes an instance of the Conversion class (to allow for external initialization)


The documentation for this struct was generated from the following file: