Lumiverse  2.5
A framework for creating lighting control applications
Functions
Lumiverse::LumiverseTypeUtils Namespace Reference

Functions to make life with Lumiverse generic types easier. More...

Functions

LumiverseTypecopy (LumiverseType *data)
 Copies a LumiverseType and returns an abstracted pointer to the new value. More...
 
void copyByVal (LumiverseType *source, LumiverseType *target)
 Copies the data from source into target. More...
 
bool equals (LumiverseType *lhs, LumiverseType *rhs)
 Compares two generic LumiverseType pointers for equality. More...
 
int cmp (LumiverseType *lhs, LumiverseType *rhs)
 Compares two LumiverseType objects. More...
 
shared_ptr< LumiverseTypelerp (LumiverseType *lhs, LumiverseType *rhs, float t)
 Lerps the values of a LumiverseType and returns the value. More...
 
bool areSameType (LumiverseType *lhs, LumiverseType *rhs)
 Checks the types of two LumiverseType objects. More...
 
Eigen::Matrix3f getRotationMatrix (Eigen::Vector3f lookat, Eigen::Vector3f up, LumiverseOrientation pan, LumiverseOrientation tilt)
 Returns a rotation matrix given the up vector, look at vector, the pan, and tilt.
 
Eigen::Matrix3f getRotationMatrix (Eigen::Vector3f lookat, Eigen::Vector3f axis)
 Rotates the unit vector axis to the lookat vector.
 
bool lessThan (LumiverseType *lhs, LumiverseType *rhs)
 Compares two LumiverseTypes with <. More...
 
void scaleParam (LumiverseType *val, float scale)
 Multiplies a parameter by a constant value (typically from 0 to 1, but no limits are enforced in this function). More...
 
LumiverseTypeloadFromJSON (JSONNode node)
 Loads a LumiverseType from a JSON node.
 
LumiverseOrientationtypeToOrientationRef (LumiverseType *data)
 
LumiverseColortypeToColorRef (LumiverseType *data)
 
LumiverseFloattypeToFloatRef (LumiverseType *data)
 

Detailed Description

Functions to make life with Lumiverse generic types easier.

This namespace contains utility functions for manipulating and comparing LumiverseType objects. As new types are added, these functions will be updated as needed to handle the new types.

See also
LumiverseType, LumiverseFloat, LumiverseEnum

Function Documentation

bool Lumiverse::LumiverseTypeUtils::areSameType ( LumiverseType lhs,
LumiverseType rhs 
)

Checks the types of two LumiverseType objects.

Returns
True if lhs and rhs are not null and both the same type
int Lumiverse::LumiverseTypeUtils::cmp ( LumiverseType lhs,
LumiverseType rhs 
)

Compares two LumiverseType objects.

Returns
0 if lhs and rhs are equal, 1 if lhs > rhs, -1 if lhs < rhs, -2 if lhs and rhs are not the same type, are null, or are of unknown type
LumiverseType * Lumiverse::LumiverseTypeUtils::copy ( LumiverseType data)

Copies a LumiverseType and returns an abstracted pointer to the new value.

Returns
Pointer to a copy of the type or nullptr if type is unknown to the Lumiverse system. Memory is allocated for a copy, caller must free.
void Lumiverse::LumiverseTypeUtils::copyByVal ( LumiverseType source,
LumiverseType target 
)

Copies the data from source into target.

Parameters
sourcePointer to the data source
targetPointer to the copy location
bool Lumiverse::LumiverseTypeUtils::equals ( LumiverseType lhs,
LumiverseType rhs 
)

Compares two generic LumiverseType pointers for equality.

Identifies the type of the objects and then invokes the proper comparison.

Parameters
lhsObject on the left hand side
rhsObject on the right hand side
shared_ptr< LumiverseType > Lumiverse::LumiverseTypeUtils::lerp ( LumiverseType lhs,
LumiverseType rhs,
float  t 
)

Lerps the values of a LumiverseType and returns the value.

Returns
Value of the lerp in a new LumiverseType object. Value is equal to lhs * (1 - t) + rhs * t.
bool Lumiverse::LumiverseTypeUtils::lessThan ( LumiverseType lhs,
LumiverseType rhs 
)

Compares two LumiverseTypes with <.

Uses cmp to determin this inequality.

Returns
true if lhs < rhs
void Lumiverse::LumiverseTypeUtils::scaleParam ( LumiverseType val,
float  scale 
)

Multiplies a parameter by a constant value (typically from 0 to 1, but no limits are enforced in this function).

Parameters
valLumiverseType to scale.
scaleThe scaling factor.