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

Refactor Image for storing ImageMetadata #1496

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

amartya4256
Copy link
Contributor

@amartya4256 amartya4256 commented Sep 26, 2024

This PR contributes to the refactoring of Image class for win32. The goal is to encapsulate the metadata in ImageMeadata class and store imageMetadata for each zoom level for every image instead of zoom level to handle. This way we obtain the imagedata for every image at different zoom by calling the metadata object for that zoom level.

contributes to #62 and #127

Copy link
Contributor

github-actions bot commented Sep 26, 2024

Test Results

   486 files  ±0     486 suites  ±0   8m 22s ⏱️ +22s
 4 159 tests ±0   4 151 ✅ ±0   8 💤 ±0  0 ❌ ±0 
16 390 runs  ±0  16 298 ✅ ±0  92 💤 ±0  0 ❌ ±0 

Results for commit 6225eae. ± Comparison against base commit a4fe53b.

♻️ This comment has been updated with latest results.

return image;
}

class ImageMetadata {
Copy link
Contributor

Choose a reason for hiding this comment

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

As we are moving logic into this class now, I would probably renamed it as it is more than data now, something like ImageHandle? And it can be private, can't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How About ImageHandleProvider, since handle is an interior member of it?

@@ -2312,6 +1979,7 @@ public void setBackground(Color color) {

/* Get the HDC for the device */
long hDC = device.internal_new_GC(null);
long handle = win32_getHandle(this, getZoom());
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, why using this handle? Shouldn't that be applied to all handles?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm. Earlier, it was just done by the handle. But you are right. It means it was a wrong implementation already.

@amartya4256 amartya4256 force-pushed the imageMetadata branch 2 times, most recently from a6b2e33 to 8067b98 Compare October 10, 2024 11:38
This contribution encapsulates the metadata of the image in an
innerclass ImageHandle which is used to create a hashmap of zoom level
to imageHandle object inside an image object, making it straight
forward to obtain any metadata information from an image for a zoom
level.

contributes to eclipse-platform#62 and eclipse-platform#127
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.

2 participants