-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSSTUDIO-2939 Add property "SVG Rendering Resolution Factor" to the Picture and Symbol widgets #3245
base: master
Are you sure you want to change the base?
Conversation
…of widget properties of the Picture Widget.
…hen the SVG rendering resolution factor has changed.
…on factor in the Symbol Widget.
This is all quite unfortunate. The S in SVG stands for Scalable. Draw once, view in any size. |
I agree.
The default is set to
The problem with the implementation in #3197 is that the memory consumption of many OPIs where zooming-in is not required can grow substantially. The suggestion to apply the re-scaling only when zooming-in seems complicated to implement: zoom-events would have to be captured, and if several zoom-events happen in a short timeframe they would need to be processed in-order. In addition, the set of SVGs in the current OPI would have to be determined by recursing over widgets including possibly embedded displays and tabs. My intuition is that implementing this functionality correctly would be complicated, and I therefore prefer this more simple design.
I have previously tried to use |
Yes. Since this only applies to SVG, should we hack this into the image file name? How big is the actual problem? What do your screens look like when you don't have that scaling factor? How about simply not using SVG in the displays? Batch-convert all your SVGs into PNGs of sufficient size (on Linux, use ImageMagic) and then use those in the display. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to the memory consumption impact I'd propose to add some kind of information to alert the user of the consequences of boosting the scaling factor. Maybe a tooltip, or an addition to one of the example OPIs.
Would it be OK for you if the widget property is hidden in the UI by default, but can be enabled by setting a special option in |
A tooltip would be a good solution I think, but unfortunately I think it is difficult to add due to the structure of the code: the tooltips are set in the class |
I like that. |
…lder.model/enable_svg_rendering_resolution_factor' to configure whether the "SVG Rendering Resolution Factor" widget property is available in the Picture and Symbol widgets.
I have updated the pull request to include the option |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if a display file is created with the scaling factor and then opened in Phoebus where the property is disabled?
Then no scaling is applied to the rendered SVG. If the OPI is saved, the original scaling factor is not present in the saved file. |
This pull request adds the widget property "SVG Rendering Resolution Factor" to the Picture and Symbol widgets:
The functionality enables a sharper image when zooming in, at the expense of a quadratic increase in memory consumption. E.g., by setting the SVG rendering resolution factor to
2.0
, an SVG can be rendered at twice the width and twice the height, but the memory required to represent the image grows by a factor of four.This functionality is similar to the functionality implemented in #3197, except that the rendering resolution factor is now set per-widget.