HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
c-paramlist.h File Reference
+ Include dependency graph for c-paramlist.h:

Go to the source code of this file.

Typedefs

typedef struct OIIO_ParamValue OIIO_ParamValue
 

Enumerations

enum  OIIO_ParamValue_Interp { OIIO_ParamValue_INTERP_CONSTANT = 0, OIIO_ParamValue_INTERP_PERPIECE = 1, OIIO_ParamValue_INTERP_LINEAR = 2, OIIO_ParamValue_INTERP_VERTEX = 3 }
 

Functions

OIIOC_API OIIO_ParamValueOIIO_ParamValue_new (const char *name, OIIO_TypeDesc type, int nvalues, int interp, const void *value, bool copy)
 Construct a new OIIO_ParamValue. More...
 
OIIOC_API OIIO_ParamValueOIIO_ParamValue_from_string (const char *name, OIIO_TypeDesc type, const char *string)
 
OIIOC_API OIIO_ParamValueOIIO_ParamValue_copy (OIIO_ParamValue *pv)
 
OIIOC_API void OIIO_ParamValue_delete (const OIIO_ParamValue *pv)
 
OIIOC_API void OIIO_ParamValue_init (OIIO_ParamValue *pv, const char *name, OIIO_TypeDesc type, int nvalues, int interp, const void *value, bool copy)
 
OIIOC_API const char * OIIO_ParamValue_name (const OIIO_ParamValue *pv)
 
OIIOC_API OIIO_TypeDesc OIIO_ParamValue_type (const OIIO_ParamValue *pv)
 
OIIOC_API int OIIO_ParamValue_nvalues (const OIIO_ParamValue *pv)
 
OIIOC_API const voidOIIO_ParamValue_data (const OIIO_ParamValue *pv)
 
OIIOC_API int OIIO_ParamValue_datasize (const OIIO_ParamValue *pv)
 
OIIOC_API int OIIO_ParamValue_interp (const OIIO_ParamValue *pv)
 
OIIOC_API bool OIIO_ParamValue_is_nonlocal (const OIIO_ParamValue *pv)
 
OIIOC_API int OIIO_ParamValue_get_int (const OIIO_ParamValue *pv, int defaultval)
 
OIIOC_API int OIIO_ParamValue_get_int_indexed (const OIIO_ParamValue *pv, int index, int defaultval)
 
OIIOC_API float OIIO_ParamValue_get_float (const OIIO_ParamValue *pv, float defaultval)
 
OIIOC_API float OIIO_ParamValue_get_float_indexed (const OIIO_ParamValue *pv, int index, float defaultval)
 
OIIOC_API void OIIO_ParamValue_get_string (const OIIO_ParamValue *pv, int max_num_strings, char *buffer, int buffer_len)
 
OIIOC_API void OIIO_ParamValue_get_string_indexed (const OIIO_ParamValue *pv, int index, char *buffer, int buffer_len)
 

Typedef Documentation

OIIO_ParamValue holds a parameter and a pointer to its value(s)

Nomenclature: if you have an array of 4 colors for each of 15 points...

  • There are 15 VALUES
  • Each value has an array of 4 ELEMENTS, each of which is a color
  • A color has 3 COMPONENTS (R, G, B)

Definition at line 22 of file c-paramlist.h.

Enumeration Type Documentation

Enumerator
OIIO_ParamValue_INTERP_CONSTANT 
OIIO_ParamValue_INTERP_PERPIECE 
OIIO_ParamValue_INTERP_LINEAR 
OIIO_ParamValue_INTERP_VERTEX 

Definition at line 24 of file c-paramlist.h.

Function Documentation

OIIOC_API OIIO_ParamValue* OIIO_ParamValue_copy ( OIIO_ParamValue pv)

Make a copy of the given OIIO_ParamValue

Equivalent C++: new ParamValue(*pv)

OIIOC_API const void* OIIO_ParamValue_data ( const OIIO_ParamValue pv)

Equivalent C++: pv->data()

OIIOC_API int OIIO_ParamValue_datasize ( const OIIO_ParamValue pv)

Equivalent C++: pv->datasize()

OIIOC_API void OIIO_ParamValue_delete ( const OIIO_ParamValue pv)

Delete a OIIO_ParamValue

Equivalent C++: delete pv

