1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! Utilities for graphics.
/// Copies the content of `src` into `target` but skipping transparent pixels.
///
/// Assumes 1 pixel is 4 bits, so useful for copying into 4-bit dynamic tiles
/// like in [`DynamicTile16`](crate::display::tiled::DynamicTile16) or
/// [`DynamicSprite16`](crate::display::object::DynamicSprite16).
///
/// Normally you shouldn't need to use this method, as you should be using
/// [`Object`s](crate::display::object::Object) or backgrounds. Only use this
/// if you specifically need dynamic sprites or tiles.
///
/// # Examples
///
/// ```
/// # #![no_main]
/// # #![no_std]
/// # #[agb::doctest]
/// # fn test(_: agb::Gba) {
/// use agb::display::utils::blit_16_colour;
///
/// let a = &mut [0x89abcdef];
/// let b = &[0x01030507];
///
/// blit_16_colour(a, b);
/// assert_eq!(a[0], 0x81a3c5e7);
/// # }
/// ```