|
|
|
@ -72,6 +72,15 @@ namespace SixLabors.ImageSharp.Formats.Tiff.Utils |
|
|
|
return color; |
|
|
|
} |
|
|
|
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
public static TPixel ColorScaleTo24Bit<TPixel>(ulong r, ulong g, ulong b, ulong a, TPixel color) |
|
|
|
where TPixel : unmanaged, IPixel<TPixel> |
|
|
|
{ |
|
|
|
var colorVector = new Vector4(r * Scale24Bit, g * Scale24Bit, b * Scale24Bit, a * Scale24Bit); |
|
|
|
color.FromVector4(colorVector); |
|
|
|
return color; |
|
|
|
} |
|
|
|
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
public static TPixel ColorScaleTo32Bit<TPixel>(ulong r, ulong g, ulong b, TPixel color) |
|
|
|
where TPixel : unmanaged, IPixel<TPixel> |
|
|
|
@ -85,7 +94,7 @@ namespace SixLabors.ImageSharp.Formats.Tiff.Utils |
|
|
|
public static TPixel ColorScaleTo32Bit<TPixel>(ulong r, ulong g, ulong b, ulong a, TPixel color) |
|
|
|
where TPixel : unmanaged, IPixel<TPixel> |
|
|
|
{ |
|
|
|
var colorVector = new Vector4(r * Scale32Bit, g * Scale32Bit, b * Scale32Bit, a); |
|
|
|
var colorVector = new Vector4(r * Scale32Bit, g * Scale32Bit, b * Scale32Bit, a * Scale32Bit); |
|
|
|
color.FromVector4(colorVector); |
|
|
|
return color; |
|
|
|
} |
|
|
|
|