software/scaling: add helpers to frame::Video
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
use util::format;
|
use util::format;
|
||||||
use ::{Picture, decoder, Error};
|
use ::{Picture, decoder, Error, frame};
|
||||||
use super::{Context, Flags, flag};
|
use super::{Context, Flags, flag};
|
||||||
|
|
||||||
impl<'a> Picture<'a> {
|
impl<'a> Picture<'a> {
|
||||||
@ -16,6 +16,21 @@ impl<'a> Picture<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl frame::Video {
|
||||||
|
pub fn scaler(&self, width: u32, height: u32, flags: Flags) -> Result<Context, Error> {
|
||||||
|
Context::get(self.format(), self.width(), self.height(),
|
||||||
|
self.format(), width, height,
|
||||||
|
flags)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn converter(&self, format: format::Pixel) -> Result<Context, Error> {
|
||||||
|
Context::get(self.format(), self.width(), self.height(),
|
||||||
|
format, self.width(), self.height(),
|
||||||
|
flag::FAST_BILINEAR)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
impl decoder::Video {
|
impl decoder::Video {
|
||||||
pub fn scaler(&self, width: u32, height: u32, flags: Flags) -> Result<Context, Error> {
|
pub fn scaler(&self, width: u32, height: u32, flags: Flags) -> Result<Context, Error> {
|
||||||
Context::get(self.format(), self.width(), self.height(),
|
Context::get(self.format(), self.width(), self.height(),
|
||||||
|
Reference in New Issue
Block a user