rgba
This commit is contained in:
@ -10,6 +10,7 @@ fn generate_png(n: u32, m: u32, width: u32, height: u32) {
|
|||||||
let mut img: RgbaImage = ImageBuffer::new(width, height);
|
let mut img: RgbaImage = ImageBuffer::new(width, height);
|
||||||
|
|
||||||
for (x, y, pixel) in img.enumerate_pixels_mut() {
|
for (x, y, pixel) in img.enumerate_pixels_mut() {
|
||||||
|
// Centrage
|
||||||
let xf = (x as f64 / width as f64) * 2.0 - 1.0;
|
let xf = (x as f64 / width as f64) * 2.0 - 1.0;
|
||||||
let yf = (y as f64 / height as f64) * 2.0 - 1.0;
|
let yf = (y as f64 / height as f64) * 2.0 - 1.0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user