Beispiel #1
0
        protected override IBitmap <short> LoadMapGranulate(int lat, int lon)
        {
            string bitmapPath = LocateMapGranulate(lat, lon);

            if (bitmapPath == null)
            {
                return(_oceanBitmap);
            }

            var rawReader = new RawReader(File.OpenRead(bitmapPath));
            var bitmap    = rawReader.ReadBitmap <short>(BitmapWidth, BitmapHeight);

            bitmap = bitmap.Convert((p) =>
            {
                return((short)(((p >> 8) & 0xff) | ((p << 8) & 0xff00)));
            });

            _rawReaders.Add(rawReader);

            return(bitmap);
        }
Beispiel #2
0
        protected override IBitmap <short> LoadMapGranulate(int lat, int lon)
        {
            string bitmapPath  = string.Format(InputPath, MapGranulateName(lat, lon));
            var    bitmapEntry = _zipArchive.GetEntry(bitmapPath);

            if (bitmapEntry == null)
            {
                return(_oceanBitmap);
            }

            Console.WriteLine($"Found: {bitmapPath}");

            var rawReader = new RawReader(new BufferedStream(bitmapEntry.Open(), 1024 * 1024));
            var bitmap    = rawReader.ReadBitmap <short>(BitmapWidth, BitmapHeight);

            bitmap = bitmap.Convert((p) =>
            {
                return((short)(((p >> 8) & 0xff) | ((p << 8) & 0xff00)));
            });

            _rawReaders.Add(rawReader);

            return(bitmap);
        }