mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-28 05:12:34 +00:00
update for shared state and improved performance
This commit is contained in:
@@ -248,7 +248,7 @@ impl PlanarYUVLuminanceSource {
|
||||
}
|
||||
|
||||
impl LuminanceSource for PlanarYUVLuminanceSource {
|
||||
fn getRow(&self, y: usize, row: &Vec<u8>) -> Vec<u8> {
|
||||
fn getRow(&self, y: usize) -> Vec<u8> {
|
||||
if y >= self.getHeight() {
|
||||
//throw new IllegalArgumentException("Requested row is outside the image: " + y);
|
||||
panic!("Requested row is outside the image: {}", y);
|
||||
@@ -257,11 +257,7 @@ impl LuminanceSource for PlanarYUVLuminanceSource {
|
||||
|
||||
let offset = (y + self.top) * self.data_width + self.left;
|
||||
|
||||
let mut row = if row.len() >= width {
|
||||
row.to_vec()
|
||||
} else {
|
||||
vec![0; width]
|
||||
};
|
||||
let mut row = vec![0; width];
|
||||
|
||||
row[..width].clone_from_slice(&self.yuv_data[offset..width + offset]);
|
||||
//System.arraycopy(yuvData, offset, row, 0, width);
|
||||
|
||||
Reference in New Issue
Block a user