Пример #1
0
        public IFuturePrototype GetImagePrototype(ImageParameterTypeIfc parameterType, FutureFeatures features)
        {
            if (parameterType == null)
            {
                parameterType = new ImageParameterFromTileAddress(GetDefaultCoordinateSystem());
            }

            FutureFeatures   openDocFeatures = FutureFeatures.Cached;
            IFuturePrototype accessPrototype = GetAccessPrototype(AccessMethod.Render,
                                                                  openDocFeatures,
                                                                  new IFuturePrototype[]
            {
                new UnevaluatedTerm(TermName.ImageBounds), new UnevaluatedTerm(TermName.OutputSize),
                new UnevaluatedTerm(TermName.UseDocumentTransparency), new UnevaluatedTerm(TermName.ExactColors)
            });
            Verb             verb            = new SourceImageDownsamplerVerb(AddCaching(accessPrototype, FutureFeatures.Cached));
            IFuturePrototype futurePrototype = new ApplyPrototype(verb,
                                                                  new[]
            {
                parameterType.GetBoundsParameter(), parameterType.GetSizeParameter(),
                new ConstantFuture(
                    new BoolParameter(sourceMap.transparencyOptions.useDocumentTransparency)),
                new ConstantFuture(new BoolParameter(HasFeature(features, FutureFeatures.ExactColors)))
            });

            if (HasFeature(features, FutureFeatures.Transparency))
            {
                IFuturePrototype futurePrototype2 = new ApplyPrototype(verb,
                                                                       new[]
                {
                    parameterType.GetBoundsParameter(), parameterType.GetSizeParameter(),
                    new ConstantFuture(
                        new BoolParameter(sourceMap.transparencyOptions.useDocumentTransparency)),
                    new ConstantFuture(new BoolParameter(true))
                });
                if (HasFeature(features, FutureFeatures.MemoryCached))
                {
                    futurePrototype  = AddCaching(futurePrototype, FutureFeatures.MemoryCached);
                    futurePrototype2 = AddCaching(futurePrototype2, FutureFeatures.MemoryCached);
                }

                futurePrototype = new TransparencyPrototype(sourceMap.transparencyOptions,
                                                            futurePrototype,
                                                            futurePrototype2);
            }

            futurePrototype = AddCaching(futurePrototype, features);
            return(AddAsynchrony(futurePrototype, features));
        }
		public IFuturePrototype GetImagePrototype(ImageParameterTypeIfc parameterType, FutureFeatures features)
		{
			if (parameterType == null)
			{
				parameterType = new ImageParameterFromTileAddress(this.GetDefaultCoordinateSystem());
			}
			FutureFeatures openDocFeatures = FutureFeatures.Cached;
			IFuturePrototype accessPrototype = this.GetAccessPrototype(AccessMethod.Render, openDocFeatures, new IFuturePrototype[]
			{
				new UnevaluatedTerm(TermName.ImageBounds),
				new UnevaluatedTerm(TermName.OutputSize),
				new UnevaluatedTerm(TermName.UseDocumentTransparency),
				new UnevaluatedTerm(TermName.ExactColors)
			});
			Verb verb = new SourceImageDownsamplerVerb(this.AddCaching(accessPrototype, FutureFeatures.Cached));
			IFuturePrototype futurePrototype = new ApplyPrototype(verb, new IFuturePrototype[]
			{
				parameterType.GetBoundsParameter(),
				parameterType.GetSizeParameter(),
				new ConstantFuture(new BoolParameter(this.sourceMap.transparencyOptions.useDocumentTransparency)),
				new ConstantFuture(new BoolParameter(UnwarpedMapTileSource.HasFeature(features, FutureFeatures.ExactColors)))
			});
			if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.Transparency))
			{
				IFuturePrototype futurePrototype2 = new ApplyPrototype(verb, new IFuturePrototype[]
				{
					parameterType.GetBoundsParameter(),
					parameterType.GetSizeParameter(),
					new ConstantFuture(new BoolParameter(this.sourceMap.transparencyOptions.useDocumentTransparency)),
					new ConstantFuture(new BoolParameter(true))
				});
				if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.MemoryCached))
				{
					futurePrototype = this.AddCaching(futurePrototype, FutureFeatures.MemoryCached);
					futurePrototype2 = this.AddCaching(futurePrototype2, FutureFeatures.MemoryCached);
				}
				futurePrototype = new TransparencyPrototype(this.sourceMap.transparencyOptions, futurePrototype, futurePrototype2);
			}
			futurePrototype = this.AddCaching(futurePrototype, features);
			return this.AddAsynchrony(futurePrototype, features);
		}