set fmt and stride to private in ImageRgb

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-04-28 12:35:46 +08:00
parent e3b66af8af
commit fc50a3e49d
6 changed files with 27 additions and 11 deletions

View File

@@ -536,11 +536,11 @@ impl Image {
pub fn to(&self, rgb: &mut ImageRgb) {
rgb.w = self.width();
rgb.h = self.height();
let bytes_per_row = Self::get_bytes_per_row(rgb.w, rgb.fmt, rgb.stride);
let bytes_per_row = Self::get_bytes_per_row(rgb.w, rgb.fmt, rgb.stride());
rgb.raw.resize(rgb.h * bytes_per_row, 0);
let img = self.inner();
unsafe {
match rgb.fmt {
match rgb.fmt() {
ImageFormat::Raw => {
super::I420ToRAW(
img.planes[0],