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