Example #1
0
        public IEnumerable <Color> Load(byte[] input, IList <Color> palette, int taskCount)
        {
            var br = new BinaryReaderX(new MemoryStream(input), _byteOrder);

            return(ReadValues(br).AsParallel().AsOrdered()
                   .WithDegreeOfParallelism(taskCount)
                   .Select(c => _descriptor.GetColor(c, palette)));
        }
Example #2
0
        /// <inheritdoc cref="Load"/>
        public IEnumerable <Color> Load(byte[] input, IList <Color> palette, EncodingLoadContext loadContext)
        {
            var br = new BinaryReaderX(new MemoryStream(input), _byteOrder, _bitOrder, 1);

            return(ReadValues(br).AsParallel().AsOrdered()
                   .WithDegreeOfParallelism(loadContext.TaskCount)
                   .Select(i => _descriptor.GetColor(i, palette)));
        }