Skip to main content

SourceRectangled

Trait SourceRectangled 

Source
pub trait SourceRectangled {
    // Required methods
    fn src_rect(self, x: Scalar, y: Scalar, w: Scalar, h: Scalar) -> Self;
    fn src_rel(self, x: Scalar, y: Scalar) -> Self;
    fn src_flip_h(self) -> Self;
    fn src_flip_v(self) -> Self;
    fn src_flip_hv(self) -> Self;
}
Expand description

Should be implemented by contexts that have source rectangle information.

Required Methods§

Source

fn src_rect(self, x: Scalar, y: Scalar, w: Scalar, h: Scalar) -> Self

Adds a source rectangle.

Source

fn src_rel(self, x: Scalar, y: Scalar) -> Self

Moves to a relative source rectangle using the current source rectangle as tile.

Source

fn src_flip_h(self) -> Self

Flips the source rectangle horizontally.

Source

fn src_flip_v(self) -> Self

Flips the source rectangle vertically.

Source

fn src_flip_hv(self) -> Self

Flips the source rectangle horizontally and vertically.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§