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); }
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); }
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); }