예제 #1
0
 protected RowColBase(
     int RowNum, int ColNum, LocationFrame LocationFrame,
     RowColRelative RowColRelative, CharPoint ContentStart)
     : this(RowNum, ColNum, LocationFrame, new ScreenDim(24, 80),
            RowColRelative, ContentStart)
 {
 }
예제 #2
0
        /// <summary>
        /// create a new RowCol from component parts. Either a ZeroRowCol or OneRowCol,
        /// depending on LocationFrame.
        /// </summary>
        /// <param name="frame"></param>
        /// <param name="RowNum"></param>
        /// <param name="ColNum"></param>
        /// <param name="Height"></param>
        /// <param name="Width"></param>
        /// <returns></returns>
        public static IRowCol Factory(LocationFrame frame, int RowNum, int ColNum, int Height, int Width)
        {
            IRowCol rc = null;

            if (frame == LocationFrame.OneBased)
            {
                rc = new OneRowCol(RowNum, ColNum, new ScreenDim(Height, Width));
            }
            else
            {
                rc = new ZeroRowCol(RowNum, ColNum, new ScreenDim(Height, Width));
            }
            return(rc);
        }
예제 #3
0
        /// <summary>
        /// create a new RowCol from component parts. Either a ZeroRowCol or OneRowCol,
        /// depending on LocationFrame.
        /// </summary>
        /// <param name="frame"></param>
        /// <param name="RowNum"></param>
        /// <param name="ColNum"></param>
        /// <param name="Height"></param>
        /// <param name="Width"></param>
        /// <returns></returns>
        public static IScreenLoc Factory(LocationFrame frame, int RowNum, int ColNum)
        {
            IScreenLoc rc = null;

            if (frame == LocationFrame.OneBased)
            {
                rc = new OneScreenLoc(RowNum, ColNum);
            }
            else
            {
                rc = new ZeroScreenLoc(RowNum, ColNum);
            }
            return(rc);
        }
예제 #4
0
        protected RowColBase(
            int RowNum, int ColNum, LocationFrame LocationFrame, ScreenDim Dim,
            RowColRelative RowColRelative, CharPoint ContentStart)
        {
            this.RowNum         = RowNum;
            this.ColNum         = ColNum;
            this.Dim            = Dim;
            this.LocationFrame  = LocationFrame;
            this.RowColRelative = RowColRelative;
            this.ContentStart   = ContentStart;

            if (LocationFrame == LocationFrame.OneBased)
            {
                this.HorzBounds = new IntPair(1, this.Dim.Width);
                this.VertBounds = new IntPair(1, this.Dim.Height);
            }
            else
            {
                this.HorzBounds = new IntPair(0, this.Dim.Width - 1);
                this.VertBounds = new IntPair(0, this.Dim.Height - 1);
            }
        }
        /// <summary>
        /// Update the relocation database
        /// </summary>
        /// <param name="faceInfo">The input face tracking information.</param>
        /// <param name="worldToCameraTransform">The corresponding transform matrix.</param>
        public void UpdateRelocation(FaceTrackInfo faceInfo, Matrix4 worldToCameraTransform)
        {
            processedFrames++;

            if (!faceInfo.TrackValid)
            {
                return;
            }

            // We save a frame in every SavingFrameInterval frames
            if (processedFrames >= SavingFrameInterval)
            {
                // Update the frame index
                savedFrameIndex = ++savedFrameIndex % SavedFrameCount;

                // Write input data to database
                locationFrames[savedFrameIndex] = new LocationFrame {
                    FaceInfo = faceInfo, WorldToCameraTransform = worldToCameraTransform
                };

                processedFrames = 0;
            }
        }
예제 #6
0
        protected RowColBase(
            LocationFrame LocationFrame, ScreenDim Dim, RowColRelative RowNumRelative)
        {
            this.RowNum = RowNum;
            this.ColNum = ColNum;
            int width  = Dim.Width;
            int height = Dim.Height;

            this.RowColRelative = RowNumRelative;
            if (LocationFrame == LocationFrame.OneBased)
            {
                this.HorzBounds = new IntPair(1, width);
                this.VertBounds = new IntPair(1, height);
            }
            else
            {
                this.HorzBounds = new IntPair(0, width - 1);
                this.VertBounds = new IntPair(0, height - 1);
            }

            // init row and col to values that are out of bounds.
            this.RowNum = this.VertBounds.a - 1;
            this.ColNum = this.HorzBounds.a - 1;
        }
예제 #7
0
 public ScreenLocBase(LocationFrame LocationFrame, int RowNum, int ColNum)
 {
     this.LocationFrame = LocationFrame;
     this.ColNum        = ColNum;
     this.RowNum        = RowNum;
 }