|
|
@ -263,14 +263,6 @@ impl NcVisual {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Inflates each pixel in the image to 'scale'x'scale' pixels.
|
|
|
|
|
|
|
|
///
|
|
|
|
|
|
|
|
/// The original color is retained.
|
|
|
|
|
|
|
|
pub fn inflate(&mut self, scale: u32) -> NcResult<NcIntResult> {
|
|
|
|
|
|
|
|
let res = unsafe { crate::ncvisual_inflate(self, scale as i32) };
|
|
|
|
|
|
|
|
error![res, &format!["NcVisual.inflate({})", scale], res]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// Gets the size and ratio of NcVisual pixels to output cells along the
|
|
|
|
/// Gets the size and ratio of NcVisual pixels to output cells along the
|
|
|
|
/// `y→to_y` and `x→to_x` axes.
|
|
|
|
/// `y→to_y` and `x→to_x` axes.
|
|
|
|
///
|
|
|
|
///
|
|
|
@ -352,18 +344,35 @@ impl NcVisual {
|
|
|
|
]
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Resizes the visual to `rows` X `columns` pixels.
|
|
|
|
/// Resizes the visual to `cols` X `rows` pixels.
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// This is a lossy transformation, unless the size is unchanged.
|
|
|
|
/// This is a lossy transformation, unless the size is unchanged.
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// *C style function: [ncvisual_resize()][crate::ncvisual_resize].*
|
|
|
|
/// *C style function: [ncvisual_resize()][crate::ncvisual_resize].*
|
|
|
|
pub fn resize(&mut self, rows: NcDim, cols: NcDim) -> NcResult<()> {
|
|
|
|
pub fn resize(&mut self, cols: NcDim, rows: NcDim) -> NcResult<()> {
|
|
|
|
error![
|
|
|
|
error![
|
|
|
|
unsafe { crate::ncvisual_resize(self, rows as i32, cols as i32) },
|
|
|
|
unsafe { crate::ncvisual_resize(self, rows as i32, cols as i32) },
|
|
|
|
&format!["NcVisual.resize({}, {})", rows, cols]
|
|
|
|
&format!["NcVisual.resize({}, {})", rows, cols]
|
|
|
|
]
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// Resizes the visual to in the image to `rows` X `cols` pixels, without
|
|
|
|
|
|
|
|
/// interpolating the color values.
|
|
|
|
|
|
|
|
///
|
|
|
|
|
|
|
|
/// The original color is retained.
|
|
|
|
|
|
|
|
///
|
|
|
|
|
|
|
|
/// *C style function:
|
|
|
|
|
|
|
|
/// [ncvisual_resize_noninterpolative()][crate::ncvisual_resize_noninterpolative].*
|
|
|
|
|
|
|
|
pub fn resize_noninterpolative(&mut self, cols: NcDim, rows: NcDim) -> NcResult<NcIntResult> {
|
|
|
|
|
|
|
|
let res =
|
|
|
|
|
|
|
|
unsafe { crate::ncvisual_resize_noninterpolative(self, rows as i32, cols as i32) };
|
|
|
|
|
|
|
|
error![
|
|
|
|
|
|
|
|
res,
|
|
|
|
|
|
|
|
&format!["NcVisual.resize_noninterpolative({}, {})", cols, rows],
|
|
|
|
|
|
|
|
res
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Rotates the visual `rads` radians.
|
|
|
|
/// Rotates the visual `rads` radians.
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// Only M_PI/2 and -M_PI/2 are supported at the moment,
|
|
|
|
/// Only M_PI/2 and -M_PI/2 are supported at the moment,
|
|
|
|