pub struct VipsInterpolate {
pub c: *mut VipsInterpolate,
/* private fields */
}Expand description
VipsInterpolate struct wrapping libvips VipsInterpolate
§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(())
}Fields§
§c: *mut VipsInterpolateImplementations§
Source§impl VipsInterpolate
impl VipsInterpolate
Sourcepub fn new(nickname: &str) -> Result<VipsInterpolate>
pub fn new(nickname: &str) -> Result<VipsInterpolate>
Create a new VipsInterpolate by nickname
§Arguments
nickname- The nickname of the interpolation method
§Errors
Returns an error if the nickname is invalid
§Example
use vips::*;
fn main() -> Result<()> {
let _instance = VipsInstance::new("app_test", true)?;
let interpolate = VipsInterpolate::new("bilinear")?;
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(())
}Sourcepub fn nearest_static() -> VipsInterpolate
pub fn nearest_static() -> VipsInterpolate
Create a new nearest static VipsInterpolate
§Returns
A VipsInterpolate instance for nearest neighbor interpolation
§Example
use vips::*;
fn main() -> Result<()> {
let _instance = VipsInstance::new("app_test", true)?;
let interpolate = VipsInterpolate::nearest_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(())
}Sourcepub fn bilinear_static() -> VipsInterpolate
pub fn bilinear_static() -> VipsInterpolate
Create a new bilinear static VipsInterpolate
§Returns
A VipsInterpolate instance for bilinear interpolation
§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(())
}Sourcepub fn method(&self) -> VipsInterpolateMethod
pub fn method(&self) -> VipsInterpolateMethod
Get the interpolation method
§Returns
A VipsInterpolateMethod instance representing the interpolation method
§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(())
}Sourcepub fn window_size(&self) -> i32
pub fn window_size(&self) -> i32
Sourcepub fn window_offset(&self) -> i32
pub fn window_offset(&self) -> i32
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VipsInterpolate
impl RefUnwindSafe for VipsInterpolate
impl !Send for VipsInterpolate
impl !Sync for VipsInterpolate
impl Unpin for VipsInterpolate
impl UnwindSafe for VipsInterpolate
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