github
13 of 238 branches covered (5.46%)
Branch coverage included in aggregate %.
0 of 472 new or added lines in 41 files covered. (0.0%)
19728 existing lines in 193 files now uncovered.91 of 28170 relevant lines covered (0.32%)
0.02 hits per line
UNCOV
1
|
// luma.gl, MIT license
|
|
UNCOV
2
|
// Copyright (c) vis.gl contributors
|
× |
UNCOV
3
|
|
× |
UNCOV
4
|
import {ShaderPass} from '../../../lib/shader-module/shader-pass'; |
× |
UNCOV
5
|
import {glsl} from '../../../lib/glsl-utils/highlight'; |
× |
UNCOV
6
|
|
× |
UNCOV
7
|
const fs = glsl`\ |
× |
UNCOV
8
|
vec4 warp_sampleColor(sampler2D source, vec2 texSize, vec2 coord) { |
× |
UNCOV
9
|
vec4 color = texture(source, coord / texSize); |
× |
UNCOV
10
|
vec2 clampedCoord = clamp(coord, vec2(0.0), texSize); |
× |
UNCOV
11
|
if (coord != clampedCoord) {
|
× |
UNCOV
12
|
/* fade to transparent if we are outside the image */
|
× |
UNCOV
13
|
color.a *= max(0.0, 1.0 - length(coord - clampedCoord)); |
× |
UNCOV
14
|
} |
× |
UNCOV
15
|
|
× |
UNCOV
16
|
return color;
|
× |
UNCOV
17
|
} |
× |
UNCOV
18
|
`;
|
× |
UNCOV
19
|
|
× |
UNCOV
20
|
export type WarpProps = {};
|
× |
UNCOV
21
|
|
× |
UNCOV
22
|
export const warp: ShaderPass<WarpProps, WarpProps> = { |
× |
UNCOV
23
|
name: 'warp', |
× |
UNCOV
24
|
passes: [], |
× |
UNCOV
25
|
fs |
× |
UNCOV
26
|
}; |
× |