OSVR-Core
Namespaces | Classes | Typedefs | Enumerations | Functions
osvr::util Namespace Reference

The Util library: Functionality not necessarily coupled to any particular core library, serving more as a common base layer behind all systems. More...

Namespaces

 container_policies
 Flags or arguments to specify what features you want ContainerWrapper to provide publicly.
 
 eigen_interop
 Namespace containing const_map() and map() function implementations/overloads to allow easy interoperation of OSVR types and Eigen types.
 
 filters
 Filters for use with Eigen datatypes.
 
 messagekeys
 Contains methods to retrieve the constant strings identifying message or sender types.
 
 time
 Functionality related to time and the OSVR_TimeValue abstraction.
 
 tree
 Contains a generic tree.
 
 typesafeid_traits
 Namespace for traits templates associated with osvr::util::TypeSafeId.
 
 unique_container_policies
 Policies controlling behavior of UniqueContainer.
 

Classes

class  AlignedAllocDeleter
 Deleter class matching alignedAlloc. More...
 
class  AnyMap
 A data structure storing "any" by name, to reduce coupling. More...
 
class  BasicKeyedOwnershipContainer
 Holds on to smart pointers by value, and lets you free them by providing the corresponding void *. More...
 
class  CallbackWrapper
 A class template turning a callback with some number of arguments, with a userdata pointer last, into a function object. More...
 
class  CellGroupProxy
 A class that exists to make it easier to output composite data structures to CSV. More...
 
struct  Conditional
 Quick C++11-aligned conditional (if/then/elese) implementation. More...
 
struct  Conditional< false, Then, Else >
 
class  CSV
 The "traditional" CSV class: get all your data set up ahead of time. More...
 
class  CSVBase
 (Base) Class for easily outputting CSV files. More...
 
class  DefaultBool
 A class template primarily useful for flags, that has a defined value at default initialization. More...
 
class  Deletable
 Base class for objects that just need to be generically deletable. More...
 
class  DummyGuard
 
struct  EnableIf
 Quick C++11-aligned enable_if implementation. More...
 
struct  EnableIf< true, T >
 
class  FinalTask
 Allows you to run a callable something at the end of a scope. More...
 
class  Flag
 A class that lightly wraps a bool, in order to provide easier maintenance of a "dirty" flag, for example, with sensible default initialization and no short-circuiting. More...
 
class  GuardInterface
 An interface to a (deferred) guard class: after instantiation and lock returning true, some resource is locked and available until destruction. More...
 
struct  HashIdAggregate
 Template specialized for common aggregates of TypeSafeIds, with the intent that you can simply open namespace std and derive your specialization of struct hash from this. More...
 
struct  HashIdAggregate< std::pair< TypeSafeId< FirstTag >, TypeSafeId< SecondTag > > >
 
class  IndentingStream
 A boost::iostreams::filtering_ostream with a constructor that automatically sets it up to indent the first character after a newline the given number of spaces and forward the output to a std::ostream. More...
 
class  MultipleReferenceOwnershipPolicy
 
class  NumberTypeData
 Runtime data on numeric types. More...
 
class  PointerWrapper
 A wrapper to easily define structures that exist just to hold a pointer. More...
 
class  Rect
 
class  ResourcePath
 Class representing a host and resource path in the OSVR logical system. More...
 
class  SingleOwnershipPolicy
 
class  StreamCSV
 A CSV object taking a reference to an ostream that should remain valid throughout the entire lifetime of this object. More...
 
class  StringBufferBuilder
 A utility class to adapt APIs that first provide a length, then place a string in a user-allocated buffer, to nearly transparently handle the buffer and convert into a std::string. More...
 
class  TypeSafeId
 
class  TypeSafeIdBase
 A generic typesafe (as long as you use differing tag types) wrapper for identifiers (typically integers). More...
 
class  TypeSafeIdRefAccessorBase
 
