| 24 | : pixels_(std::move(pixels)), run_lengths_(std::move(run_lengths)) {} |
| 25 | |
| 26 | void read(Color* buf, uint16_t size, uint32_t& run_length) override { |
| 27 | EXPECT_LE(idx_ + size, pixels_.size()); |
| 28 | memcpy(buf, pixels_.data() + idx_, size * sizeof(Color)); |
| 29 | idx_ += size; |
| 30 | if (read_count_ < run_lengths_.size()) { |
| 31 | run_length = run_lengths_[read_count_++]; |
| 32 | } else { |
| 33 | run_length = 0; |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | void skip(uint32_t count) override { |
| 38 | ++skip_calls_; |