| 329 | /// Checks if a linear interpolation artifact will occur inbetween two horizontally or vertically adjacent texels a, b. |
| 330 | template <class ArtifactClassifier> |
| 331 | static bool hasLinearArtifact(const ArtifactClassifier &artifactClassifier, float am, const float *a, const float *b) { |
| 332 | float bm = median(b[0], b[1], b[2]); |
| 333 | return ( |
| 334 | // Out of the pair, only report artifacts for the texel further from the edge to minimize side effects. |
| 335 | fabsf(am-.5f) >= fabsf(bm-.5f) && ( |
| 336 | // Check points where each pair of color channels meets. |
| 337 | hasLinearArtifactInner(artifactClassifier, am, bm, a, b, a[1]-a[0], b[1]-b[0]) || |
| 338 | hasLinearArtifactInner(artifactClassifier, am, bm, a, b, a[2]-a[1], b[2]-b[1]) || |
| 339 | hasLinearArtifactInner(artifactClassifier, am, bm, a, b, a[0]-a[2], b[0]-b[2]) |
| 340 | ) |
| 341 | ); |
| 342 | } |
| 343 | |
| 344 | /// Checks if a bilinear interpolation artifact will occur inbetween two diagonally adjacent texels a, d (with b, c forming the other diagonal). |
| 345 | template <class ArtifactClassifier> |
no test coverage detected