Example #1
0
        /// <summary>
        ///     Creates an instance of <see cref="Timing" /> structure.
        /// </summary>
        /// <param name="horizontalVisible">The horizontal visible pixels</param>
        /// <param name="verticalVisible">The vertical visible pixels</param>
        /// <param name="horizontalBorder">The horizontal border pixels</param>
        /// <param name="verticalBorder">The vertical border pixels</param>
        /// <param name="horizontalFrontPorch">The horizontal front porch pixels</param>
        /// <param name="verticalFrontPorch">The vertical front porch pixels</param>
        /// <param name="horizontalSyncWidth">The horizontal sync width pixels</param>
        /// <param name="verticalSyncWidth">The vertical sync width pixels</param>
        /// <param name="horizontalTotal">The horizontal total pixels</param>
        /// <param name="verticalTotal">The vertical total pixels</param>
        /// <param name="horizontalPolarity">The horizontal sync polarity</param>
        /// <param name="verticalPolarity">The vertical sync polarity</param>
        /// <param name="scanMode">The scan mode</param>
        /// <param name="extra">The extra timing information</param>
        public Timing(
            ushort horizontalVisible,
            ushort verticalVisible,
            ushort horizontalBorder,
            ushort verticalBorder,
            ushort horizontalFrontPorch,
            ushort verticalFrontPorch,
            ushort horizontalSyncWidth,
            ushort verticalSyncWidth,
            ushort horizontalTotal,
            ushort verticalTotal,
            TimingHorizontalSyncPolarity horizontalPolarity,
            TimingVerticalSyncPolarity verticalPolarity,
            TimingScanMode scanMode,
            TimingExtra extra
            )
        {
            this = typeof(Timing).Instantiate <Timing>();

            _HorizontalVisible      = horizontalVisible;
            _HorizontalBorder       = horizontalBorder;
            _HorizontalFrontPorch   = horizontalFrontPorch;
            _HorizontalSyncWidth    = horizontalSyncWidth;
            _HorizontalTotal        = horizontalTotal;
            _HorizontalSyncPolarity = horizontalPolarity;

            _VerticalVisible      = verticalVisible;
            _VerticalBorder       = verticalBorder;
            _VerticalFrontPorch   = verticalFrontPorch;
            _VerticalSyncWidth    = verticalSyncWidth;
            _VerticalTotal        = verticalTotal;
            _VerticalSyncPolarity = verticalPolarity;

            _ScanMode             = scanMode;
            _PixelClockIn10KHertz =
                (uint)(horizontalTotal * verticalTotal * (extra.FrequencyInMillihertz / 1000d) / 10000);

            _Extra = extra;
        }