Skip to content

Commit 2bf4430

Browse files
committed
Expose data as separate module
Here we have all the copy engine implementations and the trait. For now you are not expected to construct them by yourself directly, hence they go into a submodule where the type is documented but not immediately reachable.
1 parent d26edd9 commit 2bf4430

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

texel/src/image.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
//! advised, probably very common, and the only 'supported' use-case).
1111
mod atomic;
1212
mod cell;
13-
mod data;
1413
mod raw;
1514

15+
pub mod data;
16+
1617
use core::{fmt, ops};
1718

1819
pub(crate) use self::raw::RawImage;
@@ -26,7 +27,7 @@ use crate::{BufferReuseError, Texel, TexelBuffer};
2627
pub use crate::stride::{StridedBufferMut, StridedBufferRef};
2728
pub use atomic::{AtomicImage, AtomicImageRef};
2829
pub use cell::{CellImage, CellImageRef};
29-
pub use data::{DataCells, DataMut, DataRef};
30+
pub use data::{AsCopySource, AsCopyTarget, DataCells, DataMut, DataRef};
3031

3132
/// A container of allocated bytes, parameterized over the layout.
3233
///

texel/src/image/atomic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ impl<L: Layout> AtomicImage<L> {
149149
/// Copy all bytes to a newly allocated image.
150150
///
151151
/// Note this will allocate a buffer according to the capacity length of this reference, not
152-
/// merely the layout. When this is not the intention, consider calling [`Self::split_layout`]
153-
/// or [`Self::truncate_layout`] respectively.
152+
/// merely the layout. When this is not the intention, consider first adjusting the buffer by
153+
/// reference with [`Self::as_ref`].
154154
///
155155
/// # Examples
156156
///

texel/src/image/cell.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ impl<L: Layout> CellImage<L> {
139139
/// Copy all bytes to a newly allocated image.
140140
///
141141
/// Note this will allocate a buffer according to the capacity length of this reference, not
142-
/// merely the layout. When this is not the intention, consider calling [`Self::split_layout`]
143-
/// or [`Self::truncate_layout`] respectively.
142+
/// merely the layout. When this is not the intention, consider first adjusting the buffer by
143+
/// reference with [`Self::as_ref`].
144144
///
145145
/// # Examples
146146
///

0 commit comments

Comments
 (0)