class  UniqueContainer
 A "Unique Container" designed for composition, not inheritance. More...
 
class  UniqueContainerBase
 A policy-based generic "Unique Container", that wraps ContainerWrapper (and thus an underlying container) with set-like semantics/invariant: at most one instance of a value is in the container at a time. More...
 
class  ValueOrRange
 Class providing a unified container-like interface to either a single value or a range of integers. More...
 

Typedefs

using AlignedPtr = unique_ptr< void, AlignedAllocDeleter >
 
using AlignedImageBufferPtr = unique_ptr< OSVR_ImageBufferElement, AlignedAllocDeleter >
 
template<typename System , typename Y = double>
using AngleGeneric = boost::units::quantity< boost::units::unit< boost::units::plane_angle_dimension, System >, Y >
 Convenience template alias for a plane_angle quantity in an arbitrary system with arbitrary scalar.
 
template<typename Y >
using AngleRadians = boost::units::quantity< boost::units::si::plane_angle, Y >
 Alias for an angle in radians with arbitrary scalar type.
 
template<typename Y >
using AngleDegrees = boost::units::quantity< boost::units::degree::plane_angle, Y >
 Alias for an angle in degrees with arbitrary scalar type.
 
typedef AngleRadians< double > AngleRadiansd
 
typedef AngleDegrees< double > AngleDegreesd
 
typedef AngleRadiansd Angle
 Default angle type.
 
template<typename Container , typename... Args>
using ContainerWrapper = detail::ContainerWrapper_t< Container, Args... >
 Parent class to inherit from to get a container with some functionality exposed. More...
 
using ColMatrix44d = Eigen::Matrix4d
 
using ColVector3d = Eigen::Vector3d
 
using ColVector4d = Eigen::Vector4d
 
using RowMatrix44d = Eigen::Matrix< double, 4, 4, Eigen::RowMajor >
 
template<typename Scalar >
using Isometry3 = Eigen::Transform< Scalar, 3, Eigen::Isometry >
 
template<typename Scalar >
using Translation3 = Eigen::Translation< Scalar, 3 >
 
typedef unique_ptr< util::GuardInterfaceGuardPtr
 
typedef BasicKeyedOwnershipContainer< SingleOwnershipPolicyKeyedOwnershipContainer
 
typedef BasicKeyedOwnershipContainer< MultipleReferenceOwnershipPolicyMultipleKeyedOwnershipContainer
 
typedef Rect Rectd
 
template<std::size_t minBytes, bool isSigned = false>
using sized_int_t = typename detail::sized_int< minBytes, isSigned >::type
 Alias providing an integer type (signed or unsigned, your choice) containing at least as many bytes as you requested. More...
 
typedef shared_ptr< DeletableDeletablePtr
 Shared-ownership smart pointer to a Deletable.
 
typedef ::std::vector< DeletablePtrDeletableList
 Vector of shared-ownership smart pointers.
 
typedef TypeSafeId< LocalStringIdTag > StringID
 
typedef TypeSafeId< PeerStringIdTag > PeerStringID
 

Enumerations

enum  { DefaultOSVRPort = 3883, DefaultVRPNPort = 3883 }
 
enum  { UseDefaultPort = -1, OmitAppendingPort = -2 }
 

Functions

void * alignedAlloc (size_t bytes, size_t alignment=OSVR_DEFAULT_ALIGN_SIZE)
 Aligned allocation function, gives a pointer to a block of memory aligned to a memory boundary. More...
 
void alignedFree (void *p)
 Aligned deallocation function, uses the pointer to the original memory block to deallocate it. More...
 
AlignedPtr makeAlignedBuffer (size_t bytes, size_t alignment=OSVR_DEFAULT_ALIGN_SIZE)
 
AlignedImageBufferPtr makeAlignedImageBuffer (size_t bytes, size_t alignment=OSVR_DEFAULT_ALIGN_SIZE)
 
