Redesign TASImage::Paint() - #23246
Open
linev wants to merge 13 commits into
Open
Conversation
These classes should handle image drawing directly without complex logic in TASImage::Paint method. Now it is just entry points
Just call Merge for target image
Instead calling 4 different methods, just create PNG buffer and embed it into SVG file. Make implementation straight-forward
1. GetMaskBits create vector which can be used to create masks in X11 displayes One will be able to create pixmap with such masks later On 2. DrawX11 provides hook to call x11 drawing in the TASImage. Idea to remove use gVirtualX API from internals of TASImage and just invoke existing functionality from outside 3. Configure proper PNG parameters when calling GetImageBuffer These new methods will be used in different implementations of DrawImage
Simplify logic how image placed in the PDF file Old API was not clear enough for that
Use correct coordinates calculations to properly scale image from pixel to PS coordinates Partially use old API - until old will be deprecated
Redirect to fPS instance, recalculate to global coordinates while all image formats operate with global coordinates
Use gVirtualX-based code like in original Image2Drawable method of TASImage. There are now several shortcuts, therefore methods looks much simpler. Also GL handling will be implemented in correspondent painter
Simple redirection to existing DrawPixels method, can be eliminated in the future while only used from ASImage
Radical paradigm change. Now image painting delegated to pad painter instance, which knows better details of platform. Thus lot of magic around virtualX, virtualPS, GL completely vanishes. Extra palette painting made very simple and works exactly the same as image painting itself plut TGaxis. Special implementation provided for: - gVirtualX and TGX11 in TPadPainter - GL support in TGLPadPainter - SVG, PS, PDF, ImageDump via TPadPainterPS New approach opens possibility to provide image painting for any external platforms like Qt6 or Gtk4 or any other
After change in TASImage::Paint there are minimal changes in scaling/offset because of different rounding Therefore in SVG file image offset changed sometime by one pixel or scaling factor by 0.1%.
After change code to TTFhandle wrong align was applied. One should use 13 instead 11
When image object drawn on the pad - just use pp->DrawImage(). It is natural way now.
Test Results 3 files 3 suites 2h 21m 56s ⏱️ Results for commit 77bd512. |
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.
Radical paradigm change.
Now image painting delegated to pad painter instance, which knows better
details of the platform. Thus lot of magic around
gVirtualX,gVirtualPS,gPad->GetGLDevice()completely vanishes and move to correspondent back-end. Extra palette painting made very simple.
Provide two methods for
TASImage/TImageto make implementation easier.One is access to image mask bits and second is direct invocation of X11-optimize function.
Last used only with
TPadPainterwhich operates withgVirtualXSpecial implementation provided for:
gVirtualXandTGX11inTPadPainterGLsupport in TGLPadPainterSVG,PS,PDF,ImageDumpviaTPadPainterPSNew approach opens possibility to provide image painting for
any external platforms like Qt6 or Gtk4 or any other
Later one can remove old ugly API from
TVirtualPS:and from
TVirtualPadPainter:This was last hard place with complex dependency from
gVirtualX,