| 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 |
no outgoing calls
no test coverage detected