Skip to content
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

Improvements for the image layer #263

Merged
merged 2 commits into from
Aug 21, 2024
Merged

Improvements for the image layer #263

merged 2 commits into from
Aug 21, 2024

Conversation

lesquoyb
Copy link
Contributor

fixes #262 but also some clues for further improvements.
@AlexisDrogoul could you double check this one as there are some points that I think could be improved in this class but I'm not sure yet:

  1. This class uses a cached ImageProvider, but as the layer is only refreshed when the refresh facet is true, and that is checked in different parts of the code, I wonder what's the point of this object ? Maybe for files ?
  2. The BufferedImage to be drawn is actually generated in the buildImage method, but it is not returned, instead the ImageProvider that did generate it is returned and is then drawn with the drawAsset method. I think that this method is generating another bufferedimage but I'm not sure and it may depend on many factors (nature of the provider, facets of the layer/display etc.). I did a test it with a matrix that changed every cycle and compared the average cycle time with current method and with one were we return the buffered image and draw it with the method drawImage instead: I noticed a slight improvement (around 10%) in the average cycle execution time but it may as well be normal variability in simulations and I didn't dig much more.

- use the evaluated expression of provider instead of it's assumed type, because else it is not specialized enough (IMatrix instead of GamaIntMatrix)
- some minor renaming and refactoring and documentation
@lesquoyb lesquoyb requested a review from AlexisDrogoul July 15, 2024 10:41
Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Health Quality Gates: OK

Change in average Code Health of affected files: -0.00 (9.60 -> 9.59)

View detailed results in CodeScene

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Health Quality Gates: OK

Change in average Code Health of affected files: -0.00 (9.57 -> 9.57)

View detailed results in CodeScene

@lesquoyb lesquoyb merged commit 4acd159 into 2024-06 Aug 21, 2024
6 checks passed
@lesquoyb lesquoyb deleted the improve-image-layer branch August 21, 2024 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Image layer do not work with matrices anymore
1 participant