mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 00:47:28 +01:00
Have wuffsfmt align the "T"s in "x T" fields
This commit is contained in:
1 parent
1ceb304ad9
commit
d26fa09d07
7 files changed
+58
-43
No files matched your search
@@ -14,7 +14,7 @@
|
||||
|
||||
// TODO: drop the '?' but still generate wuffs_adler32__hasher__initialize?
|
||||
pub struct hasher?(
|
||||
state base.u32,
|
||||
state base.u32,
|
||||
started base.bool,
|
||||
)
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ pri const dcode_magic_numbers array[32] base.u32 = [
|
||||
|
||||
pub struct decoder?(
|
||||
// These fields yield src's bits in Least Significant Bits order.
|
||||
bits base.u32,
|
||||
bits base.u32,
|
||||
n_bits base.u32,
|
||||
|
||||
// huffs and n_huffs_bits are the lookup tables for Huffman decodings.
|
||||
@@ -92,7 +92,7 @@ pub struct decoder?(
|
||||
//
|
||||
// TODO: replace the magic "big enough" 1234 with something more
|
||||
// principled, perhaps discovered via an exhaustive search.
|
||||
huffs array[2] array[1234] base.u32,
|
||||
huffs array[2] array[1234] base.u32,
|
||||
n_huffs_bits array[2] base.u32[..9],
|
||||
|
||||
// history holds up to the last 32KiB of decoded output, if the decoding
|
||||
@@ -106,7 +106,7 @@ pub struct decoder?(
|
||||
//
|
||||
// history[history_index & 0x7FFF] is where the next byte of decoded output
|
||||
// will be written.
|
||||
history array[0x8000] base.u8, // 32 KiB.
|
||||
history array[0x8000] base.u8, // 32 KiB.
|
||||
history_index base.u32,
|
||||
|
||||
// code_lengths is used to pass out-of-band data to init_huff.
|
||||
|
||||
+14
-14
@@ -41,7 +41,7 @@ pri const interlace_start array[5] base.u32 = [0xFFFFFFFF, 1, 2, 4, 0]
|
||||
pri const interlace_delta array[5] base.u8 = [1, 2, 4, 8, 8]
|
||||
|
||||
pub struct decoder?(
|
||||
width base.u32,
|
||||
width base.u32,
|
||||
height base.u32,
|
||||
|
||||
// Call sequence states:
|
||||
@@ -72,8 +72,8 @@ pub struct decoder?(
|
||||
// - IC is decode_image_config, implicit means nullptr args.dst
|
||||
call_sequence base.u8,
|
||||
|
||||
end_of_data base.bool,
|
||||
restarted base.bool,
|
||||
end_of_data base.bool,
|
||||
restarted base.bool,
|
||||
previous_lzw_decode_ended_abruptly base.bool,
|
||||
|
||||
which_palette base.u8[..1],
|
||||
@@ -84,18 +84,18 @@ pub struct decoder?(
|
||||
// Absent an ANIMEXTS1.0 or NETSCAPE2.0 extension, the implicit number of
|
||||
// animation loops is 1.
|
||||
seen_num_loops base.bool,
|
||||
num_loops base.u32,
|
||||
num_loops base.u32,
|
||||
|
||||
seen_graphic_control base.bool,
|
||||
seen_graphic_control base.bool,
|
||||
gc_has_transparent_index base.bool,
|
||||
gc_transparent_index base.u8,
|
||||
gc_disposal base.u8,
|
||||
gc_transparent_index base.u8,
|
||||
gc_disposal base.u8,
|
||||
// There are 7056000 flicks per centisecond.
|
||||
gc_duration base.u64[..0xFFFF * 7056000],
|
||||
|
||||
frame_config_io_position base.u64,
|
||||
frame_config_io_position base.u64,
|
||||
num_decoded_frame_configs_value base.u64,
|
||||
num_decoded_frames_value base.u64,
|
||||
num_decoded_frames_value base.u64,
|
||||
|
||||
frame_rect_x0 base.u32,
|
||||
frame_rect_y0 base.u32,
|
||||
@@ -103,13 +103,13 @@ pub struct decoder?(
|
||||
frame_rect_y1 base.u32,
|
||||
|
||||
// The dst_etc fields are the output cursor during copy_to_image_buffer.
|
||||
dst_x base.u32,
|
||||
dst_y base.u32,
|
||||
dst_x base.u32,
|
||||
dst_y base.u32,
|
||||
dirty_y base.range_ie_u32,
|
||||
|
||||
compressed_ri base.u64,
|
||||
compressed_wi base.u64,
|
||||
compressed array[4096] base.u8,
|
||||
compressed array[4096] base.u8,
|
||||
|
||||
// palettes[0] and palettes[1] are the Global and Local Color Table.
|
||||
palettes array[2] array[4 * 256] base.u8,
|
||||
@@ -117,8 +117,8 @@ pub struct decoder?(
|
||||
dst_palette array[4 * 256] base.u8,
|
||||
|
||||
swizzler base.pixel_swizzler,
|
||||
util base.utility,
|
||||
lzw lzw.decoder,
|
||||
util base.utility,
|
||||
lzw lzw.decoder,
|
||||
)
|
||||
|
||||
pub func decoder.decode_image_config!??(dst nptr base.image_config, src base.io_reader) {
|
||||
|
||||
@@ -21,8 +21,8 @@ pub status "?bad encoding flags"
|
||||
pub status "?bad header"
|
||||
|
||||
pub struct decoder?(
|
||||
flate deflate.decoder,
|
||||
checksum crc32.ieee_hasher,
|
||||
flate deflate.decoder,
|
||||
checksum crc32.ieee_hasher,
|
||||
ignore_checksum base.bool,
|
||||
)
|
||||
|
||||
|
||||
@@ -24,15 +24,15 @@ pub struct decoder?(
|
||||
|
||||
// read_from state that does not change during a decode call.
|
||||
literal_width base.u32[..8],
|
||||
clear_code base.u32[..256],
|
||||
end_code base.u32[..257],
|
||||
clear_code base.u32[..256],
|
||||
end_code base.u32[..257],
|
||||
|
||||
// read_from state that does change during a decode call.
|
||||
save_code base.u32[..4096],
|
||||
prev_code base.u32[..4095],
|
||||
width base.u32[..12],
|
||||
bits base.u32,
|
||||
n_bits base.u32[..31],
|
||||
width base.u32[..12],
|
||||
bits base.u32,
|
||||
n_bits base.u32[..31],
|
||||
output_wi base.u32[..8191],
|
||||
|
||||
// read_from return value. The read_from method effectively returns a
|
||||
|
||||
@@ -23,8 +23,8 @@ pub status "?bad parity check"
|
||||
pri status "?TODO: unsupported preset dictionary"
|
||||
|
||||
pub struct decoder?(
|
||||
flate deflate.decoder,
|
||||
checksum adler32.hasher,
|
||||
flate deflate.decoder,
|
||||
checksum adler32.hasher,
|
||||
ignore_checksum base.bool,
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user