wuffsfmt: double-indents hanging lines

This commit is contained in:
Nigel Tao committed 2023-04-09 15:22:25 +10:00
1 parent d910658bce
commit 9c03b8c71d
40 files changed
+2579 -2571

No files matched your search

+43 -43
View File
@@ -21,19 +21,19 @@ pri status "@internal note: short read"
pub const DECODER_WORKBUF_LEN_MAX_INCL_WORST_CASE : base.u64 = 0
pub struct decoder? implements base.image_decoder(
pixfmt : base.u32,
width : base.u32[..= 0x7FFF_FFFF],
height : base.u32[..= 0x7FFF_FFFF],
pixfmt : base.u32,
width : base.u32[..= 0x7FFF_FFFF],
height : base.u32[..= 0x7FFF_FFFF],
// The call sequence state machine is discussed in
// (/doc/std/image-decoders-call-sequence.md).
call_sequence : base.u8,
// The call sequence state machine is discussed in
// (/doc/std/image-decoders-call-sequence.md).
call_sequence : base.u8,
dst_x : base.u32,
dst_y : base.u32,
dst_x : base.u32,
dst_y : base.u32,
swizzler : base.pixel_swizzler,
util : base.utility,
swizzler : base.pixel_swizzler,
util : base.utility,
)
pub func decoder.set_quirk_enabled!(quirk: base.u32, enabled: base.bool) {
@@ -90,12 +90,12 @@ pri func decoder.do_decode_image_config?(dst: nptr base.image_config, src: base.
if args.dst <> nullptr {
args.dst.set!(
pixfmt: this.pixfmt,
pixsub: 0,
width: this.width,
height: this.height,
first_frame_io_position: 16,
first_frame_is_opaque: false)
pixfmt: this.pixfmt,
pixsub: 0,
width: this.width,
height: this.height,
first_frame_io_position: 16,
first_frame_is_opaque: false)
}
this.call_sequence = 0x20
@@ -131,17 +131,17 @@ pri func decoder.do_decode_frame_config?(dst: nptr base.frame_config, src: base.
if args.dst <> nullptr {
args.dst.set!(bounds: this.util.make_rect_ie_u32(
min_incl_x: 0,
min_incl_y: 0,
max_excl_x: this.width,
max_excl_y: this.height),
duration: 0,
index: 0,
io_position: 16,
disposal: 0,
opaque_within_bounds: false,
overwrite_instead_of_blend: false,
background_color: 0x0000_0000)
min_incl_x: 0,
min_incl_y: 0,
max_excl_x: this.width,
max_excl_y: this.height),
duration: 0,
index: 0,
io_position: 16,
disposal: 0,
opaque_within_bounds: false,
overwrite_instead_of_blend: false,
background_color: 0x0000_0000)
}
this.call_sequence = 0x40
@@ -174,11 +174,11 @@ pri func decoder.do_decode_frame?(dst: ptr base.pixel_buffer, src: base.io_reade
this.dst_y = 0
status = this.swizzler.prepare!(
dst_pixfmt: args.dst.pixel_format(),
dst_palette: args.dst.palette(),
src_pixfmt: this.util.make_pixel_format(repr: this.pixfmt),
src_palette: this.util.empty_slice_u8(),
blend: args.blend)
dst_pixfmt: args.dst.pixel_format(),
dst_palette: args.dst.palette(),
src_pixfmt: this.util.make_pixel_format(repr: this.pixfmt),
src_palette: this.util.empty_slice_u8(),
blend: args.blend)
if not status.is_ok() {
return status
}
@@ -246,24 +246,24 @@ pri func decoder.swizzle!(dst: ptr base.pixel_buffer, src: base.io_reader) base.
while j >= 8 {
if args.src.length() >= ((src_bytes_per_pixel * 8) as base.u64) {
args.src.skip_u32_fast!(
actual: src_bytes_per_pixel * 8,
worst_case: src_bytes_per_pixel * 8)
actual: src_bytes_per_pixel * 8,
worst_case: src_bytes_per_pixel * 8)
}
j -= 8
} endwhile
while j > 0 {
if args.src.length() >= ((src_bytes_per_pixel * 1) as base.u64) {
args.src.skip_u32_fast!(
actual: src_bytes_per_pixel * 1,
worst_case: src_bytes_per_pixel * 1)
actual: src_bytes_per_pixel * 1,
worst_case: src_bytes_per_pixel * 1)
}
j -= 1
} endwhile
} else {
n = this.swizzler.swizzle_interleaved_from_reader!(
dst: dst[i ..],
dst_palette: args.dst.palette(),
src: args.src)
dst: dst[i ..],
dst_palette: args.dst.palette(),
src: args.src)
}
if n == 0 {
return "@internal note: short read"
@@ -276,10 +276,10 @@ pri func decoder.swizzle!(dst: ptr base.pixel_buffer, src: base.io_reader) base.
pub func decoder.frame_dirty_rect() base.rect_ie_u32 {
return this.util.make_rect_ie_u32(
min_incl_x: 0,
min_incl_y: 0,
max_excl_x: this.width,
max_excl_y: this.height)
min_incl_x: 0,
min_incl_y: 0,
max_excl_x: this.width,
max_excl_y: this.height)
}
pub func decoder.num_animation_loops() base.u32 {