Marks texel as protected if one of its non-median channels is present in the channel mask.
| 178 | |
| 179 | /// Marks texel as protected if one of its non-median channels is present in the channel mask. |
| 180 | static void protectExtremeChannels(byte *stencil, const float *msd, float m, int mask) { |
| 181 | if ( |
| 182 | (mask&RED && msd[0] != m) || |
| 183 | (mask&GREEN && msd[1] != m) || |
| 184 | (mask&BLUE && msd[2] != m) |
| 185 | ) |
| 186 | *stencil |= (byte) MSDFErrorCorrection::PROTECTED; |
| 187 | } |
| 188 | |
| 189 | template <int N> |
| 190 | void MSDFErrorCorrection::protectEdges(const BitmapConstSection<float, N> &sdf) { |