1 use libc::c_int; 2 3 #[derive(Eq, PartialEq, Clone, Copy, Debug)] 4 pub enum MotionEstimation { 5 Zero, 6 Full, 7 Log, 8 Phods, 9 Epzs, 10 X1, 11 Hex, 12 Umh, 13 Iter, 14 Tesa, 15 } 16 17 impl From<c_int> for MotionEstimation { from(value: c_int) -> MotionEstimation18 fn from(value: c_int) -> MotionEstimation { 19 match value { 20 1 => MotionEstimation::Zero, 21 2 => MotionEstimation::Full, 22 3 => MotionEstimation::Log, 23 4 => MotionEstimation::Phods, 24 5 => MotionEstimation::Epzs, 25 6 => MotionEstimation::X1, 26 7 => MotionEstimation::Hex, 27 8 => MotionEstimation::Umh, 28 9 => MotionEstimation::Iter, 29 10 => MotionEstimation::Tesa, 30 31 _ => MotionEstimation::Zero, 32 } 33 } 34 } 35 36 impl From<MotionEstimation> for c_int { from(value: MotionEstimation) -> c_int37 fn from(value: MotionEstimation) -> c_int { 38 match value { 39 MotionEstimation::Zero => 1, 40 MotionEstimation::Full => 2, 41 MotionEstimation::Log => 3, 42 MotionEstimation::Phods => 4, 43 MotionEstimation::Epzs => 5, 44 MotionEstimation::X1 => 6, 45 MotionEstimation::Hex => 7, 46 MotionEstimation::Umh => 8, 47 MotionEstimation::Iter => 9, 48 MotionEstimation::Tesa => 10, 49 } 50 } 51 } 52