/// <summary>
        /// Constructs the <see cref="VectorComponent"/>.
        /// </summary>
        /// <param name="type">The type of data that will be stored in the component.</param>
        /// <param name="channel">The channel type that the component represents.</param>
        /// <param name="bits">The size of the component in bits.</param>
        /// <exception cref="ArgumentOutOfRangeException">
        /// <paramref name="bits"/> is less than or equal to zero or
        /// <paramref name="bits"/> is zero and <paramref name="type"/> is <see cref="VectorComponentType.BitField"/>.
        /// </exception>
        public VectorComponent(VectorComponentType type, VectorComponentChannel channel, int?bits = null)
        {
            if (bits.HasValue)
            {
                if (bits.Value <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(bits));
                }

                Bits = bits.Value;
            }
            else
            {
                if (type == VectorComponentType.BitField ||
                    type == VectorComponentType.Undefined)
                {
                    throw new ArgumentException(
                              "The bit size could not be inferred from the given component type.");
                }

                Bits = type.SizeInBytes() * 8;
            }

            Type    = type;
            Channel = channel;
        }
 public bool HasComponentType(VectorComponentChannel componentType)
 {
     foreach (var component in Components.Span)
     {
         if (component.Channel == componentType)
         {
             return(true);
         }
     }
     return(false);
 }