/usr/share/movit/padding_effect.frag is in libmovit5 1.4.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | // Implicit uniforms:
// uniform vec2 PREFIX(offset);
// uniform vec2 PREFIX(scale);
//
// uniform vec2 PREFIX(normalized_coords_to_texels);
// uniform vec2 PREFIX(offset_bottomleft);
// uniform vec2 PREFIX(offset_topright);
vec4 FUNCNAME(vec2 tc) {
tc -= PREFIX(offset);
tc *= PREFIX(scale);
vec2 tc_texels = tc * PREFIX(normalized_coords_to_texels);
vec2 coverage_bottomleft = clamp(tc_texels + PREFIX(offset_bottomleft), 0.0f, 1.0f);
vec2 coverare_topright = clamp(PREFIX(offset_topright) - tc_texels, 0.0f, 1.0f);
vec2 coverage_both = coverage_bottomleft * coverare_topright;
float coverage = coverage_both.x * coverage_both.y;
if (coverage <= 0.0f) {
// Short-circuit in case the underlying function is expensive to call.
return PREFIX(border_color);
} else {
return mix(PREFIX(border_color), INPUT(tc), coverage);
}
}
|