Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
There is a bug noted in github related to this issue.
You're using the wrong type then. Vector has a variable fixed length that depends on your specific hardware on your machine (ie. on what kind of vectorized registers are available). Assuming SSE2 as a baseline, Vector will always have (at least) a size of 4. On some machines it will have a size of 8, etc. You can't use it to store an arbitrarily long sequence of values, and even if you could, what you're doing here is very inefficient. If you want to store eg. a pixel color in BGRA32 format, storing each channel as an int means you'd be wasting 4x times the memory you need. You should instead store each channel as a byte, and have your pixel type only have a size of exactly 32 bits. For reference, I'd suggest taking a look at the Bgra32 pixel type in ImageSharp: https://github.com/SixLabors/ImageSharp/blob/master/src/ImageSharp/PixelFormats/PixelImplementations/Bgra32.cs.