Skip to documentation
SLOP

tiny.png.DecodePlan

Reference tiny.png DecodePlan

Defined in tiny.png.

API (22)

Actions

Public operations.

Fields and members

Public fields and members.

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

Source

Source: lib/png/src/decode/plan.zig:24

zig
pub const Plan = struct {    input_bytes: usize,    input_hash: u64,    width: u32,    height: u32,    bit_depth: u8,    color_type: u8,    image_pixels: usize,    source_row_bytes: usize,    filter_bytes_per_pixel: usize,    raw_bytes: usize,    idat_bytes: usize,    rgba8_bytes: usize,    palette_offset: usize,    palette_bytes: usize,    transparency_offset: usize,    transparency_bytes: usize,    bounds: Bounds,    pub fn inspect(bytes: []const u8, bounds: Bounds) Error!Plan {        if (bytes.len > bounds.input_bytes) return error.InputByteCapacityExceeded;        if (bytes.len < encode.signature.len) return error.InvalidSignature;        if (!std.mem.eql(u8, bytes[0..encode.signature.len], &encode.signature)) {            return error.InvalidSignature;        }        var scan = Scan{};        var offset: usize = encode.signature.len;        while (bytes.len - offset >= 8) {            const chunk = try readChunk(bytes, offset);            const finished = try scan.observe(chunk, bounds);            offset = chunk.next_offset;            if (finished) break;        }        return scan.finish(bytes, bounds);    }    pub fn exactBounds(self: Plan) Bounds {        return .{            .input_bytes = self.input_bytes,            .image_pixels = self.image_pixels,            .source_row_bytes = self.source_row_bytes,            .idat_bytes = self.idat_bytes,        };    }    pub fn header(self: Plan) model.Header {        return .{            .width = self.width,            .height = self.height,            .bit_depth = self.bit_depth,            .color_type = self.color_type,        };    }    pub fn palette(self: Plan, bytes: []const u8) []const u8 {        return bytes[self.palette_offset..][0..self.palette_bytes];    }    pub fn transparency(self: Plan, bytes: []const u8) []const u8 {        return bytes[self.transparency_offset..][0..self.transparency_bytes];    }};

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

zig
pub const DecodePlan = decode.Plan;
Called byCallsDecodeBoundsexacttest sourcelib.png.src.decode.plantest: PNG decode planning accepts exa...private sourcelib.png.src.decode.planreadChunkDecodePlaninspect
Static calls · unresolved targets: 0 · external targets: 2.

Also reachable as

decode.Plan.

Audit

Definitions6
Public names12
Members17
Version26.7.0
Revisiondaab053ee433