Implement TASImage::Paint() for PDF#22344
Open
vvolkl wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
Note that since the indices are changed any reference pdfs need to be updated. I think there are some in roottest but not sure if they are still used/up to date? |
Test Results 22 files 22 suites 3d 9h 33m 11s ⏱️ For more details on these failures, see this check. Results for commit 9300257. ♻️ This comment has been updated with latest results. |
44ed348 to
9300257
Compare
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.
This Pull request:
Changes or fixes:
Previously TImage/TASImage only rendered to raster outputs: drawing an image and saving to PDF produced nothing but a
Warning in <TASImage::Paint>: PDF not implemented yet.TPDF::CellArrayBegin/CellArrayFill/CellArrayEndwere warning-only stubs andTASImage::Paintbailed out early for the PDF case. This changeset implements bitmap rendering to PDF. The early-return branch inTASImage::Paintis removed so PDF output flows through the sameCellArray*path already used for PostScript, andTPDFnow implements that API:pixels accumulated by
CellArrayFillare Flate-compressed and emitted as a proper PDF image XObject, the page's/Resourcescarries an/XObjectname dictionary, and the page content-stream only references the bitmap with a placement matrix and a
/ImN Dooperator. A new fixed object number is reserved for the shared image dictionary, shifting the first page objectfrom 51 to 52, and the XObjects are allocated and written at
Close()since a PDF object cannot be opened while a page content stream is still in progress. A gtest undergraf2d/gpad/testrenders a four-colour synthetic TImage to PDF and verifies both the XObject structure and that the embedded pixels decode back to the colours drawn. Verified onsingle-page and multi-page documents with the cross-reference table validated; SVG output, which already worked, is unaffected.
Checklist:
This PR fixes #22251
Assisted-by: Claude:claude-4.7-opus