Beispiel #1
0
        public static StarMap FromReflectedObject(object reflObj)
        {
            var starMap = new StarMap();

            //starMap.m_Stride = GetPropValue<int>(reflObj, "m_Stride");
            //starMap.m_BytesPerPixel = GetPropValue<int>(reflObj, "m_BytesPerPixel");
            //starMap.m_FullWidth = GetPropValue<int>(reflObj, "m_FullWidth");
            //starMap.m_FullHeight = GetPropValue<int>(reflObj, "m_FullHeight");
            //starMap.m_TotalBytesCount = GetPropValue<int>(reflObj, "m_TotalBytesCount");

            //starMap.m_PixelData = GetPropValue<byte[,]>(reflObj, "m_PixelData");
            //starMap.m_CheckedIndexes = GetPropValue<List<int>>(reflObj, "m_CheckedIndexes");

            //starMap.m_OSDFrameToExclude = GetPropValue<Rectangle>(reflObj, "m_OSDFrameToExclude");
            //starMap.m_IndexToFeatureIdMap = GetPropValue<Dictionary<int, int>>(reflObj, "m_IndexToFeatureIdMap");

            //starMap.m_FeatureId = GetPropValue<int>(reflObj, "m_FeatureId");
            //starMap.m_ThumbPrint = GetPropValue<long>(reflObj, "m_ThumbPrint");
            //starMap.m_AverageBackgroundNoise = GetPropValue<int>(reflObj, "m_AverageBackgroundNoise");
            //starMap.m_NoiseLevel = GetPropValue<int>(reflObj, "m_NoiseLevel");

            //starMap.m_Features = new List<StarMapFeature>();

            //object featureList = GetPropValue<object>(reflObj, "m_Features");
            //IList lst = featureList as IList;
            //foreach(object el in lst)
            //{
            //    starMap.m_Features.Add(StarMapFeature.FromReflectedObject(el));
            //}

            return(starMap);
        }
Beispiel #2
0
        internal void CopyMap(StarMap copyFrom)
        {
            m_FullWidth  = copyFrom.m_FullWidth;
            m_FullHeight = copyFrom.m_FullHeight;

            m_CheckedIndexes.Clear();
            m_CheckedIndexes.AddRange(copyFrom.m_CheckedIndexes);

            m_Features.Clear();
            foreach (StarMapFeature feature in copyFrom.m_Features)
            {
                m_Features.Add((StarMapFeature)feature.Clone());
            }

            m_OSDFrameToExclude = new Rectangle(copyFrom.m_OSDFrameToExclude.Left, copyFrom.m_OSDFrameToExclude.Top, copyFrom.m_OSDFrameToExclude.Width, copyFrom.m_OSDFrameToExclude.Height);
            m_FrameToInclude    = new Rectangle(copyFrom.m_FrameToInclude.Left, copyFrom.m_FrameToInclude.Top, copyFrom.m_FrameToInclude.Width, copyFrom.m_FrameToInclude.Height);
            m_LimitByInclusion  = copyFrom.m_LimitByInclusion;

            m_IndexToFeatureIdMap.Clear();
            foreach (int key in copyFrom.m_IndexToFeatureIdMap.Keys)
            {
                m_IndexToFeatureIdMap.Add(key, copyFrom.m_IndexToFeatureIdMap[key]);
            }

            m_FeatureId = copyFrom.m_FeatureId;
        }
Beispiel #3
0
        public static AstroPlate FromReflectedObject(object reflObj)
        {
            var rv = new AstroPlate();

            rv.m_ImageWidth          = StarMap.GetPropValue <int>(reflObj, "m_ImageWidth");
            rv.m_ImageHeight         = StarMap.GetPropValue <int>(reflObj, "m_ImageHeight");
            rv.m_MatrixToImageScaleX = StarMap.GetPropValue <double>(reflObj, "m_MatrixToImageScaleX");
            rv.m_MatrixToImageScaleY = StarMap.GetPropValue <double>(reflObj, "m_MatrixToImageScaleY");
            rv.EffectiveFocalLength  = StarMap.GetPropValue <double>(reflObj, "EffectiveFocalLength");
            rv.EffectivePixelWidth   = StarMap.GetPropValue <double>(reflObj, "EffectivePixelWidth");
            rv.EffectivePixelHeight  = StarMap.GetPropValue <double>(reflObj, "EffectivePixelHeight");

            object obj = StarMap.GetPropValue <object>(reflObj, "m_Matrix");

            rv.m_Matrix = CCDMatrix.FromReflectedObject(obj);

            try
            {
                rv.m_BitPix = StarMap.GetPropValue <int>(reflObj, "BitPix");
            }
            catch
            {
                rv.m_BitPix = 8;
            }

            return(rv);
        }
Beispiel #4
0
        public static CCDMatrix FromReflectedObject(object reflObj)
        {
            var rv = new CCDMatrix();

            rv.m_CellX  = StarMap.GetPropValue <double>(reflObj, "m_CellX");
            rv.m_CellY  = StarMap.GetPropValue <double>(reflObj, "m_CellY");
            rv.m_Width  = StarMap.GetPropValue <int>(reflObj, "m_Width");
            rv.m_Height = StarMap.GetPropValue <int>(reflObj, "m_Height");

            return(rv);
        }
Beispiel #5
0
        public static StarMapFeature FromReflectedObject(object refl)
        {
            int featureId = StarMap.GetPropValue <int>(refl, "FeatureId");
            int width     = StarMap.GetPropValue <int>(refl, "Width");

            StarMapFeature feature = new StarMapFeature(featureId, width);

            feature.m_MaxBrightness         = StarMap.GetPropValue <byte>(refl, "m_MaxBrightness");
            feature.m_MaxBrightnessFirstKey = StarMap.GetPropValue <ulong>(refl, "m_MaxBrightnessFirstKey");
            feature.m_MaxBrightnessPixels   = StarMap.GetPropValue <int>(refl, "m_MaxBrightnessPixels");
            feature.m_Generation            = StarMap.GetPropValue <int>(refl, "m_Generation");
            feature.m_Merges    = StarMap.GetPropValue <int>(refl, "m_Merges");
            feature.m_Intencity = StarMap.GetPropValue <uint>(refl, "m_Intencity");

            feature.m_Pixels = StarMap.GetPropValue <SortedDictionary <ulong, uint> >(refl, "m_Pixels");

            return(feature);
        }