Rename scaling filter `linear` to `bilinear`

This commit is contained in:
Elias Batek 2025-01-12 06:53:04 +01:00
parent bc196985b5
commit f1d41403d1
2 changed files with 9 additions and 6 deletions

View File

@ -2850,7 +2850,7 @@ enum ScalingFilter {
Visual impression: smooth, blurred
)
+/
linear,
bilinear,
/++
Unweighted linear interpolation
@ -2860,6 +2860,9 @@ enum ScalingFilter {
)
+/
fauxLinear,
///
//linear = bilinear,
}
private enum ScalingDirection {
@ -2926,7 +2929,7 @@ private void scaleToImpl(ScalingFilter method)(const Pixmap source, Pixmap targe
}
// ==== Bilinear ====
static if ((method == ScalingFilter.linear) || (method == ScalingFilter.fauxLinear)) {
static if ((method == ScalingFilter.bilinear) || (method == ScalingFilter.fauxLinear)) {
auto dst = PixmapScannerRW(target);
size_t y = 0;
@ -2975,7 +2978,7 @@ private void scaleToImpl(ScalingFilter method)(const Pixmap source, Pixmap targe
}
// ====== Proper bilinear ======
static if (method == ScalingFilter.linear) {
static if (method == ScalingFilter.bilinear) {
const ulong[2] fract = [
(() @trusted => posSrc.ptr[0].fractionalDigits)(),
(() @trusted => posSrc.ptr[1].fractionalDigits)(),

View File

@ -391,7 +391,7 @@ struct PresenterConfig {
Scaling scaling = Scaling.keepAspectRatio;
/++
Filter
Scaling filter
+/
ScalingFilter filter = ScalingFilter.nearest;
@ -634,7 +634,7 @@ final class OpenGl3PixmapRenderer : PixmapRenderer {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
break;
case linear:
case bilinear:
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
break;
@ -744,7 +744,7 @@ final class OpenGl1PixmapRenderer : PixmapRenderer {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
break;
case linear:
case bilinear:
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
break;