#[non_exhaustive]pub struct Config { /* private fields */ }unstable only.Expand description
Configuration for a PPA SRM operation.
Scaling uses the source axes and bilinear interpolation. Factors must be at least 1/16
and less than 256, and are truncated to multiples of 1/16.
Rotation follows scaling. Mirroring uses the rotated image’s axes.
Each transformed dimension must be no greater than 0x1fff.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Implementations§
Source§impl Config
impl Config
Sourcepub fn with_rotation(self, rotation: Rotation) -> Self
pub fn with_rotation(self, rotation: Rotation) -> Self
Assign the given value to the rotation field.
Sourcepub fn with_scale_x(self, scale_x: f32) -> Self
pub fn with_scale_x(self, scale_x: f32) -> Self
Assign the given value to the scale_x field.
Sourcepub fn scale_x(&self) -> f32
pub fn scale_x(&self) -> f32
Horizontal scaling factor. See Config for the range and precision.
Sourcepub fn with_scale_y(self, scale_y: f32) -> Self
pub fn with_scale_y(self, scale_y: f32) -> Self
Assign the given value to the scale_y field.
Sourcepub fn with_mirror_x(self, mirror_x: bool) -> Self
pub fn with_mirror_x(self, mirror_x: bool) -> Self
Assign the given value to the mirror_x field.
Sourcepub fn with_mirror_y(self, mirror_y: bool) -> Self
pub fn with_mirror_y(self, mirror_y: bool) -> Self
Assign the given value to the mirror_y field.
Source§impl Config
impl Config
Sourcepub fn output_size(&self, size: Size) -> Result<Size, Error>
pub fn output_size(&self, size: Size) -> Result<Size, Error>
Returns the transformed image dimensions.
Scaled dimensions are rounded down to whole pixels and exchanged for 90-degree and 270-degree rotations.
§Errors
Error::InvalidScalewhen a scaling factor is invalid.Error::InvalidSizewhen the source or transformed dimensions are invalid.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Trait Implementations§
impl Copy for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Forget for Config
impl Freeze for Config
impl Move for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)