Commit 5ebc6e3b authored by Romain Vimont's avatar Romain Vimont Committed by Thomas Daede

Expose whole frame as a tile

Add convenience methods to access a whole frame as a tile.
parent 52b65ad7
......@@ -23,6 +23,7 @@ use crate::rate::FRAME_SUBTYPE_I;
use crate::rate::FRAME_SUBTYPE_P;
use crate::rdo::*;
use crate::segmentation::*;
use crate::tiling::*;
use crate::transform::*;
use crate::util::*;
use crate::partition::PartitionType::*;
......@@ -90,6 +91,18 @@ impl<T: Pixel> Frame<T> {
}
}
#[inline(always)]
pub fn as_tile(&self) -> Tile<'_, T> {
let PlaneConfig { width, height, .. } = self.planes[0].cfg;
Tile::new(self, TileRect { x: 0, y: 0, width, height })
}
#[inline(always)]
pub fn as_tile_mut(&mut self) -> TileMut<'_, T> {
let PlaneConfig { width, height, .. } = self.planes[0].cfg;
TileMut::new(self, TileRect { x: 0, y: 0, width, height })
}
/// Returns a `PixelIter` containing the data of this frame's planes in YUV format.
/// Each point in the `PixelIter` is a triple consisting of a Y, U, and V component.
/// The `PixelIter` is laid out as contiguous rows, e.g. to get a given 0-indexed row
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment