mirror of
https://github.com/bend-n/fimg.git
synced 2024-12-22 18:38: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.
|
/// like assert!(), but causes undefined behaviour at runtime when the condition is not met.
|
||||||
///
|
///
|
||||||
/// # Safety
|
/// # Safety
|
||||||
|
///
|
||||||
/// UB if condition is false.
|
/// UB if condition is false.
|
||||||
macro_rules! assert_unchecked {
|
macro_rules! assert_unchecked {
|
||||||
($cond:expr) => {{
|
($cond:expr) => {{
|
||||||
|
|
|
@ -28,8 +28,8 @@ pub trait Overlay<W> {
|
||||||
/// See [blit](https://en.wikipedia.org/wiki/Bit_blit)
|
/// See [blit](https://en.wikipedia.org/wiki/Bit_blit)
|
||||||
///
|
///
|
||||||
/// # Safety
|
/// # Safety
|
||||||
/// UB if rgb.len() % 3 != 0
|
/// - UB if rgb.len() % 3 != 0
|
||||||
/// UB if rgba.len() % 4 != 0
|
/// - UB if rgba.len() % 4 != 0
|
||||||
unsafe fn blit(rgb: &mut [u8], rgba: &[u8]) {
|
unsafe fn blit(rgb: &mut [u8], rgba: &[u8]) {
|
||||||
let mut srci = 0;
|
let mut srci = 0;
|
||||||
let mut dsti = 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
|
/// Overlay with => self at coordinates x, y, without blending
|
||||||
///
|
///
|
||||||
/// # Safety
|
/// # Safety
|
||||||
/// UB if x, y is out of bounds
|
/// - UB if x, y is out of bounds
|
||||||
/// UB if x + with.width() > u32::MAX
|
/// - UB if x + with.width() > [`u32::MAX`]
|
||||||
/// UB if y + with.height() > 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 {
|
unsafe fn overlay_at(&mut self, with: &Image<&[u8], 4>, x: u32, y: u32) -> &mut Self {
|
||||||
for j in 0..with.height() {
|
for j in 0..with.height() {
|
||||||
for i in 0..with.width() {
|
for i in 0..with.width() {
|
||||||
|
|
Loading…
Reference in a new issue