template<typename System , typename Y >
getRadians (AngleGeneric< System, Y > const angle)
 Get the raw scalar value of your angle in radians.
 
template<typename System , typename Y >
getDegrees (AngleGeneric< System, Y > const angle)
 Get the raw scalar value of your angle in degrees.
 
OSVR_UTIL_EXPORT std::string getBinaryLocation ()
 Get this binary's location, often as a step in finding the "root" and search paths. More...
 
template<typename T >
detail::Cell< Tcell (const char *header, T const &data)
 Helper free function to make a CSV cell.
 
template<typename T >
detail::Cell< Tcell (std::string const &header, T const &data)
 Helper free function to make a CSV cell.
 
template<typename RowProxyType , typename GroupTag , typename... CellArgs>
CellGroupProxy< RowProxyType, GroupTag > & operator<< (CellGroupProxy< RowProxyType, GroupTag > &group, detail::Cell< CellArgs... > &&currentCell)
 Handles user results from overloading operator<<(CellGroupProxy<RowProxyType, GroupTag> &group, TheirThing) and sending in cell calls within it. More...
 
template<typename T >
detail::CellGroup< TcellGroup (const char *groupHeader, T const &data)
 Helper function to create a cell group with a group header prefix.
 
template<typename T >
detail::CellGroup< T, std::string > cellGroup (std::string const &groupHeader, T const &data)
 Helper function to create a cell group with a group header prefix.
 
template<typename Tag , typename T >
detail::CellGroup< T, const char *, Tag > cellGroup (const char *groupHeader, T const &data, Tag *=static_cast< Tag *>(nullptr))
 Helper function to create a cell group with a group header prefix and explicit (non-default) tag. More...
 
template<typename Tag , typename T >
detail::CellGroup< T, std::string, Tag > cellGroup (std::string const &groupHeader, T const &data, Tag *=static_cast< Tag *>(nullptr))
 Helper function to create a cell group with a group header prefix and explicit (non-default) tag. More...
 
template<typename T >
detail::CellGroup< TcellGroup (T const &data)
 Helper function to create a cell group with no group header prefix - warning: column headers must be unique!
 
template<typename Tag , typename T >
detail::CellGroup< T, const char *, Tag > cellGroup (T const &data, Tag *=static_cast< Tag *>(nullptr))
 Helper function to create a cell group with no group header prefix and explicit (non-default) tag - warning: column headers must be unique!
 
template<typename T >
void operator<< (CellGroupProxy< T, DefaultGroupTag > &group, time::TimeValue const &tv)
 
template<typename T >
void operator<< (CellGroupProxy< T, AbbreviatedTimeMemberFieldsTag > &group, time::TimeValue const &tv)
 
template<typename T >
void operator<< (CellGroupProxy< T, DecimalTimeFieldTag > &group, time::TimeValue const &tv)
 
template<typename T >
void operator<< (CellGroupProxy< T, DefaultGroupTag > &group, OSVR_Vec3 const &v)
 
template<typename T >
void operator<< (CellGroupProxy< T, DefaultGroupTag > &group, OSVR_Quaternion const &q)
 
template<typename Derived >
detail::SameLayoutVector< 4, Derived > makeHomogeneousPoint (Eigen::MatrixBase< Derived > const &vec)
 Makes a 3D vector into a 4D homogeneous point, with the same options (scalar, row vs col vector) as the input. More...
 
template<typename Derived >
detail::SameLayoutVector< 4, Derived > makeHomogeneousVector (Eigen::MatrixBase< Derived > const &vec)
 Makes a 3D vector into a 4D homogeneous vector, with the same options (scalar, row vs col vector) as the input. More...
 
template<typename Derived >
detail::SameLayoutVector< 3, Derived > extractPoint (Eigen::MatrixBase< Derived > const &homogenous)
 Pulls the 3D point or vector from a 4D vec, performing division by w if it is nonzero. More...
 
