-
Notifications
You must be signed in to change notification settings - Fork 610
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
Another dynamic image type approach #1159
Comments
Have you had a look at the I'm afraid I can't follow all of what you've written.
In particular, it's very unclear to me how your draft would incorporate type information that's required to access pixels of an image. It needs to be supplied at some point, and currently is part of the type parameter of |
I see That's where my argument stems from. The current type design might be too picky if some information is only given in runtime over distinct channels, pixel types and storage types. I'm still open to any solutions that could resolve this issue. I think we can make more clarifications for further discussion.
My proposal using dynamic pixel might be a solution, but not limited to. I look forward a design that is better than adding more variants in TL;DR: I think we need better support on dynamic images. nalgebra's approach might be a reference. |
nalgebra unfortunately does not attempt to solve the channel type problem, the size constraint is simpler (I think? Can you make clear how your intend to solve types in a similar manner?). I also don't like how hard it makes to read the documentation.
It was designed to do that. It failed, I do agreed, but no better replacement has been made available either. At least it enabled passing both an I would like to point out that a new dynamic interface does not have to replace the currently available |
Thanks you for pointing out image-canvas. The thread would diverges to talks on philosophy of design, so it's fine to close it. Suppose the next step is to fix the |
Thread closed as by your request, if I understood correctly, feel free to reopen or create a new issue if there is development in the matter. Some final maintainer note on the planned direction of development:
As that is a major break, changing anything about the current |
I stumbled on writing an image type over slicesm with dynamic pixel type depending on the runtime context. To be exact, the function returns the enum below.
Though we have
DynamicImage
, it assumesVec<_>
as underlying buffer. It incurs a large image copy if my function returnsDynamicImage
, while my function is called several times. Hence, I choose to roll my own enum. That means I would implementGenericImage
andGenericImageView
manually on the enum for later use. Otherwise, I cannot avoid thematch
hell.Here I'm considering an alternative: Oppsed from
DynamicImage
being an enum over several variants ofImageBuffer
, suppose we can derive an image of dynamic pixel and buffer, instead of enums?In this way, I see we cannot avoid the great refactoring over the crate. Nevertheless, it's more like an once for all solution and gains more flexibility.
The text was updated successfully, but these errors were encountered: