ChromaKit
ChromaKit copied to clipboard
Use SIMD storage and calculations
Updates all color types to use SIMD3<Double> as their actual color storage, which makes these types more usable with lower level graphics code (like Metal). The color matrix is now a simd type too, making the dot product logic very simple.
Notes:
- I haven’t done any performance comparisons, but hopefully this makes the conversions a tad more efficient.
- Simd matrix structs are stored in columns rather than rows. I think we can improve the performance more by ‘rotating’ all matrices so they’re initialized with
init(_ col0: SIMD3<Double>, _ col1: SIMD3<Double>, _ col2: SIMD3<Double>)instead ofinit(rows: [SIMD3<Double>])which I think manually has to run through the provided array and set the correct values.