Copies an area from the given image at location `(x,y )` with width `width` and height `height` into this image at position `(dstx, dsty)`.
(&mut self,
img: &T, x: usize, y: usize, width: usize, height: usize, // source
dstx: usize, dsty: usize)
| 248 | /// Copies an area from the given image at location `(x,y )` with width `width` |
| 249 | /// and height `height` into this image at position `(dstx, dsty)`. |
| 250 | fn copy_from<T: Image>(&mut self, |
| 251 | img: &T, x: usize, y: usize, width: usize, height: usize, // source |
| 252 | dstx: usize, dsty: usize) { // dst |
| 253 | |
| 254 | // TODO bounce checking, error handling, performance |
| 255 | for iy in (0..height) { |
| 256 | for ix in (0..width) { |
| 257 | self.set_pixel_from_rgb( |
| 258 | dstx + ix, dsty + iy, &img.pixel_as_rgb(x + ix, y + iy).unwrap() |
| 259 | ); |
| 260 | } |
| 261 | } |
| 262 | } |
| 263 | |
| 264 | /// Draws text on the image at position `(x, y)`. |
| 265 | fn draw_text(&mut self, txt: &str, x: usize, y: usize, font: &Font) { |
no test coverage detected