tiny.simd.mirror
Defined in image.
Source
Source: lib/simd/src/image/root.zig:531
zig
pub fn mirror(coord: i64, size: usize) usize { std.debug.assert(size != 0); std.debug.assert(size <= std.math.maxInt(i64)); const size_u64: u64 = @intCast(size); const period = 2 * size_u64; const phase = if (coord >= 0) @as(u64, @intCast(coord)) % period else blk: { const bits: u64 = @bitCast(coord); const remainder = (0 -% bits) % period; break :blk if (remainder == 0) 0 else period - remainder; }; if (phase < size_u64) return @intCast(phase); return @intCast(period - 1 - phase);}Source: lib/simd/src/root.zig:527
zig
pub const mirror = image.mirror;Audit
| Definitions | 1 |
|---|---|
| Public names | 2 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |