/rust/registry/src/index.crates.io-1949cf8c6b5b557f/rav1e-0.7.1/src/frame/plane.rs
Line | Count | Source |
1 | | // Copyright (c) 2017-2022, The rav1e contributors. All rights reserved |
2 | | // |
3 | | // This source code is subject to the terms of the BSD 2 Clause License and |
4 | | // the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License |
5 | | // was not distributed with this source code in the LICENSE file, you can |
6 | | // obtain it at www.aomedia.org/license/software. If the Alliance for Open |
7 | | // Media Patent License 1.0 was not distributed with this source code in the |
8 | | // PATENTS file, you can obtain it at www.aomedia.org/license/patent. |
9 | | |
10 | | use crate::tiling::*; |
11 | | use crate::util::*; |
12 | | |
13 | | pub use v_frame::plane::*; |
14 | | |
15 | | pub trait AsRegion<T: Pixel> { |
16 | | fn as_region(&self) -> PlaneRegion<'_, T>; |
17 | | fn as_region_mut(&mut self) -> PlaneRegionMut<'_, T>; |
18 | | fn region_mut(&mut self, area: Area) -> PlaneRegionMut<'_, T>; |
19 | | fn region(&self, area: Area) -> PlaneRegion<'_, T>; |
20 | | } |
21 | | |
22 | | impl<T: Pixel> AsRegion<T> for Plane<T> { |
23 | | #[inline(always)] |
24 | 0 | fn region(&self, area: Area) -> PlaneRegion<'_, T> { |
25 | 0 | let rect = area.to_rect( |
26 | 0 | self.cfg.xdec, |
27 | 0 | self.cfg.ydec, |
28 | 0 | self.cfg.stride - self.cfg.xorigin, |
29 | 0 | self.cfg.alloc_height - self.cfg.yorigin, |
30 | | ); |
31 | 0 | PlaneRegion::new(self, rect) |
32 | 0 | } Unexecuted instantiation: <v_frame::plane::Plane<u16> as rav1e::frame::plane::AsRegion<u16>>::region Unexecuted instantiation: <v_frame::plane::Plane<u8> as rav1e::frame::plane::AsRegion<u8>>::region |
33 | | |
34 | | #[inline(always)] |
35 | 0 | fn region_mut(&mut self, area: Area) -> PlaneRegionMut<'_, T> { |
36 | 0 | let rect = area.to_rect( |
37 | 0 | self.cfg.xdec, |
38 | 0 | self.cfg.ydec, |
39 | 0 | self.cfg.stride - self.cfg.xorigin, |
40 | 0 | self.cfg.alloc_height - self.cfg.yorigin, |
41 | | ); |
42 | 0 | PlaneRegionMut::new(self, rect) |
43 | 0 | } Unexecuted instantiation: <v_frame::plane::Plane<u16> as rav1e::frame::plane::AsRegion<u16>>::region_mut Unexecuted instantiation: <v_frame::plane::Plane<u8> as rav1e::frame::plane::AsRegion<u8>>::region_mut |
44 | | |
45 | | #[inline(always)] |
46 | 0 | fn as_region(&self) -> PlaneRegion<'_, T> { |
47 | 0 | PlaneRegion::new_from_plane(self) |
48 | 0 | } Unexecuted instantiation: <v_frame::plane::Plane<u16> as rav1e::frame::plane::AsRegion<u16>>::as_region Unexecuted instantiation: <v_frame::plane::Plane<u8> as rav1e::frame::plane::AsRegion<u8>>::as_region |
49 | | |
50 | | #[inline(always)] |
51 | 0 | fn as_region_mut(&mut self) -> PlaneRegionMut<'_, T> { |
52 | 0 | PlaneRegionMut::new_from_plane(self) |
53 | 0 | } Unexecuted instantiation: <v_frame::plane::Plane<u16> as rav1e::frame::plane::AsRegion<u16>>::as_region_mut Unexecuted instantiation: <v_frame::plane::Plane<u8> as rav1e::frame::plane::AsRegion<u8>>::as_region_mut |
54 | | } |