template<typename Derived1 , typename Derived2 >
Isometry3< typename Derived1::Scalar > makeIsometry (Eigen::MatrixBase< Derived1 > const &translation, Eigen::RotationBase< Derived2, 3 > const &rotation)
 A simpler, functional-style alternative to .fromPositionOrientationScale when no scaling is performed. More...
 
Eigen::Quaterniond flipQuatSignToMatch (Eigen::Quaterniond const &refQ, Eigen::Quaterniond const &q)
 
Eigen::Map< Eigen::Vector3d > vecMap (OSVR_Vec3 &vec)
 Wrap an OSVR_Vec3 in an Eigen object that allows it to interoperate with Eigen as though it were an Eigen::Vector3d. More...
 
Eigen::Map< const Eigen::Vector3d > vecMap (OSVR_Vec3 const &vec)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. For constant vectors. More...
 
Eigen::Quaterniond fromQuat (OSVR_Quaternion const &q)
 Convert an OSVR_Quaternion to an Eigen::Quaterniond.
 
void toQuat (Eigen::Quaterniond const &src, OSVR_Quaternion &q)
 Convert an Eigen::Quaterniond to a OSVR_Quaternion.
 
Eigen::Isometry3d fromPose (OSVR_Pose3 const &pose)
 Turn an OSVR_Pose3 into an Eigen::Transform. More...
 
void toPose (Eigen::Isometry3d const &xform, OSVR_Pose3 &pose)
 Turn an Eigen::Isometry3d (transform) into an OSVR_Pose3. More...
 
void toPose (Eigen::Matrix4d const &mat, OSVR_Pose3 &pose)
 Turn an Eigen::Matrix4d (transform) into an OSVR_Pose3. More...
 
template<typename T >
auto extractYaw (T const &quat) -> decltype(std::atan(quat.w()))
 A utility function to extract "yaw" out of a quaternion, of any representation as long as it responds to .w(), .x(), .y(), and .z(). More...
 
template<typename F >
FinalTask< F > finally (F &&f)
 Creation free function for final tasks to run on scope exit. More...
 
template<typename F >
FinalTask< F > finally (F const &f)
 
template<typename T >
void generic_deleter (void *obj)
 Generic deleter function, wrapping the stock delete call. More...
 
OSVR_UTIL_EXPORT boost::optional< std::string > getEnvironmentVariable (std::string const &var)
 Gets an environment variable's value. More...
 
template<typename Scalar , typename T >
void matrixEigenAssign (T const &src, OSVR_MatrixConventions flags, Scalar *dest)
 Helper function template to assign/convert matrices as required. More...
 
template<typename Functor >
bool opencvTypeDispatch (int openCVType, Functor &f)
 Given an OpenCV type depth and a reference to a functor, calls that functor with a single parameter: the corresponding type wrapped in boost::mpl::identity. More...
 
NumberTypeData opencvNumberTypeData (int openCVType)
 
int cvTypeFromData (bool isSigned, bool isFloat, size_t depth)
 Computes the OpenCV "type" (also known as depth - as in CV_8U) for a given combination of signed, float, and byte depth. More...
 
int computeOpenCVMatType (OSVR_ImagingMetadata const &metadata)
 Computes the OpenCV matrix type (as in CV_8UC3) from a metadata struct.
 
std::pair< std::string, std::string > convertProgramOptionShowHideIntoTrueFalse (std::string s)
 An "additional parser" for Boost.Program_options that will turn any –hide-xyz into –xyz false and –show-xyz into –xyz true.
 
Eigen::Matrix4d createProjectionMatrix (Rectd const &bounds, double near, double far)
 Takes in points at the near clipping plane, as well as the near and far clipping planes. More...
 
template<projection_options::OptionType options = projection_options::ZOutputSigned | projection_options::RightHandedInput>
Eigen::Matrix4d parameterizedCreateProjectionMatrix (Rectd const &bounds, double near, double far)
 Takes in points at the near clipping plane, as well as the near and far clipping planes. More...
 
