feat(pdf-filter): implement LZWDecode filter with predictor support#122
Merged
feat(pdf-filter): implement LZWDecode filter with predictor support#122
Conversation
Add LZW decompression (PDF spec §7.4.4) and shared Predictor post-processing (§7.4.4.4) to the pdf-filter crate. New modules: - lzw.rs: Pure-Rust LZW decoder with EarlyChange parameter support, variable-width codes (9-12 bits), MSB-first bit packing. - predictor.rs: TIFF Predictor 2 (horizontal differencing) and PNG predictors (None/Sub/Up/Average/Paeth). Shared by LZWDecode and FlateDecode. Changes: - bitreader.rs: Add read_bits(n) for variable-width code extraction. - filter.rs: Add LZWDecode variant, Lzw/Flate DecodeParms, wire into decode pipeline. Also wire predictor support into FlateDecode. - lib.rs: Register new modules, update crate documentation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add LZW decompression (PDF spec §7.4.4) and shared Predictor post-processing (§7.4.4.4) to the pdf-filter crate.
New modules:
Changes: