| 185 | }; |
| 186 | |
| 187 | struct rgbf |
| 188 | { |
| 189 | float r,g,b; |
| 190 | rgbf():r(0),g(0),b(0) |
| 191 | { |
| 192 | |
| 193 | } |
| 194 | rgbf(float r,float g,float b):r(r),g(g),b(b) |
| 195 | { |
| 196 | |
| 197 | } |
| 198 | rgbf operator-(const rgbf& cell) const |
| 199 | { |
| 200 | return rgbf(r-cell.r,g-cell.g,b-cell.b); |
| 201 | } |
| 202 | rgbf operator*(float val)const |
| 203 | { |
| 204 | return rgbf(r*val,g*val,b*val); |
| 205 | } |
| 206 | rgbf operator/(float val) const |
| 207 | { |
| 208 | return rgbf(r/val,g/val,b/val); |
| 209 | } |
| 210 | rgbf operator*(const rgbf& cell) const |
| 211 | { |
| 212 | return rgbf(r*cell.r,g*cell.g,b*cell.b); |
| 213 | } |
| 214 | rgbf operator*=(float val) |
| 215 | { |
| 216 | r*=val; |
| 217 | g*=val; |
| 218 | b*=val; |
| 219 | return *this; |
| 220 | } |
| 221 | rgbf operator*=(const rgbf& cell) |
| 222 | { |
| 223 | r*=cell.r; |
| 224 | g*=cell.g; |
| 225 | b*=cell.b; |
| 226 | return *this; |
| 227 | } |
| 228 | rgbf operator+=(const rgbf& cell) |
| 229 | { |
| 230 | r+=cell.r; |
| 231 | g+=cell.g; |
| 232 | b+=cell.b; |
| 233 | return *this; |
| 234 | } |
| 235 | rgbf operator+(const rgbf& other) const |
| 236 | { |
| 237 | return rgbf(r+other.r,g+other.g,b+other.b); |
| 238 | } |
| 239 | bool operator<=(const rgbf& other) const |
| 240 | { |
| 241 | return r<=other.r && g<=other.g && b<=other.b; |
| 242 | } |
| 243 | float dot(const rgbf& other) const |
| 244 | { |
no outgoing calls
no test coverage detected