template<typename System >
Rectd computeSymmetricFOVRect (AngleGeneric< System > hFov, AngleGeneric< System > vFov)
 Compute a rectangle at unit distance for the given fov values.
 
template<typename System >
Rectd computeSymmetricFOVRect (AngleGeneric< System > hFov, AngleGeneric< System > vFov, double near)
 Compute a rectangle at the near clipping plane for the given fov values. More...
 
template<typename System >
Eigen::Matrix4d createSymmetricProjectionMatrix (AngleGeneric< System > hFov, AngleGeneric< System > vFov, double near, double far)
 
template<typename StreamType , typename Scalar >
StreamType & operator<< (StreamType &os, Rect< Scalar > const &rect)
 
template<typename RangeType >
void resetPointerRange (RangeType range)
 Reset every smart pointer in a container one by one.
 
template<size_t N>
std::string makeString (const char(&arrayLiteral)[N])
 Safely and easily convert a literal array of characters (like from osvr_json_to_c) into a std::string. More...
 
template<typename Tag , typename T >
detail::CellGroup< T, Tag > cellGroup (const char *groupHeader, T const &data, Tag *=static_cast< Tag *>(nullptr))
 Helper function to create a cell group with a group header prefix and explicit (non-default) tag. More...
 
template<typename Tag , typename T >
detail::CellGroup< T, Tag > cellGroup (T const &data, Tag *=static_cast< Tag *>(nullptr))
 Helper function to create a cell group with no group header prefix and explicit (non-default) tag - warning: column headers must be unique!
 
template<typename T >
void operator<< (CellGroupProxy< T, DefaultGroupTag > &group, Eigen::Vector3d const &v)
 
template<typename T >
void operator<< (CellGroupProxy< T, DefaultGroupTag > &group, Eigen::Quaterniond const &q)
 
Eigen::Vector3d getEuler (Eigen::Quaterniond const &q)
 
template<typename T >
void operator<< (CellGroupProxy< T, QuatAsEulerTag > &group, Eigen::Vector3d const &euler)
 
template<typename T >
void operator<< (CellGroupProxy< T, QuatAsEulerTag > &group, Eigen::Quaterniond const &q)
 

Detailed Description

The Util library: Functionality not necessarily coupled to any particular core library, serving more as a common base layer behind all systems.

Typedef Documentation

§ ContainerWrapper

template<typename Container , typename... Args>
using osvr::util::ContainerWrapper = typedef detail::ContainerWrapper_t<Container, Args...>

Parent class to inherit from to get a container with some functionality exposed.

Template Parameters
Containerthe underlying container you want, reference accessible via Base::container()
Args0 or more tag types from osvr::util::container_policies indicating the features you want publicly exposed

§ sized_int_t

template<std::size_t minBytes, bool isSigned = false>
using osvr::util::sized_int_t = typedef typename detail::sized_int<minBytes, isSigned>::type

Alias providing an integer type (signed or unsigned, your choice) containing at least as many bytes as you requested.

Enumeration Type Documentation

§ anonymous enum

anonymous enum
Enumerator
DefaultOSVRPort 
Todo:
Update this for 1.0!

§ anonymous enum

anonymous enum
Enumerator
OmitAppendingPort 

For use when there may not actually be a port in use: some single process situations, etc.

Function Documentation

§ alignedAlloc()

void* osvr::util::alignedAlloc ( size_t  bytes,
size_t  alignment = OSVR_DEFAULT_ALIGN_SIZE 
)
inline

Aligned allocation function, gives a pointer to a block of memory aligned to a memory boundary.

§ alignedFree()

void osvr::util::alignedFree ( void *  p)
inline

Aligned deallocation function, uses the pointer to the original memory block to deallocate it.

§ cellGroup() [1/3]

