pub struct VipsInterpolateMethod { /* private fields */ }Expand description
Function pointer type for VipsInterpolateMethod
§Example
use vips::*;
fn main() -> Result<()> {
let _instance = VipsInstance::new("app_test", true)?;
let interpolate = VipsInterpolate::bilinear_static();
let method = interpolate.method();
let img = VipsImage::from_file("examples/images/kodim01.png")?;
let region = VipsRegion::new(&img);
let mut out = vec![0u8; 3]; // assuming 3 channels
method.call(&interpolate, ®ion, &mut out, 1.5, 1.5);
Ok(())
}Implementations§
Source§impl VipsInterpolateMethod
impl VipsInterpolateMethod
Sourcepub fn call(
&self,
interpolate: &VipsInterpolate,
in_: &VipsRegion,
out: &mut [u8],
x: f64,
y: f64,
)
pub fn call( &self, interpolate: &VipsInterpolate, in_: &VipsRegion, out: &mut [u8], x: f64, y: f64, )
Call the interpolation method
§Arguments
interpolate- The VipsInterpolate instancein_- The input VipsRegionout- The output buffer to write the interpolated pixelx- The x coordinate to interpolatey- The y coordinate to interpolate
§Example
use vips::*;
fn main() -> Result<()> {
let interpolate = VipsInterpolate::bilinear_static();
let _instance = VipsInstance::new("app_test", true)?;
let img = VipsImage::from_file("examples/images/kodim01.png")?;
let region = VipsRegion::new(&img);
let mut out = vec![0u8; 3]; // assuming 3 channels
let method = interpolate.method();
method.call(&interpolate, ®ion, &mut out, 1.5, 1.5);
Ok(())
}Auto Trait Implementations§
impl Freeze for VipsInterpolateMethod
impl RefUnwindSafe for VipsInterpolateMethod
impl Send for VipsInterpolateMethod
impl Sync for VipsInterpolateMethod
impl Unpin for VipsInterpolateMethod
impl UnwindSafe for VipsInterpolateMethod
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