private void GetMVLResults(MVL_ANALYSIS eTypeAnalysis, out int numPoints, out IntPtr pData)
        {
            unsafe
            {
                int    nVal = (int)eTypeAnalysis;
                IntPtr ptr  = (IntPtr)(&nVal);

                // Select analyzer ID
                this.MVL_SetProperty((int)MVL_PROPERTY.MVL_PROPERTY_RESULT_ANALIZER_ID, ptr, IntPtr.Zero, IntPtr.Zero);

                // Get number of bytes
                int    nNumBytes   = 0;
                IntPtr ptrNumBytes = (IntPtr)(&nNumBytes);
                this.MVL_GetProperty((int)MVL_PROPERTY.MVL_PROPERTY_RESULT_ANALIZER_NUM_BYTES, ptrNumBytes, IntPtr.Zero, IntPtr.Zero);

                // Get number of points
                int    nNumPoints   = 0;
                IntPtr ptrNumPoints = (IntPtr)(&nNumPoints);
                this.MVL_GetProperty((int)MVL_PROPERTY.MVL_PROPERTY_RESULT_ANALIZER_NUM_POINTS, ptrNumPoints, IntPtr.Zero, IntPtr.Zero);
                numPoints = nNumPoints;

                // Get results
                IntPtr ptrResults = Marshal.AllocHGlobal(nNumBytes);
                this.MVL_GetProperty((int)MVL_PROPERTY.MVL_PROPERTY_RESULT_ANALIZER_DATA, ptrResults, IntPtr.Zero, IntPtr.Zero);
                pData = ptrResults;
            }
        }
        public SelectEdgeDetection(Form1 form, ref string previousAnalysis)
        {
            InitializeComponent();

            _parentForm = form;

            if (previousAnalysis == null)
            {
                _radioSelected    = "Canny";
                _propertyAnalysis = MVL_ANALYSIS.MVL_CANNY_ANALYSIS;
            }
            else
            {
                if (String.Compare(previousAnalysis, "Canny") == 0)
                {
                    _radioSelected       = "Canny";
                    _propertyAnalysis    = MVL_ANALYSIS.MVL_CANNY_ANALYSIS;
                    radioButton1.Checked = true;
                }
                else if (String.Compare(previousAnalysis, "Gradiente") == 0)
                {
                    _radioSelected       = "Gradiente";
                    _propertyAnalysis    = MVL_ANALYSIS.MVL_GRADIENTE_ANALYSIS;
                    radioButton2.Checked = true;
                }
                else if (String.Compare(previousAnalysis, "Sift") == 0)
                {
                    _radioSelected       = "Sift";
                    _propertyAnalysis    = MVL_ANALYSIS.MVL_SIFT_ANALYSIS;
                    radioButton3.Checked = true;
                }
            }
        }
 private void radioButton3_CheckedChanged(object sender, EventArgs e)
 {
     _radioSelected = "Sift";
     if (_propertyAnalysis != MVL_ANALYSIS.MVL_SIFT_ANALYSIS)
     {
         _parentForm.SetMVLEdgeSelection(_propertyAnalysis, MVL_VALUE_TYPE.MVL_VALUE_DISABLED);
     }
     _propertyAnalysis = MVL_ANALYSIS.MVL_SIFT_ANALYSIS;
 }
 public bool SetMVLEdgeSelection(MVL_ANALYSIS nPropertyValue, MVL_VALUE_TYPE eValueType)
 {
     if (_IsLibraryCreated == true)
     {
         // Set property to library
         unsafe
         {
             MVL_VALUE_TYPE value      = eValueType;
             IntPtr         pAdddress  = (IntPtr)(&nPropertyValue);
             IntPtr         pValueType = (IntPtr)(&value);
             CheckMVLReturnValue(this.MVL_SetProperty((int)MVL_PROPERTY.MVL_SELECT_ANALYSIS, pAdddress, pValueType, IntPtr.Zero));
         }
     }
     return(true);
 }
        public bool SaveEdgeSelected(ref string edge, MVL_ANALYSIS nPropertyValue)
        {
            _edgeSelected = edge;
            this.Enabled  = true;

            if (_IsLibraryCreated == true)
            {
                // Set property to library
                unsafe
                {
                    MVL_VALUE_TYPE value      = MVL_VALUE_TYPE.MVL_VALUE_ENABLED;
                    IntPtr         pAdddress  = (IntPtr)(&nPropertyValue);
                    IntPtr         pValueType = (IntPtr)(&value);
                    CheckMVLReturnValue(this.MVL_SetProperty((int)MVL_PROPERTY.MVL_SELECT_ANALYSIS, pAdddress, pValueType, IntPtr.Zero));

                    // Save current analysis
                    _eCurrentAnalysis = nPropertyValue;
                }
            }
            return(true);
        }