//! Decoder support functions and definitions.
use std::fmt;
-use std::ops::{Add, AddAssign, Sub, SubAssign};
+use std::ops::{Add, AddAssign, Sub, SubAssign, Neg};
pub use nihav_core::frame::*;
use std::mem;
fn sub_assign(&mut self, other: MV) { self.x -= other.x; self.y -= other.y; }
}
+impl Neg for MV {
+ type Output = MV;
+ fn neg(self) -> Self::Output {
+ MV { x: -self.x, y: -self.y }
+ }
+}
+
impl fmt::Display for MV {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{},{}", self.x, self.y)