mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-23 00:47:56 +01:00
Remove the std/lzw decoder.available method
This commit is contained in:
1 parent
247232091d
commit
7a02605144
3 files changed
+7
-33
No files matched your search
@@ -2564,9 +2564,6 @@ wuffs_lzw__decoder__decode(wuffs_lzw__decoder* self,
|
|||||||
wuffs_base__io_writer a_dst,
|
wuffs_base__io_writer a_dst,
|
||||||
wuffs_base__io_reader a_src);
|
wuffs_base__io_reader a_src);
|
||||||
|
|
||||||
WUFFS_BASE__MAYBE_STATIC uint64_t //
|
|
||||||
wuffs_lzw__decoder__available(const wuffs_lzw__decoder* self);
|
|
||||||
|
|
||||||
WUFFS_BASE__MAYBE_STATIC wuffs_base__slice_u8 //
|
WUFFS_BASE__MAYBE_STATIC wuffs_base__slice_u8 //
|
||||||
wuffs_lzw__decoder__take_all(wuffs_lzw__decoder* self);
|
wuffs_lzw__decoder__take_all(wuffs_lzw__decoder* self);
|
||||||
|
|
||||||
@@ -2633,11 +2630,6 @@ struct wuffs_lzw__decoder__struct {
|
|||||||
return wuffs_lzw__decoder__decode(this, a_dst, a_src);
|
return wuffs_lzw__decoder__decode(this, a_dst, a_src);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline uint64_t //
|
|
||||||
available() const {
|
|
||||||
return wuffs_lzw__decoder__available(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline wuffs_base__slice_u8 //
|
inline wuffs_base__slice_u8 //
|
||||||
take_all() {
|
take_all() {
|
||||||
return wuffs_lzw__decoder__take_all(this);
|
return wuffs_lzw__decoder__take_all(this);
|
||||||
@@ -7470,20 +7462,6 @@ exit:
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------- func lzw.decoder.available
|
|
||||||
|
|
||||||
WUFFS_BASE__MAYBE_STATIC uint64_t //
|
|
||||||
wuffs_lzw__decoder__available(const wuffs_lzw__decoder* self) {
|
|
||||||
if (!self) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (self->private_impl.magic != WUFFS_BASE__MAGIC) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ((uint64_t)(self->private_impl.f_flush_j));
|
|
||||||
}
|
|
||||||
|
|
||||||
// -------- func lzw.decoder.take_all
|
// -------- func lzw.decoder.take_all
|
||||||
|
|
||||||
WUFFS_BASE__MAYBE_STATIC wuffs_base__slice_u8 //
|
WUFFS_BASE__MAYBE_STATIC wuffs_base__slice_u8 //
|
||||||
@@ -9538,9 +9516,9 @@ wuffs_gif__decoder__decode_id_part1(wuffs_gif__decoder* self,
|
|||||||
iop_v_r = o_0_iop_v_r;
|
iop_v_r = o_0_iop_v_r;
|
||||||
io1_v_r = o_0_io1_v_r;
|
io1_v_r = o_0_io1_v_r;
|
||||||
}
|
}
|
||||||
if (wuffs_lzw__decoder__available(&self->private_impl.f_lzw) > 0) {
|
v_uncompressed =
|
||||||
v_uncompressed =
|
wuffs_lzw__decoder__take_all(&self->private_impl.f_lzw);
|
||||||
wuffs_lzw__decoder__take_all(&self->private_impl.f_lzw);
|
if (((uint64_t)(v_uncompressed.len)) > 0) {
|
||||||
status = wuffs_gif__decoder__copy_to_image_buffer(self, a_dst,
|
status = wuffs_gif__decoder__copy_to_image_buffer(self, a_dst,
|
||||||
v_uncompressed);
|
v_uncompressed);
|
||||||
if (status) {
|
if (status) {
|
||||||
|
|||||||
@@ -661,8 +661,8 @@ pri func decoder.decode_id_part1!??(dst ptr base.pixel_buffer, src base.io_reade
|
|||||||
this.compressed_ri ~sat+= r.since_mark().length()
|
this.compressed_ri ~sat+= r.since_mark().length()
|
||||||
}
|
}
|
||||||
|
|
||||||
if this.lzw.available() > 0 {
|
var uncompressed slice base.u8 = this.lzw.take_all!()
|
||||||
var uncompressed slice base.u8 = this.lzw.take_all!()
|
if uncompressed.length() > 0 {
|
||||||
this.copy_to_image_buffer!?(pb:args.dst, src:uncompressed)
|
this.copy_to_image_buffer!?(pb:args.dst, src:uncompressed)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -266,14 +266,10 @@ pri func decoder.flush!??(dst base.io_writer) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: enforce that available and take_all are only valid to call if decode
|
// TODO: enforce that take_all is only valid to call if decode was always
|
||||||
// was passed a 0-length dst base.io_writer? The (non-obvious) hard part is to
|
// passed a 0-length dst base.io_writer? The (non-obvious) hard part is to
|
||||||
// enforce that without regressing benchmarks.
|
// enforce that without regressing benchmarks.
|
||||||
|
|
||||||
pub func decoder.available() base.u64 {
|
|
||||||
return this.flush_j as base.u64
|
|
||||||
}
|
|
||||||
|
|
||||||
pub func decoder.take_all!() slice base.u8 {
|
pub func decoder.take_all!() slice base.u8 {
|
||||||
var s slice base.u8 = this.output[:this.flush_j]
|
var s slice base.u8 = this.output[:this.flush_j]
|
||||||
this.flush_j = 0
|
this.flush_j = 0
|
||||||
|
|||||||
Reference in new issue
Block a user