OIIOC_API OIIO_ParamValue* OIIO_ParamValue_from_string ( const char *  name,
OIIO_TypeDesc  type,
const char *  string 
)

Construct a new OIIO_ParamValue by parsing the given string

Equivalent C++: new ParamValue(name, type, string)

OIIOC_API float OIIO_ParamValue_get_float ( const OIIO_ParamValue pv,
float  defaultval 
)

Retrive a float, with converstions from a wide variety of type cases, including integers. It will retrive from a string, but only if the string is entirely a valid float format. Unconvertible types return the default value.

Equivalent C++: pv->get_float(defaultval)

OIIOC_API float OIIO_ParamValue_get_float_indexed ( const OIIO_ParamValue pv,
int  index,
float  defaultval 
)

Retrive a float, with converstions from a wide variety of type cases, including integers. It will retrive from a string, but only if the string is entirely a valid float format. Unconvertible types return the default value.

Equivalent C++: pv->get_float_indexed(index, defaultval)

OIIOC_API int OIIO_ParamValue_get_int ( const OIIO_ParamValue pv,
int  defaultval 
)

Retrive an integer, with converstions from a wide variety of type cases, including unsigned, short, byte. Not float. It will retrive from a string, but only if the string is entirely a valid int format. Unconvertible types return the default value.

Equivalent C++: pv->get_int(defaultval)

OIIOC_API int OIIO_ParamValue_get_int_indexed ( const OIIO_ParamValue pv,
int  index,
int  defaultval 
)

Retrive an integer, with converstions from a wide variety of type cases, including unsigned, short, byte. Not float. It will retrive from a string, but only if the string is entirely a valid int format. Unconvertible types return the default value.

Equivalent C++: pv->get_int_indexed(index, defaultval)

OIIOC_API void OIIO_ParamValue_get_string ( const OIIO_ParamValue pv,
int  max_num_strings,
char *  buffer,
int  buffer_len 
)

Convert any type to a string value. An optional maximum number of elements is also passed. In the case of a single string, just the string directly is returned. But for an array of strings, the array is returned as one string that's a comma-separated list of double- quoted, escaped strings.

Parameters
pvThe ParamValue to get the string from
max_num_stringsThe maximum number of strings to get
bufferCaller-provided storage to put the string(s) into
buffer_lenThe length of the string storage. If the generated string is longer than buffer_len it will be truncated to fit.
OIIOC_API void OIIO_ParamValue_get_string_indexed ( const OIIO_ParamValue pv,
int  index,
char *  buffer,
int  buffer_len 
)

Convert any type to a string value. An optional maximum number of elements is also passed. In the case of a single string, just the string directly is returned. But for an array of strings, the array is returned as one string that's a comma-separated list of double- quoted, escaped strings.

Parameters
pvThe ParamValue to get the string from
indexThe index into the array to get the string for
bufferCaller-provided storage to put the string(s) into
buffer_lenThe length of the string storage. If the generated string is longer than buffer_len it will be truncated to fit.
OIIOC_API void OIIO_ParamValue_init ( OIIO_ParamValue pv,
const char *  name,
OIIO_TypeDesc  type,
int  nvalues,
int  interp,
const void value,
bool  copy 
)

Equivalent C++: pv->init(name, type, nvalues, interp, value, copy)

OIIOC_API int OIIO_ParamValue_interp ( const OIIO_ParamValue pv)

Equivalent C++: pv->interp()

OIIOC_API bool OIIO_ParamValue_is_nonlocal ( const OIIO_ParamValue pv)

Equivalent C++: pv->is_nonlocal()

OIIOC_API const char* OIIO_ParamValue_name ( const OIIO_ParamValue pv)

Equivalent C++: pv->name()

OIIOC_API OIIO_ParamValue* OIIO_ParamValue_new ( const char *  name,
OIIO_TypeDesc  type,
int  nvalues,
int  interp,
const void value,
bool  copy 
)

Construct a new OIIO_ParamValue.

OIIOC_API int OIIO_ParamValue_nvalues ( const OIIO_ParamValue pv)

Equivalent C++: pv->nvalues()

OIIOC_API OIIO_TypeDesc OIIO_ParamValue_type ( const OIIO_ParamValue pv)

Equivalent C++: pv->type()