Comments (6)
So I guess the weird thing here is that you want to iterate over the rows of the image in parallel, and then for each row iterate over the pixels sequentially. We already have support if you want to do both sequentially (enumerate_rows_mut().map(|row| ...)
) or both in parallel (par_enumerate_pixels_mut
).
I guess I don't see an issue with adding a par_enumerate_rows{_mut}
that would let you enumerate the pixels sequentially. Though it makes me wonder if all the rows
iteration methods should really have Item = &[P]
/ Item = &mut [P]
rather than in producing iterators themselves, so that the user had the option of iterating or just doing random accesses
from image.
If this were implemented with the types in this crate I would map each row to an EnumeratePixels(Mut)
instead of a normal slice iterator.
from image.
I think I personally would prefer that API as it would allow, as you say, the user to call either iter
or par_iter
on the slices, which gives more options for how to iterate over the data.
I think changing the sequential versions of the row iterators would be a breaking change though right?
from image.
It would even let you call chunks
or windows
or other fancy methods on it. But yeah, it would be a breaking change for the sequential row iterations and sightly awkward to have inconsistent behavior if we didn't match for the parallel iterations
from image.
I think it is a good idea to have them be consistent, since then you can just add a par_
in front and magically have parallelism. But it also sounds like it would be a very good idea to change the row iterators to return slices in the next major version.
These two things together mean that either the parallel versions should be implemented to be consistent now and then change both them and the serial ones in the next major version, or don't implement them until the next major version where the serial ones are changed.
from image.
I would love this right now! The specific use case I have for it is maintaining per-core cache coherency and allowing SIMD to be used more easily.
from image.
Related Issues (20)
- Format error decoding Png: Invalid PNG signature. When reading png with embedded color profile HOT 4
- Building with default features on macOS requires rustc v1.79 or newer. HOT 7
- Creating a new `PixelImage` type. HOT 6
- Animated WebP's cannot actually be loaded HOT 3
- Animated PNG is decoded incorrectly HOT 2
- Bug-Triage: Should image codec bug reports be moved to their upstream repos?
- The image crate is a top-5 bandwidth consumer on crates.io HOT 2
- Accidentally pushed to main HOT 1
- ImageReader::open and write_to performance issue HOT 8
- Floating point image generates incorrect thumbnail
- DynamicImage:from SubImage<&DynamicImage>::to_image creates Rgba8 instead of L16 HOT 3
- Thread panics on EXR containing NAN HOT 1
- Support for bottom-up and right-to-left images
- SVG image "format could not be determined" HOT 4
- JPG image first two bytes are not an SOI marker HOT 1
- Panic when checking broken tiff file HOT 1
- Freeze when trying to open and save jpg and webp files HOT 3
- Random crashes when decoding exr file HOT 2
- `image` still depends on `jpeg-decoder` through the `tiff` crate
- `rayon` is included in the dependency tree even when the `rayon` feature is disabled when `ravif` feature is enabled HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from image.