Example #1
0
        /// <summary>
        /// Called every time left mouse button is pressed WHILE Ctrl key is down
        /// and the current module has positive 'HasPixelUpdate'.
        /// </summary>
        /// <param name="x">Recomputed image coordinate in pixels.</param>
        /// <param name="y">Recomputed image coordinate in pixels.</param>
        private void recomputePixel(
            int x,
            int y)
        {
            lock (runLock)
            {
                if (running != null)
                {
                    return;
                }

                if (currModule == null)
                {
                    // Nothing to compute => set outputImage to null.

                    setImage(ref outputImage, null);
                    checkBoxResult.Checked = false;
                    setSaveButton();

                    // Display input image.
                    displayImage();

                    return;
                }

                running = new RecomputeTask(this, currModule);
                setRecomputeGui();
                running.Start(inputImage, textBoxParam.Text, x, y);
            }
        }
Example #2
0
        /// <summary>
        /// Recompute initiated in the FormMain. Optional update of module's param from the textBox.
        /// </summary>
        /// <param name="setParam">If true, module's Param will be modified.</param>
        private void recompute(bool setParam)
        {
            if (running != null)
            {
                return;
            }

            IRasterModule module = currModule;

            if (module == null)
            {
                // Nothing to compute => set outputImage to null.

                setImage(ref outputImage, null);
                checkBoxResult.Checked = false;
                setSaveButton();

                // Display input image.
                displayImage();

                return;
            }

            running = new RecomputeTask(this, module);
            setRecomputeGui(true);
            running.Start(inputImage, setParam ? textBoxParam.Text : null);
        }