Streaming Objects To and From Memory

Streaming Objects To and From Memory

Module description

This section describes the functions provided for reading HumanIK objects from memory streams, and writing HumanIK objects to memory buffers.

Functions

HIKCharacterHIKReadFromStream (HIKCharacterDefinition *pCharacterDefinition, const char *pStream, size_t pStreamSize, HIKMalloc pMalloc, HIKFree pFree, const char *pValidationString)
 Creates a new HIKCharacterDefinition and HIKCharacter from the specified binary stream. More...
 
char * HIKWriteToStream (size_t *pStreamSize, const HIKCharacterDefinition *pCharacterDefinition, const HIKCharacter *pCharacter, bool pBigEndian, HIKMalloc pMalloc, HIKFree pFree, const char *pValidationString)
 Writes the specified HIKCharacterDefinition and HIKCharacter to a byte stream. More...
 

Function Documentation

HIKCharacter * HIKReadFromStream ( HIKCharacterDefinition pCharacterDefinition,
const char *  pStream,
size_t  pStreamSize,
HIKMalloc  pMalloc,
HIKFree  pFree,
const char *  pValidationString 
)

Creates a new HIKCharacterDefinition and HIKCharacter from the specified binary stream.

This function is typically used to create a fully characterized HIKCharacter from the contents of a binary file created by the Characterization Tool. It can also be used to create a character from the binary stream generated by HIKWriteToStream().

Parameters
[out]pCharacterDefinitionAn HIKCharacterDefinition that reflects which Nodes in the HIKCharacter are used, and which Nodes have DoF and parent offsets.
pStreamA byte stream that contains all the information required by HumanIK to create the HIKCharacterDefinition and HIKCharacter.
pStreamSizeThe size of pStream, in bytes.
pMallocPointer to a memory allocation function. If you do not have a custom memory allocation function, use &malloc.
pFreePointer to a memory de-allocation function. If you do not have a custom memory de-allocation function, use &free.
pValidationStringThe customer identification string given to you by Autodesk to license the use of HumanIK in your project.
char * HIKWriteToStream ( size_t pStreamSize,
const HIKCharacterDefinition pCharacterDefinition,
const HIKCharacter pCharacter,
bool  pBigEndian,
HIKMalloc  pMalloc,
HIKFree  pFree,
const char *  pValidationString 
)

Writes the specified HIKCharacterDefinition and HIKCharacter to a byte stream.

You can re-create your HIKCharacterDefinition and HIKCharacter from the contents of this byte stream by calling HIKReadFromStream().

Parameters
pStreamSizeThe size of the byte stream in which the data will be written, in bytes.
pCharacterDefinitionThe HIKCharacterDefinition that specifies which Nodes your HIKCharacter uses, and which Nodes have DoF and parent offsets.
pCharacterThe HIKCharacter to be written to the stream.
pBigEndianSpecifies whether or not the stream uses big-endian byte order. Use true for big-endian platforms, and false for little-endian platforms.
pMallocPointer to a memory allocation function. If you do not have a custom memory allocation function, use &malloc.
pFreePointer to a memory de-allocation function. If you do not have a custom memory de-allocation function, use &free.
pValidationStringThe customer identification string given to you by Autodesk to license the use of HumanIK in your project.