mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 16:47:28 +01:00
Move num_loops out of the image_config
For the GIF format, it isn't necessarily before the first frame.
This commit is contained in:
1 parent
36fd9cfd31
commit
7be9c39283
10 files changed
+187
-65
No files matched your search
@@ -127,11 +127,6 @@ pub func decoder.decode_image_config!??(dst nptr base.image_config, src base.io_
|
||||
|
||||
// TODO: if this.end_of_data, return an error and/or set dst to zero?
|
||||
|
||||
var num_loops base.u32 = 1
|
||||
if this.seen_num_loops {
|
||||
num_loops = this.num_loops
|
||||
}
|
||||
|
||||
var ffio base.bool = (not this.gc_has_transparent_index) and
|
||||
(this.frame_rect_x0 == 0) and
|
||||
(this.frame_rect_y0 == 0) and
|
||||
@@ -150,7 +145,6 @@ pub func decoder.decode_image_config!??(dst nptr base.image_config, src base.io_
|
||||
height:this.height,
|
||||
workbuf_len0:this.width as base.u64,
|
||||
workbuf_len1:this.width as base.u64,
|
||||
num_loops:num_loops,
|
||||
first_frame_io_position:this.frame_config_io_position,
|
||||
first_frame_is_opaque:ffio)
|
||||
}
|
||||
@@ -158,6 +152,13 @@ pub func decoder.decode_image_config!??(dst nptr base.image_config, src base.io_
|
||||
this.call_sequence = 1
|
||||
}
|
||||
|
||||
pub func decoder.num_animation_loops() base.u32 {
|
||||
if this.seen_num_loops {
|
||||
return this.num_loops
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
||||
pub func decoder.num_decoded_frame_configs() base.u64 {
|
||||
return this.num_decoded_frame_configs_value
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user