コード例 #1
0
		public CollectionImageTileBuilder(Collection collection, ImageRequest imageRequest, int maxLevel, int tilePixelDimension)
		{
			_collection = collection;
			_level = imageRequest.Level;

			_tilePixelDimension = tilePixelDimension;
			_imageDimensionCount = (1 << (maxLevel - imageRequest.Level));
			_levelBitCount = maxLevel - imageRequest.Level;

			int mortonRange;
			_mortonStart = MortonHelpers.LevelXYToMorton(imageRequest.Level, imageRequest.X, imageRequest.Y,
				maxLevel, out mortonRange);
		}
コード例 #2
0
		public void ServeImageTile(HttpContext context)
		{
			ImageRequest request = new ImageRequest(context.Request.Url);
			Collection collection = _collectionCache.Get(request.CollectionKey);
			if (collection == null)
			{
				ServeStaticFile(context, "image/jpeg");
				return;
			}

			CollectionImageTileBuilder builder = new CollectionImageTileBuilder(collection, request,
				DzcSerializer.DefaultMaxLevel, DzcSerializer.DefaultTileDimension);
			builder.Write(context.Response);
		}
コード例 #3
0
        public void ServeImageTile(HttpContext context)
        {
            ImageRequest request = new ImageRequest(context.Request.Url);

            Collection collection = m_collectionCache.Get(request.DzcName);
            if (null == collection)
            {
                //TODO: Draw this message onto an image tile so it can be seen in Pivot.

                context.Response.StatusCode = (int)HttpStatusCode.NotFound;
                context.Response.StatusDescription = "Pivot image not found. Cache may have expired.";
                return;
            }

            CollectionImageTileBuilder builder = new CollectionImageTileBuilder(collection, request,
                DzcSerializer.DefaultMaxLevel, DzcSerializer.DefaultTileDimension);
            builder.Write(context.Response);
        }