Example #1
0
        /// <summary>
        /// Branch on separate images
        ///   -> thumbnail resize and rotate -> thumbnail producers as provided
        ///   -> local image resize and rotate -> add meta data producer
        /// </summary>
        /// <param name="inputProducer">
        /// Producer providing the input to add meta data producer.
        /// </param>
        /// <param name="thumbnailProducers">
        /// The thumbnail producers from which to request the image before
        /// falling back to the full image producer sequence.
        /// </param>
        /// <returns>Local transformations sequence.</returns>
        private IProducer <EncodedImage> NewLocalTransformationsSequence(
            IProducer <EncodedImage> inputProducer,
            IThumbnailProducer <EncodedImage>[] thumbnailProducers)
        {
            IProducer <EncodedImage> localImageProducer =
                ProducerFactory.NewAddImageTransformMetaDataProducer(inputProducer);

            if (!_downsampleEnabled)
            {
                localImageProducer = _producerFactory.NewResizeAndRotateProducer(localImageProducer);
            }

            ThrottlingProducer <EncodedImage> localImageThrottlingProducer =
                _producerFactory.NewThrottlingProducer(
                    _throttlingMaxSimultaneousRequests,
                    localImageProducer);

            return(ProducerFactory.NewBranchOnSeparateImagesProducer(
                       NewLocalThumbnailProducer(thumbnailProducers),
                       localImageThrottlingProducer));
        }