| 220 | } |
| 221 | |
| 222 | void MultiGradient::activatePrecalculationMode(double min, double max, UInt steps) |
| 223 | { |
| 224 | //add security margin to range to avoid numerical problems |
| 225 | pre_min_ = std::min(min, max) - 0.000005; |
| 226 | pre_size_ = fabs(max - min) + 0.00001; |
| 227 | pre_steps_ = steps - 1; |
| 228 | pre_.clear(); |
| 229 | pre_.reserve(steps); |
| 230 | for (Size step = 0; step < steps; ++step) |
| 231 | { |
| 232 | pre_.push_back(interpolatedColorAt(step, 0, pre_steps_)); |
| 233 | //cout << pre_.back().red() << " " << pre_.back().green() << " " << pre_.back().blue() << endl; |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | void MultiGradient::deactivatePrecalculationMode() |
| 238 | { |
no test coverage detected