MCPcopy Create free account
hub / github.com/arrayfire/forge / generateColors

Function generateColors

examples/cpu/stream.cpp:28–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26using namespace std;
27
28void generateColors(std::vector<float>& colors)
29{
30 static const float AF_BLUE[] = {0.0588f , 0.1137f , 0.2745f , 1.0f};
31 static const float AF_ORANGE[] = {0.8588f , 0.6137f , 0.0745f , 1.0f};
32
33 int numElems = NELEMS*NELEMS*NELEMS;
34 colors.clear();
35 for (int i=0; i<numElems; ++i) {
36 if ((i%2) == 0) {
37 colors.push_back(AF_ORANGE[0]);
38 colors.push_back(AF_ORANGE[1]);
39 colors.push_back(AF_ORANGE[2]);
40 } else {
41 colors.push_back(AF_BLUE[0]);
42 colors.push_back(AF_BLUE[1]);
43 colors.push_back(AF_BLUE[2]);
44 }
45 }
46}
47
48void generatePoints(std::vector<float> &points, std::vector<float> &dirs)
49{

Callers 1

mainFunction · 0.85

Calls 1

clearMethod · 0.80

Tested by

no test coverage detected