Skip to documentation
SLOP

tiny.png.EncodePlan

Reference tiny.png EncodePlan

Defined in tiny.png.

API (13)

Actions

Public operations.

Fields and members

Public fields and members.

No direct callersNo direct callstiny.pngEncodePlan
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/png/src/encode/plan.zig:38

zig
pub const Plan = struct {    input_hash: u64,    width: i32,    height: i32,    image_pixels: usize,    color: model.Color,    raw_bytes: usize,    zlib_bytes: usize,    output_bytes: usize,    options: model.Options,    bounds: Bounds,    pub fn inspect(image: model.ImageView, bounds: Bounds, scratch: *Scratch) Error!Plan {        return inspectRegions(image, bounds, scratch.regions());    }    pub fn inspectRegions(        image: model.ImageView,        bounds: Bounds,        scratch: ScratchRegions,    ) Error!Plan {        const image_pixels = try model.pixelCount(image.width, image.height);        if (image_pixels > bounds.image_pixels) return error.ImagePixelCapacityExceeded;        const pixel_bytes = try model.pixelByteCount(image.width, image.height);        if (image.rgba8.len != pixel_bytes) return error.PixelSizeMismatch;        const color = model.colorForPixels(image.rgba8);        const row_bytes = try multiplied(@as(usize, @intCast(image.width)), color.bytesPerPixel());        const raw_bytes = try multiplied(            try added(row_bytes, 1),            @as(usize, @intCast(image.height)),        );        const zlib_bytes = switch (image.options.compression) {            .compressed => try measureCompressed(image, color, scratch),            .stored => try storedBytes(raw_bytes),        };        return .{            .input_hash = model.imageHash(image),            .width = image.width,            .height = image.height,            .image_pixels = image_pixels,            .color = color,            .raw_bytes = raw_bytes,            .zlib_bytes = zlib_bytes,            .output_bytes = try added(signature_bytes + framed_bytes, zlib_bytes),            .options = image.options,            .bounds = bounds,        };    }    pub fn exactBounds(self: Plan) Bounds {        return .{ .image_pixels = self.image_pixels };    }};

Source: lib/png/src/root.zig:14

zig
pub const EncodePlan = encode.Plan;
Called byCallstest sourcelib.png.src.encode.plantest: PNG planning measures exact com...EncodePlaninspectRegionsEncodePlaninspect
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsEncodePlaninspectprivate sourcelib.png.src.encode.modelcolorForPixelsprivate sourcelib.png.src.encode.modelimageHashprivate sourcelib.png.src.encode.modelpixelByteCountprivate sourcelib.png.src.encode.modelpixelCountprivate sourcelib.png.src.encode.planadded+3 moreEncodePlaninspectRegions
Static calls · unresolved targets: 0 · external targets: 1.

Also reachable as

encode.Plan.

Complete call list for EncodePlan.inspectRegions

8 direct calls.

Audit

Definitions4
Public names8
Members10
Version26.7.0
Revisiondaab053ee433