Use the getTokenParams() function, passing your token ID.
void init_token_params() { // insert token ID... token_params.chronophotograph_token_id = 0; // ...and the parameters returned from smart // contract function getTokenParams(tokenID) //blocknumber the chronophotograph was minted token_params.blocknumber = 0; //ID of parent noumenon token. 'parent_id' var in getTokenParams return vals token_params.noumenon_token_id = 0; //epoch token_params.epoch = 0; }Replace your token ID, and replace the indicated values with the 'p1','p2','p3' values previously read through getTokenParams(). For example:
void init_token_params() { // insert token ID... token_params.chronophotograph_token_id = 135; // ...and the parameters returned from smart // contract function getTokenParams(tokenID) //blocknumber the chronophotograph was minted token_params.blocknumber = 17177993; //ID of parent noumenon token. 'parent_id' var in getTokenParams return vals token_params.noumenon_token_id = 17; //epoch token_params.epoch = 8; }
Code conforms to the ISO c99 standard. Only library dependency is C math library. Pass '-lm' to gcc. Assumes architecture is little endian (all Intel processors)
Compile and run. Optionally pass '-Ofast' flag to enable optimization (faster rendering).$ gcc -Ofast main.c -lm && ./a.out
This will produce:
a. PGM(Portable gray map) 16bit grayscale, linear (no gamma) file named 'image.pgm'
PGM "Portable Gray Map" is an extremely simple file format for storing grayscale images. Specification here: https://netpbm.sourceforge.net/doc/pgm.html