template<typename Tag , typename T >
detail::CellGroup<T, Tag> osvr::util::cellGroup ( const char *  groupHeader,
T const &  data,
Tag *  = static_cast<Tag *>(nullptr) 
)
inline

Helper function to create a cell group with a group header prefix and explicit (non-default) tag.

§ cellGroup() [2/3]

template<typename Tag , typename T >
detail::CellGroup<T, const char *, Tag> osvr::util::cellGroup ( const char *  groupHeader,
T const &  data,
Tag *  = static_cast<Tag *>(nullptr) 
)
inline

Helper function to create a cell group with a group header prefix and explicit (non-default) tag.

§ cellGroup() [3/3]

template<typename Tag , typename T >
detail::CellGroup<T, std::string, Tag> osvr::util::cellGroup ( std::string const &  groupHeader,
T const &  data,
Tag *  = static_cast<Tag *>(nullptr) 
)
inline

Helper function to create a cell group with a group header prefix and explicit (non-default) tag.

§ computeSymmetricFOVRect()

template<typename System >
Rectd osvr::util::computeSymmetricFOVRect ( AngleGeneric< System >  hFov,
AngleGeneric< System >  vFov,
double  near 
)
inline

Compute a rectangle at the near clipping plane for the given fov values.

§ createProjectionMatrix()

Eigen::Matrix4d osvr::util::createProjectionMatrix ( Rectd const &  bounds,
double  near,
double  far 
)
inline

Takes in points at the near clipping plane, as well as the near and far clipping planes.

Result matrix maps [l, r] and [b, t] to [-1, 1], and [n, f] to [-1, 1] (should be configurable)

Resulting matrix operates on Eigen::Vector4d, which are row-matrices - transpose if you want it to work on column matrices.

Todo:
Look into using Eigen::Projective3d?

§ createSymmetricProjectionMatrix()

template<typename System >
Eigen::Matrix4d osvr::util::createSymmetricProjectionMatrix ( AngleGeneric< System >  hFov,
AngleGeneric< System >  vFov,
double  near,
double  far 
)
inline

Note that because we delegate to the fully-generic projection matrix code, we'll end up computing two entries in the third column that will always be zero (and other computations may include an unnecessary addition/subtraction). But, only one place to introduce bugs.

§ cvTypeFromData()

int osvr::util::cvTypeFromData ( bool  isSigned,
bool  isFloat,
size_t  depth 
)
inline

Computes the OpenCV "type" (also known as depth - as in CV_8U) for a given combination of signed, float, and byte depth.

§ extractPoint()

template<typename Derived >
detail::SameLayoutVector<3, Derived> osvr::util::extractPoint ( Eigen::MatrixBase< Derived > const &  homogenous)
inline

Pulls the 3D point or vector from a 4D vec, performing division by w if it is nonzero.

§ extractYaw()

template<typename T >
auto osvr::util::extractYaw ( T const &  quat) -> decltype(std::atan(quat.w()))
inline

A utility function to extract "yaw" out of a quaternion, of any representation as long as it responds to .w(), .x(), .y(), and .z().

Uses atan2() internally, and the return type is automatically deduced based on the scalar type in use in your quaternion class.

Reference: http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/

§ finally() [1/2]

template<typename F >
FinalTask<F> osvr::util::finally ( F &&  f)
inline

Creation free function for final tasks to run on scope exit.

Works great when paired with lambdas (particularly with [&] reference capture). Use like: auto f = finally([&]{ dothis(); }); to have dothis() called when f goes out of scope, no matter how.

Perfect forwarding version.

§ finally() [2/2]

template<typename F >
FinalTask<F> osvr::util::finally ( F const &  f)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

§ generic_deleter()

template<typename T >
void osvr::util::generic_deleter ( void *  obj)
inline

Generic deleter function, wrapping the stock delete call.

Used in header-only C++ wrappers over C APIs.

§ getBinaryLocation()

