pub struct ViewOrigin {
pub parent_width: usize,
pub parent_height: usize,
pub parent_row_stride: usize,
pub x: usize,
pub y: usize,
}Expand description
The parent image a view/batch sub-region
was carved from, snapshotted at the time the view was created.
A view shares the parent’s BufferIdentity and addresses a sub-rectangle of
it. The GL backend keys its EGLImage import on the parent geometry (so all
sibling views of one buffer collapse to a single import) and renders each
view as a glViewport+glScissor ROI at (x, y, width, height) within that
parent — the view is render state, never a distinct import. parent_width/
parent_height are the parent’s logical pixel dimensions; x/y are this
view’s top-left origin within the parent (pixels). Nested views compose:
the snapshot always names the root parent, with offsets accumulated.
Fields§
§parent_width: usizeLogical width of the root parent image, in pixels.
parent_height: usizeLogical height of the root parent image, in pixels. For a batch(n) view
of an [N, H, W, C] tensor this is N * H (the tiles stack vertically in
the shared buffer).
parent_row_stride: usizeThe parent’s row stride in bytes. The GL backend keys its EGLImage
import/cache and pitch on this — NOT on the view’s own row_stride, which
a single-row view sets tight (for map-span safety). Using the parent
stride keeps the import pitch parent-consistent so single-row and
multi-row sibling views collapse onto the same parent import.
x: usizeThis view’s top-left x origin within the root parent, in pixels.
y: usizeThis view’s top-left y origin within the root parent, in pixels.
Trait Implementations§
Source§impl Clone for ViewOrigin
impl Clone for ViewOrigin
Source§fn clone(&self) -> ViewOrigin
fn clone(&self) -> ViewOrigin
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ViewOrigin
Source§impl Debug for ViewOrigin
impl Debug for ViewOrigin
impl Eq for ViewOrigin
Source§impl PartialEq for ViewOrigin
impl PartialEq for ViewOrigin
impl StructuralPartialEq for ViewOrigin
Auto Trait Implementations§
impl Freeze for ViewOrigin
impl RefUnwindSafe for ViewOrigin
impl Send for ViewOrigin
impl Sync for ViewOrigin
impl Unpin for ViewOrigin
impl UnsafeUnpin for ViewOrigin
impl UnwindSafe for ViewOrigin
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more