Ejemplo n.º 1
0
        /// <summary>
        /// Create a new tile and fill it with the default value for the layer
        /// </summary>
        /// <param name="tileCoord"></param>
        /// <returns></returns>
        protected override MapBuffer CreateTileImpl(CoordXZ tileCoord)
        {
            MapBuffer16 buffer = new MapBuffer16(map, samplesPerTile, metersPerSample);

            buffer.Fill(defaultRawValue);

            return(buffer);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Copies one buffer into an area of another.
        /// Source buffer must fit within bounds of dest buffer when placed at dest offset.
        /// Source and dest buffers must be of the same type (MapBuffer16).
        /// Source and dest buffers must have the same meters per sample.
        /// </summary>
        /// <param name="destX">X offset within dest to place src</param>
        /// <param name="destZ">Z offset within dest to place src</param>
        /// <param name="src">Source map</param>
        public override void Copy(int destX, int destZ, MapBuffer src)
        {
            Debug.Assert(src is MapBuffer16);
            Debug.Assert(src.MetersPerSample == metersPerSample);
            Debug.Assert((destX + src.NumSamples) <= numSamples);
            Debug.Assert((destZ + src.NumSamples) <= numSamples);

            MapBuffer16 src16 = src as MapBuffer16;

            for (int z = 0; z < src.NumSamples; z++)
            {
                int srcoff  = z * src.NumSamples;
                int destoff = ((destZ + z) * numSamples) + destX;
                for (int x = 0; x < src.NumSamples; x++)
                {
                    buffer[destoff] = src16.buffer[srcoff];
                    srcoff++;
                    destoff++;
                }
            }

            dirty = true;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Create a new tile and fill it with the default value for the layer
        /// </summary>
        /// <param name="tileCoord"></param>
        /// <returns></returns>
        protected override MapBuffer CreateTileImpl(CoordXZ tileCoord)
        {
            MapBuffer16 buffer = new MapBuffer16(map, samplesPerTile, metersPerSample);

            buffer.Fill(defaultRawValue);

            return buffer;
        }