Improve performance for GrayScale, InvertColors, AdjustHue, AdjustLuminance, AdjustSaturation
InvertColors
Now uses XOR to invert all 3 color channels in one go.
AdjustHue, AdjustLuminance, AdjustSaturation
These functions used to copy the fPixels array to a new HSL array and then back to a new fPixels array. Making them use 3 times the memory and suffering from dynamic array overhead (unnecessary zero-initialization via SetLength, CPU locks for reference management). The color conversion is now done directly in the fPixels array with a temporary helper variable.
Improve performance for GrayScale, InvertColors, AdjustHue, AdjustLuminance, AdjustSaturation
InvertColors Now uses XOR to invert all 3 color channels in one go.
AdjustHue, AdjustLuminance, AdjustSaturation These functions used to copy the fPixels array to a new HSL array and then back to a new fPixels array. Making them use 3 times the memory and suffering from dynamic array overhead (unnecessary zero-initialization via SetLength, CPU locks for reference management). The color conversion is now done directly in the fPixels array with a temporary helper variable.