pub struct PartitionContext {
pub x: usize,
pub y: usize,
pub frame_width: usize,
pub frame_height: usize,
pub max_block_size: BlockSize,
pub min_block_size: BlockSize,
pub lambda: f32,
}Expand description
Partition context for decision making.
Fields§
§x: usizeBlock position (x in pixels).
y: usizeBlock position (y in pixels).
frame_width: usizeFrame width.
frame_height: usizeFrame height.
max_block_size: BlockSizeMaximum block size allowed.
min_block_size: BlockSizeMinimum block size allowed.
lambda: f32Lambda for RD.
Implementations§
Source§impl PartitionContext
impl PartitionContext
Sourcepub const fn new(frame_width: usize, frame_height: usize) -> Self
pub const fn new(frame_width: usize, frame_height: usize) -> Self
Creates a new partition context.
Sourcepub const fn with_size_range(self, min: BlockSize, max: BlockSize) -> Self
pub const fn with_size_range(self, min: BlockSize, max: BlockSize) -> Self
Sets the block size limits.
Sourcepub fn can_use_size(&self, size: BlockSize) -> bool
pub fn can_use_size(&self, size: BlockSize) -> bool
Checks if a block size fits within frame bounds.
Sourcepub const fn child_size(size: BlockSize) -> Option<BlockSize>
pub const fn child_size(size: BlockSize) -> Option<BlockSize>
Returns the child block size for quad split.
Trait Implementations§
Source§impl Clone for PartitionContext
impl Clone for PartitionContext
Source§fn clone(&self) -> PartitionContext
fn clone(&self) -> PartitionContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PartitionContext
impl Debug for PartitionContext
Source§impl Default for PartitionContext
impl Default for PartitionContext
Source§fn default() -> PartitionContext
fn default() -> PartitionContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PartitionContext
impl RefUnwindSafe for PartitionContext
impl Send for PartitionContext
impl Sync for PartitionContext
impl Unpin for PartitionContext
impl UnsafeUnpin for PartitionContext
impl UnwindSafe for PartitionContext
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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