TODO test
(&self, x: usize, y: usize, width: usize, height: usize)
| 654 | |
| 655 | // TODO test |
| 656 | pub fn rectangle(&self, x: usize, y: usize, width: usize, height: usize) -> Vec<u8> { |
| 657 | |
| 658 | // TODO bounce checking |
| 659 | let mut v = Vec::new(); |
| 660 | for i in (y..y+height) { |
| 661 | for j in (x..x+width) { |
| 662 | v.push(self.pixel(j, i).unwrap().val); |
| 663 | } |
| 664 | } |
| 665 | v |
| 666 | } |
| 667 | |
| 668 | pub fn mask_iter<'q>(&'q self, i: &'q GrayImage) -> MaskIter { |
| 669 |