Changeset 449:4ff868864e9b
- Timestamp:
- 01/08/2013 02:06:49 PM (5 months ago)
- Author:
- Andreas Schaefer <gentryx@…>
- Branch:
- default
- Message:
-
coding style
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r447
|
r449
|
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | | inline Cell(const double& v=0) : temp(v) |
| | 29 | inline Cell(const double& v = 0) : |
| | 30 | temp(v) |
| 30 | 31 | {} |
| 31 | 32 | |
| … |
… |
|
| 58 | 59 | for (int x = 0; x < 250; ++x) { |
| 59 | 60 | Coord<2> c(x + offsetX, y + offsetY); |
| 60 | | if (rect.inBounds(c)) |
| | 61 | if (rect.inBounds(c)) { |
| 61 | 62 | ret->at(c) = Cell(0.99999999999); |
| | 63 | } |
| 62 | 64 | } |
| 63 | 65 | } |
| … |
… |
|
| 69 | 71 | Color operator()(const Cell& cell) |
| 70 | 72 | { |
| 71 | | if (cell.temp < 0) |
| | 73 | if (cell.temp < 0) { |
| 72 | 74 | return Color(0, 0, 0); |
| 73 | | if (cell.temp < 0.25) |
| | 75 | } |
| | 76 | if (cell.temp < 0.25) { |
| 74 | 77 | return Color(0, (cell.temp - 0.0) * 1020, 255); |
| 75 | | if (cell.temp < 0.50) |
| | 78 | } |
| | 79 | if (cell.temp < 0.50) { |
| 76 | 80 | return Color(0, 255, 255 - (cell.temp - 0.25) * 1020); |
| 77 | | if (cell.temp < 0.75) |
| | 81 | } |
| | 82 | if (cell.temp < 0.75) { |
| 78 | 83 | return Color((cell.temp - 0.5) * 1020, 255, 0); |
| 79 | | if (cell.temp < 1.00) |
| | 84 | } |
| | 85 | if (cell.temp < 1.00) { |
| 80 | 86 | return Color(255, 255 - (cell.temp - 0.75) * 1020, 0); |
| | 87 | } |
| 81 | 88 | return Color(255, 255, 255); |
| 82 | 89 | } |