mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 12:22:34 +00:00
use rbg for pixel data in bitmatrix convert
This commit is contained in:
@@ -677,10 +677,13 @@ impl From<&BitMatrix> for image::DynamicImage {
|
||||
|
||||
for y in 0..value.height {
|
||||
for x in 0..value.width {
|
||||
let pixel_value = if value.get(x, y) { u8::MIN } else { u8::MAX };
|
||||
let pixel_intrior = [pixel_value, pixel_value, pixel_value];
|
||||
let pixel = image::Rgb(pixel_intrior);
|
||||
pixels.put_pixel(
|
||||
x,
|
||||
y,
|
||||
image::Luma([if value.get(x, y) { u8::MIN } else { u8::MAX }]),
|
||||
pixel,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user