Skip to content

Commit

Permalink
Replace Clone in CFA with a derive
Browse files Browse the repository at this point in the history
Closes #15
  • Loading branch information
pedrocr committed Feb 21, 2019
1 parent a7b3b8c commit b134a6a
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions src/decoders/cfa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use std::fmt;
/// initialized and ready to be used in processing. The color_at() implementation is
/// designed to be fast so it can be called inside the inner loop of demosaic or other
/// color-aware algorithms that work on pre-demosaic data
#[derive(Clone)]
pub struct CFA {
/// CFA pattern as a String
pub name: String,
Expand Down Expand Up @@ -183,20 +184,3 @@ impl fmt::Debug for CFA {
write!(f, "CFA {{ {} }}", self.name)
}
}

impl Clone for CFA {
fn clone(&self) -> CFA {
let mut cpattern: [[usize;48];48] = [[0;48];48];
for row in 0..48 {
for col in 0..48 {
cpattern[row][col] = self.pattern[row][col];
}
}
CFA {
name: self.name.clone(),
pattern: cpattern,
width: self.width,
height: self.height,
}
}
}

0 comments on commit b134a6a

Please sign in to comment.