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

Progress callback? #23

Closed
emerth opened this issue Apr 10, 2022 · 6 comments
Closed

Progress callback? #23

emerth opened this issue Apr 10, 2022 · 6 comments

Comments

@emerth
Copy link

emerth commented Apr 10, 2022

Is there a way to set a "progress callback function" either before or when invoking CImageResizer::resizeImage()?

I would like to show a progress control in my program while AVIR is resizing a large image. Went looking for a callback in AVIR that would indicate progress while resizing, can't see anything.

Is there a progress reporting method available?

Thanks!

@avaneev
Copy link
Owner

avaneev commented Apr 11, 2022

Sorry, no such callback is available, and it's not planned for implementation as even a very large images usually resize in less than a second on a modern processor.

@avaneev avaneev closed this as completed Apr 11, 2022
@emerth
Copy link
Author

emerth commented Apr 11, 2022

Thanks Aleksey!

I am getting about 1.8 seconds to scale RGBA images on the order of 15000x15000 pixels down to 2160x2160.

This is on a Ryzen 3600X with RAM at 3200.

Is this slow? Your answer suggests it should be faster. Perhaps I am doing something wrong...

@avaneev
Copy link
Owner

avaneev commented Apr 11, 2022

Are you using multi-threading? But even if not, 1.8 seconds is not exactly much to justify adding a progress indication.

@emerth
Copy link
Author

emerth commented Apr 11, 2022

I am not using multithreading. Didn't know I could. I will look at that.

The 1.8 seconds is very subjective. I think your AVIR software is fast and the image quality is superior. Some people who have tested my program tell me the 1.8 seconds is enough that they would feel better with a progress bar rather than just a Windows hour glass indicator. But it's not very very important feature. If I can cut the time by a factor of 2 or 4 using more cores that will be perfect.

Thanks again!

edit) #8 <<------ staring me in the face!!

@emerth
Copy link
Author

emerth commented Apr 16, 2022

Used your Multithreading How To doc and added multithreading to the resize. Very nice, 4 threads, cut the time to about 30% of single thread.

This is a very elegant library you've made here. Your thread pool concept implementation is very nice.

@avaneev
Copy link
Owner

avaneev commented Apr 17, 2022

You are welcome!

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

No branches or pull requests

2 participants