t2:gcv_read

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

t2:gcv_read [2020/02/10 15:40] (current)
J2Kbr created
Line 1: Line 1:
 +~~NOTOC~~
 +===== gcv_read =====
 +----
 +gcv_read — Read from GCV feedback data
  
 +==== Description ====
 +----
 +== Variation 1 ==
 +<code gpc2>​void gcv_read(uint8 offset, <​anytype>​ *variable);</​code>​
 +
 +Update the variable pointed by ***variable** with the value of type and size defined by **<​anytype>​**,​ located in the position **offset** from the GCV feedback data array.
 +
 +== Variation 2 ==
 +<code gpc2>​uint8 gcv_read(uint8 offset);</​code>​
 +
 +Read an uint8 value from position **offset** of the GCV feedback data array.
 +
 +==== Parameters ====
 +----
 +  * **offset**: Position of the persistent memory array, starting from 0, from which a value should be read. Note: on //Variation 2// the offset is passed as direct parameter of the opcode, therefore stack values can't be used.
 +  * **<​anytype>​ *variable**:​ Pointer to an variable of type **<​anytype>​**.
 + 
 +| **<​anytype>​** can be: ''​int8'',​ ''​uint8'',​ ''​int16'',​ ''​uint16'',​ ''​int32'',​ ''​uint32'',​ ''​fix32''​ or any of its aliases. |
 +
 +^  Byte Size of Variable Types  ^^^
 +| ''​int8'',​ ''​uint8''​ |  1 byte  ||
 +| ''​int16'',​ ''​uint16''​ |  2 bytes  |  big-endian ​ |
 +| ''​int32'',​ ''​uint32'',​ ''​fix32''​ |  4 bytes  |  big-endian ​ |
 +
 +==== Return Value ====
 +----
 +  * //Variation 1// does not returns any value.
 +  * //Variation 2// returns an uint8 value from the position **offset**.
 +
 +==== GCV Feedback Data Array ====
 +----
 +The GCV feedback data is an array of a maximum of 255 bytes utilized by the Gtuner'​s Computer Vision script to provide information garnered from video frames (e.g. game streaming) by means of computer vision algorithms. The feedback data is utilized by Titan Two scripts for automatic configurations and/or to trigger automated actions.
 +
 +==== Examples ====
 +----
 +=== Example #1 gcv_read() example ===
 +<code gpc2>​uint8 weapon_model;​
 +int32 horz_delta;
 +uint16 shots_fired;​
 +
 +main {
 +    // GCV feedback data was updated
 +    if(gcv_ready()) {
 +        // Read the GCV feedback data into variables.
 +        weapon_model = gcv_read(0);​
 +        gcv_read(1, &​horz_delta);​
 +        gcv_read(5, &​shots_fired);​
 +    }
 +}</​code>​
 +
 +==== See Also ====
 +----
 +  * [[t2:​gcv_ready|gcv_ready]]
t2/gcv_read.txt · Last modified: 2020/02/10 15:40 by J2Kbr