mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 16:47:28 +01:00
Factor out a std/gif copy_to_image_buffer func
This commit is contained in:
1 parent
4926e98956
commit
ae0de1d35a
2 files changed
+35
-22
No files matched your search
+14
-10
@@ -433,16 +433,7 @@ pri func decoder.decode_id_part1?(ib ptr base.image_buffer, dst base.io_writer,
|
||||
}
|
||||
|
||||
} else {
|
||||
// TODO: don't assume a packed pixel format.
|
||||
var tab table base.u8 = in.ib.plane(p:0)
|
||||
if tab.width() == tab.stride() {
|
||||
var pixel_data slice base.u8 = tab.linearize()
|
||||
if pixel_data.length() == 0 {
|
||||
// TODO.
|
||||
}
|
||||
} else {
|
||||
// TODO.
|
||||
}
|
||||
this.copy_to_image_buffer(ib:in.ib)
|
||||
}
|
||||
|
||||
if z == suspension "short write" {
|
||||
@@ -481,3 +472,16 @@ pri func decoder.decode_id_part1?(ib ptr base.image_buffer, dst base.io_writer,
|
||||
this.gc_disposal = 0
|
||||
this.gc_duration = 0
|
||||
}
|
||||
|
||||
pri func decoder.copy_to_image_buffer(ib ptr base.image_buffer)() {
|
||||
// TODO: don't assume a packed pixel format.
|
||||
var tab table base.u8 = in.ib.plane(p:0)
|
||||
if tab.width() == tab.stride() {
|
||||
var pixel_data slice base.u8 = tab.linearize()
|
||||
if pixel_data.length() == 0 {
|
||||
// TODO.
|
||||
}
|
||||
} else {
|
||||
// TODO.
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user