tiny.png.DecodePlan
Defined in tiny.png.
API (22)
Actions
Public operations.
Fields and members
Public fields and members.
bit_depthboundscolor_typefilter_bytes_per_pixelheightidat_bytesimage_pixelsinput_bytesinput_hashpalette_bytespalette_offsetraw_bytesrgba8_bytessource_row_bytestransparency_bytestransparency_offsetwidth
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;Also reachable as
Audit
| Definitions | 6 |
|---|---|
| Public names | 12 |
| Members | 17 |
| Version | 26.7.0 |
| Revision | daab053ee433 |