Rename std/gif num_loops field

This commit is contained in:
Nigel Tao committed 2021-11-09 08:55:15 +11:00
1 parent f4c2d4652e
commit 74c1dfce96
2 files changed
+18 -17

No files matched your search

+8 -8
View File
@@ -7853,8 +7853,8 @@ struct wuffs_gif__decoder__struct {
bool f_previous_lzw_decode_ended_abruptly;
bool f_has_global_palette;
uint8_t f_interlace;
bool f_seen_num_loops;
uint32_t f_num_loops;
bool f_seen_num_animation_loops_value;
uint32_t f_num_animation_loops_value;
uint32_t f_background_color_u32_argb_premul;
uint32_t f_black_color_u32_argb_premul;
bool f_gc_has_transparent_index;
@@ -29222,8 +29222,8 @@ wuffs_gif__decoder__num_animation_loops(
return 0;
}
if (self->private_impl.f_seen_num_loops) {
return self->private_impl.f_num_loops;
if (self->private_impl.f_seen_num_animation_loops_value) {
return self->private_impl.f_num_animation_loops_value;
}
return 1;
}
@@ -30370,11 +30370,11 @@ wuffs_gif__decoder__decode_ae(
*scratch |= ((uint64_t)(num_bits_4)) << 56;
}
}
self->private_impl.f_num_loops = t_4;
self->private_impl.f_num_animation_loops_value = t_4;
}
self->private_impl.f_seen_num_loops = true;
if ((0 < self->private_impl.f_num_loops) && (self->private_impl.f_num_loops <= 65535)) {
self->private_impl.f_num_loops += 1;
self->private_impl.f_seen_num_animation_loops_value = true;
if ((0 < self->private_impl.f_num_animation_loops_value) && (self->private_impl.f_num_animation_loops_value <= 65535)) {
self->private_impl.f_num_animation_loops_value += 1;
}
} else if (self->private_impl.f_ignore_metadata) {
} else if (v_is_iccp && self->private_impl.f_report_metadata_iccp) {
+10 -9
View File
@@ -84,8 +84,8 @@ pub struct decoder? implements base.image_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,
seen_num_animation_loops_value : base.bool,
num_animation_loops_value : base.u32,
background_color_u32_argb_premul : base.u32,
black_color_u32_argb_premul : base.u32,
@@ -96,7 +96,8 @@ pub struct decoder? implements base.image_decoder(
// There are 7_056000 flicks per centisecond.
gc_duration : base.u64[..= 0xFFFF * 7_056000],
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,
@@ -275,8 +276,8 @@ pub func decoder.tell_me_more?(dst: base.io_writer, minfo: nptr base.more_inform
}
pub func decoder.num_animation_loops() base.u32 {
if this.seen_num_loops {
return this.num_loops
if this.seen_num_animation_loops_value {
return this.num_animation_loops_value
}
return 1
}
@@ -662,8 +663,8 @@ pri func decoder.decode_ae?(src: base.io_reader) {
args.src.skip_u32?(n: 2)
break.goto_done
}
this.num_loops = args.src.read_u16le_as_u32?()
this.seen_num_loops = true
this.num_animation_loops_value = args.src.read_u16le_as_u32?()
this.seen_num_animation_loops_value = true
// A loop count of N, in the wire format, actually means "repeat N
// times after the first play", if N is positive. A zero N means to
@@ -675,8 +676,8 @@ pri func decoder.decode_ae?(src: base.io_reader) {
//
// Thus, we increment N if it is positive. The comparison against
// 0xFFFF will never fail, but is necessary for the overflow checker.
if (0 < this.num_loops) and (this.num_loops <= 0xFFFF) {
this.num_loops += 1
if (0 < this.num_animation_loops_value) and (this.num_animation_loops_value <= 0xFFFF) {
this.num_animation_loops_value += 1
}
} else if this.ignore_metadata {