Пример #1
0
        public void Evaluate(int SpreadMax)
        {
            if (FFirstRun)
            {
                FPinOutOutput[0] = new CVImageLink();
                FFirstRun        = false;
            }

            if (FPinInInput.IsChanged)
            {
                FScanSet = FPinInInput[0];
                if (FScanSet != null)
                {
                    FScanSet.UpdateAttributes += new EventHandler(FScanSet_UpdateAttributes);
                    FScanSet.UpdateData       += new EventHandler(FScanSet_UpdateData);

                    FAttributesUpdated = FScanSet.Initialised;
                    FDataUpdated       = FScanSet.DataAvailable;
                }
            }

            if (FAttributesUpdated)
            {
                FOutput.Initialise(FScanSet.CameraSize, TColourFormat.L8);
                FDataUpdated = FScanSet.DataAvailable;
                FAllocated   = true;

                FAttributesUpdated = false;
            }

            if (FDataUpdated || FPinInThreshold.IsChanged)
            {
                if (FAllocated)
                {
                    UpdateData();
                    FPinOutOutput[0].Send(FOutput);
                }

                FDataUpdated = false;
            }
        }
		public void Evaluate(int SpreadMax)
		{
			if (FFirstRun)
			{
				FPinOutOutput[0] = new CVImageLink();
				FFirstRun = false;
			}

			if (FPinInInput.IsChanged)
			{
				FScanSet = FPinInInput[0];
				if (FScanSet != null)
				{
					FScanSet.UpdateAttributes += new EventHandler(FScanSet_UpdateAttributes);
					FScanSet.UpdateData += new EventHandler(FScanSet_UpdateData);

					FAttributesUpdated = FScanSet.Initialised;
					FDataUpdated = FScanSet.DataAvailable;
				}
			}

			if (FAttributesUpdated)
			{
				FOutput.Initialise(FScanSet.CameraSize, TColourFormat.L8);
				FDataUpdated = FScanSet.DataAvailable;
				FAllocated = true;

				FAttributesUpdated = false;
			}

			if (FDataUpdated || FPinInThreshold.IsChanged)
			{
				if (FAllocated)
				{
					UpdateData();
					FPinOutOutput[0].Send(FOutput);
				}

				FDataUpdated = false;
			}
		}