Ejemplo n.º 1
0
        public VideoFormatInfo(
            PixelFormat pixelFormat,
            int width,
            int height,
            TimeBase timeBase,
            Rational aspectRatio)
        {
            if (pixelFormat == default)
            {
                throw new ArgumentException("Required", nameof(pixelFormat));
            }

            if (width <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(width), width, "Must be > 0");
            }

            if (height <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(height), height, "Must be > 0");
            }

            PixelFormat = pixelFormat;
            Width       = width;
            Height      = height;
            TimeBase    = timeBase;
            AspectRatio = aspectRatio;
        }
Ejemplo n.º 2
0
 public bool Equals(VideoFormatInfo other) =>
 PixelFormat == other.PixelFormat &&
 Width.Equals(other.Width) &&
 Height.Equals(other.Height) &&
 TimeBase.Equals(other.TimeBase) &&
 AspectRatio.Equals(other.AspectRatio);