private static ObjectHandle CreateHandle(PackagingBytes packagingBytes, RgbaComponents components, RgbaUintBitCount bitCount) { if (packagingBytes == null) { throw new ArgumentNullException(nameof(packagingBytes)); } if (components == null) { throw new ArgumentNullException(nameof(components)); } if (bitCount == null) { throw new ArgumentNullException(nameof(bitCount)); } var unmanagedPackagingBytes = new Import.PackagingBytes { byteCount = (uint)packagingBytes.ByteCount, endianness = packagingBytes.Endianness.GetUnmanagedEndianness() }; var unmanagedComponents = new Import.RgbaComponents { r = components.Red.GetUnmanagedComponent(), g = components.Green.GetUnmanagedComponent(), b = components.Blue.GetUnmanagedComponent(), a = components.Alpha.GetUnmanagedComponent(), }; var unmanagedBitCount = new Import.RgbaUintBitCount { r = bitCount.Red, g = bitCount.Green, b = bitCount.Blue, a = bitCount.Alpha, }; return(Api.RgbaUintFormatCreate(ref unmanagedPackagingBytes, ref unmanagedComponents, ref unmanagedBitCount)); }
public static extern void RgbaUintFormatGetComponents(ObjectHandle format, out RgbaComponents components);
public static extern ObjectHandle RgbaUintFormatCreate(ref PackagingBytes packagingBytes, ref RgbaComponents components, ref RgbaUintBitCount bitCount);