mirror of
https://github.com/bend-n/fimg.git
synced 2024-12-22 10:28:21 -06:00
fix doc problems
This commit is contained in:
parent
36355a5c83
commit
d270f656de
|
@ -33,6 +33,7 @@ pub use overlay::{Overlay, OverlayAt};
|
|||
/// like assert!(), but causes undefined behaviour at runtime when the condition is not met.
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// UB if condition is false.
|
||||
macro_rules! assert_unchecked {
|
||||
($cond:expr) => {{
|
||||
|
|
|
@ -28,8 +28,8 @@ pub trait Overlay<W> {
|
|||
/// See [blit](https://en.wikipedia.org/wiki/Bit_blit)
|
||||
///
|
||||
/// # Safety
|
||||
/// UB if rgb.len() % 3 != 0
|
||||
/// UB if rgba.len() % 4 != 0
|
||||
/// - UB if rgb.len() % 3 != 0
|
||||
/// - UB if rgba.len() % 4 != 0
|
||||
unsafe fn blit(rgb: &mut [u8], rgba: &[u8]) {
|
||||
let mut srci = 0;
|
||||
let mut dsti = 0;
|
||||
|
@ -180,9 +180,9 @@ impl OverlayAt<Image<&[u8], 4>> for Image<&mut [u8], 4> {
|
|||
/// Overlay with => self at coordinates x, y, without blending
|
||||
///
|
||||
/// # Safety
|
||||
/// UB if x, y is out of bounds
|
||||
/// UB if x + with.width() > u32::MAX
|
||||
/// UB if y + with.height() > u32::MAX
|
||||
/// - UB if x, y is out of bounds
|
||||
/// - UB if x + with.width() > [`u32::MAX`]
|
||||
/// - UB if y + with.height() > [`u32::MAX`]
|
||||
unsafe fn overlay_at(&mut self, with: &Image<&[u8], 4>, x: u32, y: u32) -> &mut Self {
|
||||
for j in 0..with.height() {
|
||||
for i in 0..with.width() {
|
||||
|
|
Loading…
Reference in a new issue