Created
November 11, 2014 03:31
-
-
Save ithompson/f163f362cf87ccc7ffa3 to your computer and use it in GitHub Desktop.
How to results array properly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PipeExampleModule : public Module { | |
... | |
union { | |
struct pipe_results pr; | |
struct pipe_results2 pr2; | |
struct pipe_results3 pr3; | |
} results[NUMBER_PIPES]; | |
... | |
// Nothing needed in constructor or destructor | |
... | |
Status process_image(Image *image) { | |
... | |
for (uint i = 0; i < NUMBER_PIPES; i++){ | |
memset(&results[i], 0, sizeof(struct pipe_results)); | |
... | |
results[i].pr.center_x = box.center.x; | |
results[i].pr.center_y = box.center.y; | |
... | |
} | |
... | |
shm_setg(pipe_results, results[0].pr); | |
shm_setg(pipe_results2, results[1].pr2); | |
shm_setg(pipe_results3, results[2].pr3); | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment