MCPcopy Create free account
hub / github.com/Theverat/NormalmapGenerator / handleEdges

Method handleEdges

src_generators/boxblur.cpp:60–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60int 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected