MCPcopy Create free account
hub / github.com/TheRealMJP/BakingLab / tdefl_flush_output_buffer

Function tdefl_flush_output_buffer

SampleFramework11/v1.02/TinyEXR.cpp:3749–3768  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3747}
3748
3749static tdefl_status tdefl_flush_output_buffer(tdefl_compressor *d) {
3750 if (d->m_pIn_buf_size) {
3751 *d->m_pIn_buf_size = d->m_pSrc - (const mz_uint8 *)d->m_pIn_buf;
3752 }
3753
3754 if (d->m_pOut_buf_size) {
3755 size_t n = MZ_MIN(*d->m_pOut_buf_size - d->m_out_buf_ofs,
3756 d->m_output_flush_remaining);
3757 memcpy((mz_uint8 *)d->m_pOut_buf + d->m_out_buf_ofs,
3758 d->m_output_buf + d->m_output_flush_ofs, n);
3759 d->m_output_flush_ofs += (mz_uint)n;
3760 d->m_output_flush_remaining -= (mz_uint)n;
3761 d->m_out_buf_ofs += n;
3762
3763 *d->m_pOut_buf_size = d->m_out_buf_ofs;
3764 }
3765
3766 return (d->m_finished && !d->m_output_flush_remaining) ? TDEFL_STATUS_DONE
3767 : TDEFL_STATUS_OKAY;
3768}
3769
3770tdefl_status tdefl_compress(tdefl_compressor *d, const void *pIn_buf,
3771 size_t *pIn_buf_size, void *pOut_buf,

Callers 1

tdefl_compressFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected