pub struct SignedPixelRect { /* private fields */ }Expand description
A non-empty half-open rectangle whose origin may lie outside the source image.
Implementations§
Source§impl SignedPixelRect
impl SignedPixelRect
pub fn new( x: i64, y: i64, width: NonZeroU32, height: NonZeroU32, ) -> Result<Self>
Sourcepub fn from_outward_f64_bounds(
left: f64,
top: f64,
right: f64,
bottom: f64,
) -> Result<Self>
pub fn from_outward_f64_bounds( left: f64, top: f64, right: f64, bottom: f64, ) -> Result<Self>
Converts finite fractional bounds to the smallest containing pixel rect. Left/top round down and right/bottom round up, including below zero.
pub const fn x(self) -> i64
pub const fn y(self) -> i64
pub const fn width(self) -> u32
pub const fn height(self) -> u32
pub fn right_exclusive(self) -> Result<i64>
pub fn bottom_exclusive(self) -> Result<i64>
Trait Implementations§
Source§impl Clone for SignedPixelRect
impl Clone for SignedPixelRect
Source§fn clone(&self) -> SignedPixelRect
fn clone(&self) -> SignedPixelRect
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SignedPixelRect
Source§impl Debug for SignedPixelRect
impl Debug for SignedPixelRect
Source§impl<'de> Deserialize<'de> for SignedPixelRect
impl<'de> Deserialize<'de> for SignedPixelRect
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SignedPixelRect
Source§impl JsonSchema for SignedPixelRect
impl JsonSchema for SignedPixelRect
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for SignedPixelRect
impl PartialEq for SignedPixelRect
Source§impl Serialize for SignedPixelRect
impl Serialize for SignedPixelRect
impl StructuralPartialEq for SignedPixelRect
Auto Trait Implementations§
impl Freeze for SignedPixelRect
impl RefUnwindSafe for SignedPixelRect
impl Send for SignedPixelRect
impl Sync for SignedPixelRect
impl Unpin for SignedPixelRect
impl UnsafeUnpin for SignedPixelRect
impl UnwindSafe for SignedPixelRect
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