summaryrefslogtreecommitdiff
path: root/src/image.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-21 14:35:15 -0300
committerGabriel Schneider <[email protected]>2026-10-22 10:03:15 -0300
commitbc3d18d27f9fc1155db7fac3946c4d38774f9e65 (patch)
tree9178ce95952797f8a78b16c2b805e53368efb35a /src/image.zig
parent1ecb9b720840ea8e4753823fa8cddcf5d6a3a4d2 (diff)
downloadpardes-bc3d18d27f9fc1155db7fac3946c4d38774f9e65.tar.gz
pardes-bc3d18d27f9fc1155db7fac3946c4d38774f9e65.zip
Build with Zig 0.17
ghostty, libvaxis and uucode move to ghostty's 0.17 pins, cloud9 to its 0.17 main, SDL to castholm's release-3.4.x (3.4.18), zstbi and tree-sitter to forks with 0.17 build files (see build.zig.zon). A bare zig build copies the binaries into ~/.local/bin (-Dhome-install=false leaves it out): 0.17 keeps the prefix from build scripts. A terminal's edited copy goes when the program clears the screen. tinywin.snap is gone; perf baselines are re-recorded. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/image.zig')
-rw-r--r--src/image.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/image.zig b/src/image.zig
index 72520ad6..8bf9de08 100644
--- a/src/image.zig
+++ b/src/image.zig
@@ -242,11 +242,11 @@ pub const GlyphArt = struct {
const glyphs_ascii = glyphs ++ ascii_glyphs;
fn matchCell(cell: *const [64][3]u8, pal: Palette, gset: []const Glyph) Cell {
- var counts = [_]u16{0} ** 16;
+ var counts = @as([16]u16, @splat(0));
for (cell) |px| counts[nearest(px, pal)] += 1;
var cand: [4]u4 = undefined;
var ncand: usize = 0;
- var used = [_]bool{false} ** 16;
+ var used = @as([16]bool, @splat(false));
while (ncand < 4) : (ncand += 1) {
var best: ?usize = null;
for (counts, 0..) |c, i| {
@@ -432,7 +432,7 @@ pub const GlyphArt = struct {
test "render: tiny image produces a grid within bounds" {
const a = std.testing.allocator;
// 2x2 checker, RGBA
- var img = [_]u8{0} ** (2 * 2 * 4);
+ var img = @as([2 * 2 * 4]u8, @splat(0));
img[0] = 255;
img[1] = 255;
img[2] = 255;