Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
 public static extern void RgbaUintFormatGetComponents(ObjectHandle format, out RgbaComponents components);
Exemplo n.º 3
0
 public static extern ObjectHandle RgbaUintFormatCreate(ref PackagingBytes packagingBytes, ref RgbaComponents components, ref RgbaUintBitCount bitCount);