std::string osvr::util::getBinaryLocation ( )

Get this binary's location, often as a step in finding the "root" and search paths.

§ getEnvironmentVariable()

boost::optional< std::string > osvr::util::getEnvironmentVariable ( std::string const &  var)

Gets an environment variable's value.

A real implementation of the functionality.

On systems that don't distinguish between having a variable defined and having it non-empty (like Windows), empty will imply not defined and thus an empty boost::optional return value.

§ getEuler()

Eigen::Vector3d osvr::util::getEuler ( Eigen::Quaterniond const &  q)
inline

Convert an Eigen quat to a Quatlib quat.

§ makeHomogeneousPoint()

template<typename Derived >
detail::SameLayoutVector<4, Derived> osvr::util::makeHomogeneousPoint ( Eigen::MatrixBase< Derived > const &  vec)
inline

Makes a 3D vector into a 4D homogeneous point, with the same options (scalar, row vs col vector) as the input.

§ makeHomogeneousVector()

template<typename Derived >
detail::SameLayoutVector<4, Derived> osvr::util::makeHomogeneousVector ( Eigen::MatrixBase< Derived > const &  vec)
inline

Makes a 3D vector into a 4D homogeneous vector, with the same options (scalar, row vs col vector) as the input.

§ makeIsometry()

template<typename Derived1 , typename Derived2 >
Isometry3<typename Derived1::Scalar> osvr::util::makeIsometry ( Eigen::MatrixBase< Derived1 > const &  translation,
Eigen::RotationBase< Derived2, 3 > const &  rotation 
)
inline

A simpler, functional-style alternative to .fromPositionOrientationScale when no scaling is performed.

§ makeString()

template<size_t N>
std::string osvr::util::makeString ( const char(&)  arrayLiteral[N])
inline

Safely and easily convert a literal array of characters (like from osvr_json_to_c) into a std::string.

§ matrixEigenAssign()

template<typename Scalar , typename T >
void osvr::util::matrixEigenAssign ( T const &  src,
OSVR_MatrixConventions  flags,
Scalar *  dest 
)
inline

Helper function template to assign/convert matrices as required.

Handles memory ordering (transpose) and scalar type conversion automatically/based on the flags passed in.

Parameters
srcAn Eigen 4x4 fixed-size matrix or matrix expression (source)
flagsSome matrix convention flags - only the first two (the ones that affect if a transpose is needed) are observed.
destA pointer to a contiguous 16-element array (destination for the copy)

§ opencvTypeDispatch()

template<typename Functor >
bool osvr::util::opencvTypeDispatch ( int  openCVType,
Functor f 
)
inline

Given an OpenCV type depth and a reference to a functor, calls that functor with a single parameter: the corresponding type wrapped in boost::mpl::identity.

Returns
false if we couldn't recognize the OpenCV type and thus didn't call your functor.

§ operator<<()

template<typename RowProxyType , typename GroupTag , typename... CellArgs>
CellGroupProxy< RowProxyType, GroupTag > & osvr::util::operator<< ( CellGroupProxy< RowProxyType, GroupTag > &  group,
detail::Cell< CellArgs... > &&  currentCell 
)
inline

Handles user results from overloading operator<<(CellGroupProxy<RowProxyType, GroupTag> &group, TheirThing) and sending in cell calls within it.

§ parameterizedCreateProjectionMatrix()

template<projection_options::OptionType options = projection_options::ZOutputSigned | projection_options::RightHandedInput>
Eigen::Matrix4d osvr::util::parameterizedCreateProjectionMatrix ( Rectd const &  bounds,
double  near,
double  far 
)
inline

Takes in points at the near clipping plane, as well as the near and far clipping planes.

Result matrix maps [l, r] and [b, t] to [-1, 1], and [n, f] to [-1, 1] or [0, 1] depending on presence/absence of ZOutputUnsigned flag bit, taking in right- or left-handed input also as configured.