WebP had no embedIcc option, and its encoder never attached a profile,
so no WebP file carried one. WebP now takes embedIcc like JPEG, TIFF and
PSD, on by default: the file becomes an extended (VP8X) file holding the
sRGB profile in an ICCP chunk, lossless or lossy. embedIcc: false writes
the plain file as before.
- document.export and Export for Screens' settings.webp take embedIcc,
and document.formats lists it for WebP.
- WebP Options (Export As and Export for Screens' Format Settings) gets
an Embed ICC Profile checkbox.
- Docs: docs/mcp.md and docs/file-format-parity.md.
color_image_owned cast the raster's Vec<u8> to egui's Color32, which is
aligned to 4 bytes, so bytemuck's try_cast_vec always failed and the
fallback copied the whole frame: about 20 MB at 2880 x 1800 on every
full-frame upload, despite its doc comment.
The renderer now also renders into a Vec<u32> (render_words,
render_plain_patch_words, render_region_words). Over transparency the
vello context draws straight into those words; frames that compose
offscreen, blend in CMYK, show an opacity mask or are supersampled
are converted once. color_image_owned takes that buffer and hands it
to egui as Color32 in place. The canvas frame, the render worker's
frames, pan fills, split panes, edit parts and the region previews
(stroke and artboard images, graphic style swatches, the PDF page
preview, the flattener preview) use it.
Renderer::render, render_node, render_pattern_swatch and the image of
Effect > Rasterize copied the rendered pixmap into a new Vec<u8>. They
now take the pixmap's buffer and cast it to bytes in place
(group::into_bytes); a buffer the cast cannot take is still copied.
The target pixmap with nothing under it is allocated zeroed
(group::blank_pixmap) instead of being filled pixel by pixel. At
2880x1800 that removes one 20.7 MB fill and one 20.7 MB copy from every
whole-frame render. The pixels are the same bytes.
Part of #1172
With File Handling › Display Bitmaps as Anti-aliased Images (or its Pixel
Preview setting) off, images inside pattern tiles and placed documents now
show hard-edged pixels, and the tile or placed bitmap is drawn without
smoothing too. Tiles and placed bitmaps made with and without smoothing are
kept apart, and a raster kept for type with color bitmap glyphs is made
again when the setting changes.
- Tests: a 2x2 checker scaled up in a pattern tile, a placed document and
the canvas shows only its own colors with smoothing off and greys with it
on; type rasters change their inputs with the setting.
- Docs: docs/mcp.md and the preference help no longer note pattern tiles
as an exception.
Once an object with raster effects covers more than the pixel budget on
screen, its raster is cropped to the view. While dragging, such content
was rendered within the drag budget and no raster was kept, so every
frame of the drag painted the content and ran the whole effect chain
again: about 0.5 s a frame with Texturizer at 6400%.
A drag now keeps that raster when every effect only looks nearby. The
raster covers the view with a margin around it, within the drag budget
(at full resolution when the frame's crop fits it), and records the part
whose pixels the effects decided with all they look at. Later frames of
the drag move it with the object, as the whole-raster move already does,
while what the frame shows of the content, with the sampling footprint
of a lower-resolution raster, lies inside that part. A move or pan past
it filters again. Still frames are unchanged: a drag's raster never
draws outside a drag, and the frame after the drag renders as before.
Part of #2558. Builds on the approach of #2779 by 00xJS.
Rustdoc builds each doc test as its own crate, without the workspace's
`unsafe_code = "deny"` and without a library's `#![forbid(unsafe_code)]`,
so a doc test holding an `unsafe` block passed `cargo test --doc`.
- Every library root now carries `#![doc(test(attr(forbid(unsafe_code))))]`,
or `deny` in cad, eps and metafile, which rely on the workspace lint.
- `cargo xtask layers` reports a library whose doc tests are missing the
attribute, or use `deny` where the library forbids unsafe code.
- AGENTS.md names the rule next to the `unsafe` allowlist.
Renderer::changed set the measuring flag before it compared anything, so
comparing a document with itself still made the next
finish_measurement_only sweep the paths of the last frame. The flag is
now set where the diff measures an object through the renderer, in the
Trim View check (children_blend caches the groups it reads), and when a
change outside the layers redraws everything, so bounds kept for old
symbol definitions still expire.
The canvas calls Renderer::finish_measurement_only in every frame that
waits for the render worker. Since 51d3dcf2ea each call ages the
renderer's caches, so after four waiting frames the paths it drew were
swept even when nothing was measured, as after a zoom or a pan. The next
frame the canvas rendered itself built every path again: a pan step at
400% on a 6,000-path document took 25 to 34 ms instead of 8 to 10 ms.
finish_measurement_only now ages the caches only when Renderer::changed
measured through the renderer since its last frame or the last call, so
a drag whose frames go to the worker still lets go of old node versions.
The clip matrix refused a depth range whose depth slope came out
negative, which happens when the nearest point is close to the eye
(eye 100, depths 0 to 99.5), and the solid fell back to shaded faces.
The mapped depth rises between the two ends whenever w is positive at
both, so the check now tests w and the mapped depths instead of the
slope. A test covers that range and a range that reaches the eye.
The resolution test also checks that the rendered image carries its
pixels, and docs/mcp.md and docs/target-app-parity.md say that
rendered shadows need both Shading and Shadows on.
Weak tests in vectorcraft-render and vectorcraft-trace now assert the
behavior they name:
- The stroke glow test checks that the glow is drawn and that four
threads draw what one does, instead of only rendering.
- The JPEG and palette id tests name saved ids and labels directly
(gray, optimized, none, blackWhite), unknown and empty ids, instead
of looping over every value and reading its own id back.
- The trace presets test drops the loop over every preset name, which
presets().len() already covers, and checks the [Default] and padded
name lookups by their result.
- Nested discs each get the disc below them as parent, checked exactly.
- A 20 degree bend gets no corner under a 30 degree minimum turn, and
gets one under a 10 degree minimum.
- The gray BMP, reduced CMYK and tiled image tests check the size of
what they read, and the long stroke tests check that one outline was
made before checking that none is cropped.
- The three drag timing probes assert that the frame after the drag is
what a fresh renderer draws, in place of printing two hashes.
When a picture is read later in place of text that only names it, a raw
bitmap whose pixels don't fill the size in its header is not taken: the
text beside it is pasted, as for any picture that can't be read. A raw
bitmap with no text beside it is still read and its error reported.
read_pixels documents what happens when the renderers' store refuses
the decoded pixels: they are dropped, and the PNG is decoded as any
other image is. A render test covers that case.
* fix(effects): draw dark dots in RGB Color Halftone
(cherry picked from commit 2dbe91af9f)
* Cover dark-on-light RGB halftone polarity
Updated halftone tests to clarify behavior regarding pixel brightness and dot sizes.
(cherry picked from commit babd60e332)
* effects: bound Color Halftone dots at full coverage
(cherry picked from commit 8fb0bf55607762df6e3acc2ed7ed37a643fea022)
* effects: describe Color Halftone ink coverage
(cherry picked from commit 0dbf12514095b6e12cb4414055d8ac47ee1fbcdc)
* Document the change to saved RGB halftones
* Test the bounded edge overlap of full halftone dots
---------
Co-authored-by: Mex <[email protected]>
Co-authored-by: dotCooCoo <[email protected]>
Seven render, brush and effects tests accepted results well away from
the value the code is meant to give:
- The two linear gradient tests now expect the value at the pixel
center (126 of 255, red 126 and blue 129) within 2 levels, instead of
12 or 20 around 128.
- The trimmed bristle strand test bounds the width ratio on both sides.
- The calligraphic roundness test expects the 0.1 pt hairline within
1e-6 pt.
- Pucker & Bloat expects the corner anchor at (12.5, 12.5) and
(-12.5, -12.5), not only the sign of the move.
- Exposure's offset and gamma checks expect the sRGB value within 1e-5.
- Smart Blur's checksums of earlier output are replaced by a 4 pixel row
whose averages are worked out by hand.
Each new assertion fails when the code it covers is changed (the
gradient stops shifted, the pressure, roundness, pucker, offset or gamma
factor changed, or the blur threshold widened).
A corner in one subpath gave the stroke's join to the lines of a curve
in another subpath that met at the same point, so a miter could be
drawn there instead of a round join. The corners are now kept per
subpath and each subpath of the outline reads only its own.
Test: a curve's outline is the same with and without a second subpath
that has a corner at the curve's start.
Since #9972 a thin stroke along a curve is drawn as lines, and where two
of those lines met at a sharp angle the stroke's own join was drawn
there. Along smooth anchors that sit close together after a bend, or a
curve that bends tightly, the lines turn sharply, so a miter join drew a
spike past the stroke and the smooth curve showed sharp corners on the
canvas. The document's anchors are unchanged; only the drawing was
wrong.
The stroke's join is now drawn only at the path's own corners, where
two segments meet with tangents that are not in line. Where the lines a
curve is drawn with turn sharply they meet with a round join, as the
stroke along the curve itself is round there.
Tests: a bend followed by smooth anchors 0.1 and 1 apart keeps every
outline point within the stroke's width of the curve and covers it;
with long handles the outline matches the curve's own outline away
from its edge; 200 random cubics with a miter join keep their outline
within the stroke's width of the curve.
- With Shadows on, every light with an intensity above 0 casts shadows on
the solid and on the shadow plane in the image, black at 50%, with each
light's Softness widening its edge; with Shadows off none does.
- Selection, Use Preview Bounds, Align, hit testing and snapping measure
the shaded faces without rasterizing. Painted bounds hold the whole
image, measured without rasterizing. Images are cached by their inputs.
- Expand Appearance and baking keep the rendered image; PDF export in a
CMYK document writes it as raster effects are written.
- Render Settings gains Raster Settings... (resolution and background),
built on the framework's parameter dialog; settings the selection holds
differently open blank and are kept. The menu checks a choice only when
every selected object has it.
- Tests for the clip matrix, coverage, depth order, the shading formula,
limits, work bounds, edge values, masks and Revolve's objects-only rule.
Docs: docs/three-d.md, docs/mcp.md, effect params text.
Extrude & Bevel, Revolve, Inflate and Rotate take render.mode "rendered",
with quality (low, medium or high: 1, 2 x 2 or 3 x 3 samples a pixel),
resolution (null for Document Raster Effects Settings, or 1 to 2400 ppi)
and background (transparent or white). The effect then draws its solid
as one image made with craft-raster3d: a depth buffer, the effect's
lights in linear light with the material's roughness and metallic, and
shadow maps for each light, over the effect's vector shadow. The image
lies where the vector faces lie: each mesh point goes through the
projection the effect draws its faces with (MeshProjection).
The shaded faces are drawn instead, and the status bar and the
effect.apply and effect.setParams results carry a "warning", when the
image would pass 16,777,216 pixels at one sample a pixel, or when the
solid is painted with a gradient, a pattern, graphics, an opacity below
100% or a blending mode other than Normal, and for Revolve on a group or
on a fill or stroke. The warning check measures the image without
rasterizing it.
The 3D and Materials panel's Render Settings menu gains Rendered and Low,
Medium and High Quality. Each choice is one undo step for the selection,
and each object keeps its other render settings.
The effect-art cache now includes the document's raster resolution, so
changing Document Raster Effects Settings redraws rendered images.
Every craft-libs rev moves to 64383b59, which adds crates/raster3d.
Docs: docs/three-d.md, docs/mcp.md, docs/target-app-parity.md.
Object > Plug-ins > Arrange Tools > Mark Bounds of Each... runs the new
command addon.arrange.markBounds. For each selected object it draws a
group of four inward L-shaped corner marks (10 pt legs by default, each
at most half the side it runs along) or a rectangle, with no fill and a
red 1 pt stroke by default, on the object's geometric or visual bounds.
Visual bounds count strokes, brush art and effects as drawn.
- Clip groups are measured by their clipping path, other groups by
their members together. Guides and objects without bounds, such as
empty groups, are skipped; a selection with nothing to mark is an
error that makes no undo step.
- The marks go directly above their object, or above the outermost clip
group or clipping sublayer that holds it, so the mask does not clip
them. The run is one undo step and selects the marks.
- Out-of-range lengths and weights, unknown styles and bounds, and bad
colors are errors; defaults apply only to omitted values. At most
20000 objects are marked at once.
- The dialog has Preview; Length is off unless Draw is Corner Marks.
- vectorcraft-render gains drawn_bounds_with, drawn_bounds with a shared
symbol cache, so a large selection measures each symbol once.
Docs: docs/mcp.md, ROADMAP.
A curve drawn as lines took its line ends from the curve's bending alone.
Where a curve runs out and back twice along almost one line, its two turns
hold almost no bending, so a thin stroke drew it with one step in two
halves: each half held a whole turn, the two halves' gaps canceled, and
the band ran straight from start to end without either turn. A cubic from
(0, 0) out to x = 28.87 and back to x = -28.87 drew only around x = 0.
Each step is now checked against its curve: where the curve lies more
than twice the chord allowance from the step's line, to either side or
past its ends, the step count doubles, up to the curve's equal steps.
Wide strokes draw their long curves the same way and get the same check.
A radial or mirror repeat with an effect of its own, such as a drop shadow,
takes its bounds from the object-effects branch, which falls back to
`own_box`. `own_box` measured the placed steps of a spine-aligned blend but
not the rotated or reflected copies of a repeat, so moving such a repeat left
the copies' geometry effects outside the redrawn area. `own_box` now unions
a repeat's placed copies as #9936 does in `cull_bounds_in`.
`placed_live_effect_bounds` now looks for effects below the node only: the
node's own effects run on the placed whole and its callers measure them, so a
repeat or blend whose only effect is its own no longer expands its copies or
steps to measure them.
Each line end of a curve drawn as lines moved out by the curve's whole gap
from the chords beside it, including the part along the chord. Where a
curve runs out and back along almost one line, that part points along the
curve, so the end moved past the turn: a cubic from (0, 0) out to x = 75
and back drew its band out to x = 112.5. The ends now move only across
their chords.
Strokes narrower than four raster tolerances had their outline fitted and
flattened at a tolerance as fine as 1/16 of the raster tolerance, so each
side of a thin curve took about four times the lines a wider stroke takes,
and every frame drew them all. A plain thin stroke (no dashes, no width
profile) along a path with curves is now drawn as lines first, within a
sixth of its width of the curve, and each side of each line is offset by
exactly half the width. The band keeps its width, the outline takes one
line per side for each line of the path. Where two lines meet at a small
angle both sides go to where their offsets cross; sharper corners get the
stroke's join, open ends its caps, and a closed path keeps its hole. Dashed
and profiled thin strokes, and thin strokes along straight paths, are
unchanged.
On 200 cubic curves about 100 device pixels across, a 0.5 px stroke's
outline goes from 15,559 lines to 7,514 (4,288 before #3273).
A Mirror Repeat on a slanted axis reflects its copy before the source's
geometry effects run, so a Transform effect on the copy painted outside
the move and Undo damage region, the same fault #9169 fixes for Radial
Repeat. Mirror repeats now take the same measured bounds, with a test
that fails without the change.
Where no background worker starts (and on the web), schedule makes the
bitmap on the drawing thread. A panic there left the bitmap pending, so
wait_idle, which has no time limit, could wait for it forever. That path
now does what the worker does after a panic: it marks the bitmap failed
and stops it being pending, then lets the panic go on to the caller.
The deb, rpm and tar.gz packages install
share/thumbnailers/ai.storyteller.vectorcraft.thumbnailer for
application/x-vectorcraft and application/x-vectorcraft-template. It runs
the new `vectorcraft-cli thumbnail --size N IN OUT`, which opens the
document as the app does and writes an 8-bit RGBA PNG of the first
artboard, N pixels (1 to 1024, default 256) on its longer side.
A file larger than 256 MiB, one that can't be opened, a document that
shows nothing, or a run longer than 20 seconds writes no PNG and exits
non-zero, so the file manager keeps the file's icon. The Nightly deb and
rpm leave the entry out, as they leave out the MIME package.
The render moves into vectorcraft_render::encode::first_artboard, which
the embedded native preview also uses.
A layer whose Preview is off draws a placed document in it as the crossed
box, and effects that change geometry reshape that box. Two cull-bounds
paths measured such a sublayer in the mode around it instead:
- A group with effects of its own (a drop shadow, for example) is measured
by fx::cull_bounds, which did not enter each layer's own mode. The group
was culled where the sublayer's moved crossed box was in view. Each layer
in that walk is now measured in the mode its Layer Options give it.
- A group's cached bounds were keyed only on whether placed documents are
crossed. Turning Show Images in Outline Mode on or off changes a
Preview-off sublayer's mode without changing that, so the group kept its
old bounds. Every object other than a path is now keyed on the full
layer mode.
A geometry effect is given the object's box as its reference, for
example the center a Transform effect scales and rotates about. Drawing,
the preview bounds, Expand Appearance's first step, shape art, the
outline check of the .ai reader and a stroke's effects before a Transform
that makes the stroke a path of its own measured that box with kurbo's
bounding_box, which counts only segments. A lone anchor was left out, and
a path of one anchor measured a box at the origin, so it scaled about
(0, 0). PathData::bounds, which the selection's box, Align, Transform
Each and every later effect in the stack use, holds lone anchors.
- geom: anchored_curve_bounds measures a BezPath as PathData::bounds
measures the path it stands for.
- render, effects and the .ai reader give geometry effects that box.
Gradient reference boxes and clip regions are unchanged.
A round or projecting cap draws a dot for a closed subpath of one anchor.
The bounds the effects are measured by left that dot out: the visual and
cull bounds, the box Rasterize makes its image over, and the reach of an
effected path's raster effects. A path of only lone anchors was measured
at the origin.
- `vectorcraft_geom::path::drawn_curve_bounds` measures a kurbo path as
`PathData::drawn_bounds` measures the anchors it stands for.
- `crates/render/src/fx` measures effected paths with it, and a path that
draws nothing by its anchors, as `Node::visual_bounds` does.
- A stroke measured along its segments (miter and bevel joins, projecting
caps) gives the dot of a closed lone anchor its reach.
In Outline mode without Show Images in Outline Mode, an envelope holding
a placed document distorts the document's crossed box, since the
envelope reads the art that PlacedDocument::art gives while placed
documents are crossed. Each step of a blend of placed documents is a
placed document itself, so it is drawn crossed.
- outline_mode_warps_an_enveloped_placed_documents_crossed_box: an Arc
warp of a placed document draws the same pixels as the same warp of
its crossed box as a plain path, and the file's art with Show Images
in Outline Mode on.
- outline_mode_draws_each_step_of_a_blend_of_placed_documents_crossed:
the step between two placed ends is crossed, and drawn uncrossed with
the option on.
Docs: docs/ui-parity.md row, docs/mcp.md outlineImages.