Commit b6d393d7 authored by Niklas Haas's avatar Niklas Haas
Browse files

filters: rename pl_filter_triangle/box to bilinear/nearest

I have no idea why I ever gave these such confusing names. Just rename
them and keep around the old names for backwards compatibility.

API bump because this is technically an ABI break (symbol rename).
parent 10913533
Pipeline #80665 passed with stages
in 7 minutes and 29 seconds
......@@ -2,7 +2,7 @@ project('libplacebo', ['c', 'cpp'],
license: 'LGPL2.1+',
default_options: ['c_std=c99', 'cpp_std=c++11', 'warning_level=2'],
meson_version: '>=0.51',
version: '3.116.0',
version: '3.117.0',
)
# Version number
......
......@@ -532,11 +532,11 @@ const struct pl_filter_config pl_filter_spline64 = {
.kernel = &pl_filter_function_spline64,
};
const struct pl_filter_config pl_filter_box = {
const struct pl_filter_config pl_filter_nearest = {
.kernel = &pl_filter_function_box,
};
const struct pl_filter_config pl_filter_triangle = {
const struct pl_filter_config pl_filter_bilinear = {
.kernel = &pl_filter_function_triangle,
};
......@@ -646,10 +646,10 @@ const struct pl_named_filter_config pl_named_filters[] = {
{"spline16", &pl_filter_spline16},
{"spline36", &pl_filter_spline36},
{"spline64", &pl_filter_spline64},
{"box", &pl_filter_box},
{"nearest", &pl_filter_box}, // alias
{"triangle", &pl_filter_triangle},
{"bilinear", &pl_filter_triangle}, // alias
{"nearest", &pl_filter_nearest},
{"box", &pl_filter_nearest}, // alias
{"bilinear", &pl_filter_bilinear},
{"triangle", &pl_filter_bilinear}, // alias
{"gaussian", &pl_filter_gaussian},
{"sinc", &pl_filter_sinc},
{"lanczos", &pl_filter_lanczos},
......
......@@ -187,8 +187,8 @@ double pl_filter_sample(const struct pl_filter_config *c, double x);
extern const struct pl_filter_config pl_filter_spline16; // 2 taps
extern const struct pl_filter_config pl_filter_spline36; // 3 taps
extern const struct pl_filter_config pl_filter_spline64; // 4 taps
extern const struct pl_filter_config pl_filter_box; // AKA nearest
extern const struct pl_filter_config pl_filter_triangle; // AKA bilinear
extern const struct pl_filter_config pl_filter_nearest; // AKA box
extern const struct pl_filter_config pl_filter_bilinear; // AKA triangle
extern const struct pl_filter_config pl_filter_gaussian;
// Sinc family (all configured to 3 taps):
extern const struct pl_filter_config pl_filter_sinc; // unwindowed,
......@@ -209,6 +209,10 @@ extern const struct pl_filter_config pl_filter_robidouxsharp;
extern const struct pl_filter_config pl_filter_ewa_robidoux;
extern const struct pl_filter_config pl_filter_ewa_robidouxsharp;
// Backwards compatibility
#define pl_filter_box pl_filter_nearest
#define pl_filter_triangle pl_filter_bilinear
struct pl_named_filter_config {
const char *name;
const struct pl_filter_config *filter;
......
......@@ -76,7 +76,7 @@ struct pl_render_params {
// since the built-in GPU sampling algorithms can't anti-alias.
//
// Note: If set to the same address as the built-in `pl_filter_bicubic`,
// `pl_filter_box` etc.; libplacebo will also use the more efficient
// `pl_filter_nearest` etc.; libplacebo will also use the more efficient
// direct sampling algorithm where possible without quality loss.
const struct pl_filter_config *upscaler;
const struct pl_filter_config *downscaler;
......
......@@ -480,9 +480,9 @@ static struct sampler_info sample_src_info(struct pl_renderer *rr,
if (can_fast && !params->disable_builtin_scalers) {
if (can_linear && info.config == &pl_filter_bicubic)
info.type = SAMPLER_BICUBIC;
if (can_linear && info.config == &pl_filter_triangle)
if (can_linear && info.config == &pl_filter_bilinear)
info.type = SAMPLER_DIRECT;
if (info.config == &pl_filter_box)
if (info.config == &pl_filter_nearest)
info.type = can_linear ? SAMPLER_NEAREST : SAMPLER_DIRECT;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment