mirror of https://github.com/adamdruppe/arsd.git
Rename scaling filter `linear` to `bilinear`
This commit is contained in:
parent
bc196985b5
commit
f1d41403d1
|
@ -2850,7 +2850,7 @@ enum ScalingFilter {
|
||||||
Visual impression: “smooth”, “blurred”
|
Visual impression: “smooth”, “blurred”
|
||||||
)
|
)
|
||||||
+/
|
+/
|
||||||
linear,
|
bilinear,
|
||||||
|
|
||||||
/++
|
/++
|
||||||
Unweighted linear interpolation
|
Unweighted linear interpolation
|
||||||
|
@ -2860,6 +2860,9 @@ enum ScalingFilter {
|
||||||
)
|
)
|
||||||
+/
|
+/
|
||||||
fauxLinear,
|
fauxLinear,
|
||||||
|
|
||||||
|
///
|
||||||
|
//linear = bilinear,
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum ScalingDirection {
|
private enum ScalingDirection {
|
||||||
|
@ -2926,7 +2929,7 @@ private void scaleToImpl(ScalingFilter method)(const Pixmap source, Pixmap targe
|
||||||
}
|
}
|
||||||
|
|
||||||
// ==== Bilinear ====
|
// ==== Bilinear ====
|
||||||
static if ((method == ScalingFilter.linear) || (method == ScalingFilter.fauxLinear)) {
|
static if ((method == ScalingFilter.bilinear) || (method == ScalingFilter.fauxLinear)) {
|
||||||
auto dst = PixmapScannerRW(target);
|
auto dst = PixmapScannerRW(target);
|
||||||
|
|
||||||
size_t y = 0;
|
size_t y = 0;
|
||||||
|
@ -2975,7 +2978,7 @@ private void scaleToImpl(ScalingFilter method)(const Pixmap source, Pixmap targe
|
||||||
}
|
}
|
||||||
|
|
||||||
// ====== Proper bilinear ======
|
// ====== Proper bilinear ======
|
||||||
static if (method == ScalingFilter.linear) {
|
static if (method == ScalingFilter.bilinear) {
|
||||||
const ulong[2] fract = [
|
const ulong[2] fract = [
|
||||||
(() @trusted => posSrc.ptr[0].fractionalDigits)(),
|
(() @trusted => posSrc.ptr[0].fractionalDigits)(),
|
||||||
(() @trusted => posSrc.ptr[1].fractionalDigits)(),
|
(() @trusted => posSrc.ptr[1].fractionalDigits)(),
|
||||||
|
|
|
@ -391,7 +391,7 @@ struct PresenterConfig {
|
||||||
Scaling scaling = Scaling.keepAspectRatio;
|
Scaling scaling = Scaling.keepAspectRatio;
|
||||||
|
|
||||||
/++
|
/++
|
||||||
Filter
|
Scaling filter
|
||||||
+/
|
+/
|
||||||
ScalingFilter filter = ScalingFilter.nearest;
|
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_MIN_FILTER, GL_NEAREST);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
break;
|
break;
|
||||||
case linear:
|
case bilinear:
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
break;
|
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_MIN_FILTER, GL_NEAREST);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
break;
|
break;
|
||||||
case linear:
|
case bilinear:
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue