MCPcopy Create free account
hub / github.com/Atarity/Lightpack / avgColor

Function avgColor

Software/math/PrismatikMath.cpp:131–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129 }
130
131 StructRgb avgColor(const QList<StructRgb> &colors) {
132 StructRgb result;
133 if (colors.size() > 0) {
134 for (int i = 0; i < colors.size(); ++i) {
135 result.r += colors[i].r;
136 result.g += colors[i].g;
137 result.b += colors[i].b;
138 }
139 result.r /= colors.size();
140 result.g /= colors.size();
141 result.b /= colors.size();
142 }
143 return result;
144 }
145
146 StructXyz toXyz(const StructRgb & rgb) {
147 //12bit RGB from 0 to 4095

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected