From c8553032ef84aec74cbb5d07d07f934eecf3d4a9 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 6 Nov 2026 05:19:21 -0300 Subject: kinds #9, the core's image code gone: src/image.zig (558 lines) and the static table go, so no kind is compiled in (Registry.init, Kind.image, compiledIn, `static` in /addons and "is compiled in" with them) and a test of the core's side of a kind's pane opens Kind.test_kind (a picture of one pixel, no library); a placement's fit (NativeGeometry, containGeometry) moves to surface.zig and a PDF's fit modes to pdf_view.zig; a terminal's kitty PNG decodes in TerminalImages.zig through wuffs as before, its downscale through stb_image_resize, the one part of zstbi the core keeps (stb_image patched out of it, the wuffs_images option, tag_image and image_exts gone); the image cases load the built image.so by path: test/panes.zig's and fs_namespace's through Addon.perform, T1 through Addon load (a new behaviour case: PNG, JPEG and PPM through 9P, the art words, a refused corrupt PNG, a dump's placeholder and its picture back, which replaces the decode unit test and ctl.zig's corrupt-image case), the snapshot, process and image harnesses by linking it into each session's data directory; images.snap unchanged Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- test/pdf.zig | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'test/pdf.zig') diff --git a/test/pdf.zig b/test/pdf.zig index 5de72876..98e8a0ae 100644 --- a/test/pdf.zig +++ b/test/pdf.zig @@ -3,7 +3,6 @@ const pardes = @import("pardes"); const panes = pardes.panes; const look = pardes.look; const pdf_impl = panes.Pdf.pdf; -const image = pardes.image; const config = pardes.config; const builtins = pardes.builtins; const layout = pardes.layout; @@ -23,8 +22,8 @@ const Placement = pardes.Placement; const Shown = struct { page: u32, revision: u32, - fit: image.NativeFit, - geometry: image.NativeGeometry, + fit: pardes.panes.Pdf.NativeFit, + geometry: pardes.NativeGeometry, pixel_offset_y: f32, rgba: []const u8, iw: usize, @@ -628,7 +627,7 @@ test "MuPDF pane renders, navigates, searches, and round-trips its page" { try std.testing.expectEqual(@as(usize, 1), first.placements.items.len); const first_place = (try shownAll(p, frame.allocator()))[0]; try std.testing.expect(first_place.rgba.len == first_place.iw * first_place.ih * 4); - try std.testing.expectEqual(image.NativeFit.width, first_place.fit); + try std.testing.expectEqual(pardes.panes.Pdf.NativeFit.width, first_place.fit); const request = panes.Pdf.renderRequest( panes.Pdf.paneViewport(p, pane) orelse return error.MissingPdfViewport, pdf_raster_policy, @@ -964,7 +963,7 @@ test "a fling's banded pages show the reader exactly what whole pages would" { const landing = @as(f64, @floatFromInt(pv.page_starts[1] -| viewport.pixel_h / 3)); const Shot = struct { page: u32, - dst: image.PixelRect, + dst: pardes.RectPx, pixels: []u8, }; var shots: [8]Shot = undefined; @@ -1190,7 +1189,7 @@ test "a tall page is drawn at the display's resolution, in bands that are the wh fn copySourceRect( gpa: std.mem.Allocator, place: Shown, - src: image.PixelRect, + src: pardes.RectPx, ) ![]u8 { const stride = place.iw * 4; const row_len = @as(usize, src.w) * 4; @@ -1388,7 +1387,7 @@ test "PDF tint and tinted theme changes rebuild every visible raster only" { const Snapshot = struct { page: u32, revision: u32, - geometry: image.NativeGeometry, + geometry: pardes.NativeGeometry, pixel_offset_y: f32, iw: usize, ih: usize, -- cgit v1.3