Sanitise the integer to specify a valid patch dimension will return 0 if the input is invalid
| 186 | // Sanitise the integer to specify a valid patch dimension |
| 187 | // will return 0 if the input is invalid |
| 188 | std::size_t checkPatchDimension(int input) |
| 189 | { |
| 190 | // Must be an odd number in [3..15] |
| 191 | if (input < 3 || input > 15 || input % 2 == 0) |
| 192 | { |
| 193 | return 0; |
| 194 | } |
| 195 | |
| 196 | // all good |
| 197 | return static_cast<std::size_t>(input); |
| 198 | } |
| 199 | |
| 200 | void createSimplePatch(const cmd::ArgumentList& args) |
| 201 | { |