GCGlib  0.04.228
GCG Graphics Engine
Saving data as C code

Functions

bool gcgSaveBytesAsText (unsigned int size, unsigned char *data, char *outputname)
 Saves a byte array as C code for software embedding. More...
 
bool gcgSaveFloatsAsText (unsigned int size, float *data, char *outputname)
 Saves a float array as C code for software embedding. More...
 
bool gcgSaveBMPcode (char *inputname, char *outputname)
 Saves a windows bitmap image as C code for software embedding. More...
 

Detailed Description

Sometimes it is desirable to have data represented by C code. This is important when the data should be embedded in a source file for further be compiled into a library or executable.

Function Documentation

◆ gcgSaveBMPcode()

bool gcgSaveBMPcode ( char *  inputname,
char *  outputname 
)

Saves a windows bitmap image as C code for software embedding.

Parameters
[in]inputnamename of the bitmap image file to be represented as C code.
[in]outputnamename of the text file that will receive the C code that represents the bitmap information of inputname. If the file exists it is overwritten (old data is lost).
Returns
true if the input image is a valid bitmap image and the output file is successfully created.
Since
0.01.6

◆ gcgSaveBytesAsText()

bool gcgSaveBytesAsText ( unsigned int  size,
unsigned char *  data,
char *  outputname 
)

Saves a byte array as C code for software embedding.

Parameters
[in]sizenumber of bytes contained in the array data.
[in]datapointer to the first byte of the array.
[in]outputnamename of the text file that will receive the code that represents the byte sequence of data. If the file exists it is overwritten (old data is lost).
Returns
true if the file is successfully created.
Since
0.01.6

◆ gcgSaveFloatsAsText()

bool gcgSaveFloatsAsText ( unsigned int  size,
float *  data,
char *  outputname 
)

Saves a float array as C code for software embedding.

Parameters
[in]sizenumber of floats contained in the array data.
[in]datapointer to the first float of the array.
[in]outputnamename of the text file that will receive the code that represents the float sequence of data. If the file exists it is overwritten (old data is lost).
Returns
true if the file is successfully created.
Since
0.04.166