VVISF & VVGL
VVISF::ISFVal Struct Reference

ISFVal describes an ISF value- it has a type (ISFValType) and a type-dependent value. Intended to be immutable. More...

#include <ISFVal.hpp>

Public Member Functions

Constructor functions
 ISFVal ()
 
 ISFVal (const ISFValType &inType)
 
 ISFVal (const ISFValType &inType, const bool &inBool)
 
 ISFVal (const ISFValType &inType, const int32_t &inLong)
 
 ISFVal (const ISFValType &inType, const double &inFloat)
 
 ISFVal (const ISFValType &inType, const double &inX, const double &inY)
 
 ISFVal (const ISFValType &inType, const double *inXY, const size_t inSizeToCopy)
 
 ISFVal (const ISFValType &inType, const double &inR, const double &inG, const double &inB, const double &inA)
 
 ISFVal (const ISFValType &inType, const VVGL::GLBufferRef &inImage)
 
Setter/getter functions

These functions retrieve various properties of the ISFVal instance.

While ISFVal is meant to be immutable, a couple setters are included for populating some of the more complex value types to make life easier.

ISFValType type () const
 Returns the value type.
 
double getDoubleVal () const
 Returns a double describing the value of this object. Safe to call, even if the value type shouldn't be represented by a double.
 
bool getBoolVal () const
 Returns a bool describing the value of this object. Safe to call, even if the value type shouldn't be represented by a bool.
 
int32_t getLongVal () const
 Returns a long describing the value of this object. Safe to call, even if the value type shouldn't be represented by a long.
 
double * getPointValPtr ()
 Returns a null if the receiver isn't a Point2D-type object, otherwise it returns a pointer to the two-element array containing the point values. This pointer is only valid for the lifetime of the receiver.
 
double getPointValByIndex (const int &inIndex)
 Returns 0. if the receiver value type isn't Point2D or the passed index is out of bounds, otherwise it returns the point value at the passed index.
 
void setPointValByIndex (const int &inIndex, const double &inVal)
 Does nothing if the receiver's value type isn't Point2D or the passed index is out of bounds, otherwise it sets the value at the passed index.
 
double * getColorValPtr ()
 Returns a null if the receiver isn't a color-type object, otherwise it returns a pointer to the four-element array containing the color values. This pointer is only valid for the lifetime of the receiver.
 
double getColorValByChannel (const int &inIndex)
 Does nothing if the receiver's value type isn't color or the passed index is out of bounds, otherwise it returns the value of the color channel at the passed index.
 
void setColorValByChannel (const int &inIndex, const double &inVal)
 Does nothing if the receiver's value type isn't color or the passed index is out of bounds, otherwise it sets the value of the color channel at the passed index.
 
VVGL::GLBufferRef imageBuffer () const
 Returns null if the receiver's value type cannot be represented as an image, otherwise it returns the image buffer (almost certainly a GL texture) that is the receiver's value.
 
void setImageBuffer (const VVGL::GLBufferRef &n)
 Does nothing if the receiver's value type cannot be represented as an image, otherwise it sets the receiver's image value with the passed buffer. This buffer will be "retained" for the duration of the receiver's lifetime.
 
string getTypeString () const
 Returns a string describing the type of the receiver.
 
string getValString () const
 Returns a string describing the value of the receiver.
 
Value type queries

Inline functions that simplify the process of checking to see if a given ISFVal matches a particular value type.

bool isNullVal () const
 Returns true if the receiver is a null value.
 
bool isEventVal () const
 Returns true if the receiver is an event value.
 
bool isBoolVal () const
 Returns true if the receiver is a bool value.
 
bool isLongVal () const
 Returns true if the receiver is a long value.
 
bool isFloatVal () const
 Returns true if the receiver is a float value.
 
bool isPoint2DVal () const
 Returns true if the receiver is a point2D value.
 
bool isColorVal () const
 Returns true if the receiver is a color value.
 
bool isCubeVal () const
 Returns true if the receiver is a cube texture value.
 
bool isImageVal () const
 Returns true if the receiver is an image value.
 
bool isAudioVal () const
 Returns true if the receiver is an audio value (image).
 
bool isAudioFFTVal () const
 Returns true if the receiver is an audio fft value (image).
 

Related Functions

(Note that these are not member functions.)

ISFVal creation functions.

These functions create ISFVal instances. Everything here can be done with constructor functions, but the syntax here is a nicer and clearer.

VVISF_EXPORT ISFVal ISFNullVal ()
 Creates and returns a null-type ISFVal.
 
VVISF_EXPORT ISFVal ISFEventVal (const bool &n=false)
 Creates and returns an event-type ISFVal. Events don't technically have a value- events should send a "true" for one frame and a false for every other frame. For convenience, ISFVal uses a bool to cache the event value.
 
VVISF_EXPORT ISFVal ISFBoolVal (const bool &n)
 Creates and returns a boolean-type ISFVal with the passed value.
 
VVISF_EXPORT ISFVal ISFLongVal (const int32_t &n)
 Creates and returns a long-type ISFVal with the passed value.
 
VVISF_EXPORT ISFVal ISFFloatVal (const double &n)
 Creates and returns a float-type ISFVal with the passed value.
 
VVISF_EXPORT ISFVal ISFPoint2DVal (const double &inX, const double &inY)
 Creates and returns a 2d point-type ISFVal with the passed point values.
 
VVISF_EXPORT ISFVal ISFColorVal (const double &inR, const double &inG, const double &inB, const double &inA)
 Creates and returns a color-type ISFVal with the passed R/G/B/A color values.
 
VVISF_EXPORT ISFVal ISFImageVal (const VVGL::GLBufferRef &n)
 Creates and returns an image-type ISFVal with the passed buffer.
 

Detailed Description

ISFVal describes an ISF value- it has a type (ISFValType) and a type-dependent value. Intended to be immutable.


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