| 58 | } |
| 59 | |
| 60 | int BoxBlur::handleEdges(int iterator, int max, bool tileable) { |
| 61 | if(iterator < 0) { |
| 62 | if(tileable) { |
| 63 | int corrected = max + iterator; |
| 64 | //failsafe, e.g. if filter size is larger than image size |
| 65 | return handleEdges(corrected, max, false); |
| 66 | } |
| 67 | else { |
| 68 | return 0; |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | if(iterator >= max) { |
| 73 | if(tileable) { |
| 74 | int corrected = iterator - max; |
| 75 | //failsafe, e.g. if filter size is larger than image size |
| 76 | return handleEdges(corrected, max, false); |
| 77 | } |
| 78 | else { |
| 79 | return max - 1; |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | return iterator; |
| 84 | } |
nothing calls this directly
no outgoing calls
no test coverage detected