New node: Rasterize (#1755)

* Add RasterizeVector node

* Add document node definition for RasterizeVectorNode

* Add dummy node properties

* Add prototype of footprint widget

* Fix types

* Fix footprint widget to use document space

* Fix aspect ratio issues by making resolution a multiplier

* Fix rebase errors

* Fix rasterization bounds and node definition

* UI and bug fixes but still issues with scaling in the frame

* Rename node to Raster

* Fix RasterizeNode

* Reenable resolution multiplier

* Remove unused variable

* UI fixes

* Fix Footprint default and resolution updates

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Dennis Kobert
2024-06-27 10:24:09 +02:00
committed by GitHub
parent cf496668fb
commit c9a33e44bd
7 changed files with 330 additions and 44 deletions

View File

@@ -733,8 +733,9 @@ fn mandelbrot_node(footprint: Footprint) -> ImageFrame<Color> {
let offset = (intersection.start - image_bounds.start).max(DVec2::ZERO);
let width = footprint.transform.transform_vector2(DVec2::X * size.x).length() as u32;
let height = footprint.transform.transform_vector2(DVec2::Y * size.y).length() as u32;
let scale = footprint.scale();
let width = (size.x * scale.x) as u32;
let height = (size.y * scale.y) as u32;
let mut data = Vec::with_capacity(width as usize * height as usize);
let max_iter = 255;