* A drawing's list of one kind of record: ById, with balloons first (#5426)
Each kind on a sheet writes out the same add, find by halves, cap, order and check loop. ById holds
those, so a kind's own file holds only its own rules, and the file's bytes don't change: it saves as
the plain list. Views and dimensions stay on their own lists for now, since other work is on them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* A drawing keeps an image's file once, however many places it sits (#5426 W38e-1)
images holds the files and sheet_images each place one sits, so a logo on every sheet costs what one
does. drawing.image.add reads the file (bytes and pixels checked from its header before anything
decodes it), reuses a file with the same bytes, and saves the bytes without the path. A file goes
with the last thing that uses it, which Drawing::images_in_use alone says, and reading a drawing
refuses a file nothing uses or a record its file disagrees with. A sheet's list and delete take the
placements on it. Deleting one placement waits for selection.delete to take a drawing's objects. Its
pixels on paper are W38e-2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Sheet images: an image file's pixels on any paper grid (#5425, W38e-2)
A PNG or JPEG decoded once, then stretched over its paper rectangle onto the pixel grid a writer
asks for: a box filter in linear light with alpha premultiplied, so a shrunk logo keeps its edges
and gains no dark fringe. The size is read from the header and refused over 64 megapixels before
anything is decoded. An EXIF orientation is applied; colour profiles are not read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Sheet images: a placement in the sheet's scene and its SVG (#5425, W38e-2)
Each image placed on a sheet is a group of the new kind `sheet_image`, between the drawing border
and the views, so a view's lines draw over a photo. `drawing_pictures` holds both that group and
the provider a writer asks for its pixels, so the two read the same placement.
The provider holds what one sheet uses, decodes a file when it is first asked, once however many
placements show it, and refuses a sheet whose files hold more than 64 million pixels, from their
headers, before anything decodes. `drawing.export` passes it to the SVG writer in place of
`NoPictures`, and a file that won't decode refuses its sheet by name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Render: pin the product image's output before it is drawn in tiles (#5624, W17b S1)
The decoded rows of five product renders (orthographic on a transparent background, perspective on a
solid one, a PBR surface, two glass layers sorted back to front, triangles crossing every edge of the
picture), taken on this tree. The next change reshapes ImageTask into a prepare stage, tiles and a PNG
sink; they must not move. The PNG bytes are not pinned: their compression depends on the deflate
backend the build unifies (flate2's zlib-rs when the UI crate is built alongside, miniz_oxide
without), not on this code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Render: pictures drawn tile by tile into any pixel window (#5624, W17b S1)
The CPU product renderer, reshaped so drawings can use it: one rasteriser (`Raster`) prepares a
scene once (appearances, projected triangles, glass sorted back to front), then draws each tile of
the picture on a canvas of its own. A sample's position comes from its whole-picture index, so tiles
put side by side are the picture drawn whole, to the byte.
- `ImageTask` (render.image) is that rasteriser over one whole-picture tile from the product camera,
then its PNG: the same output, pinned by the previous commit's rows.
- `PictureTask` draws a `PictureRequest`: a `Projection` (the product camera, or an `OrthoFrame`,
W17a's view frame as plain data: a `Plane` basis, a scale and a paper shift, on a
`geom::pixel_grid::PixelGrid`), any list of `PixelWindow` tiles, `Supersample::One` (pixel centres)
or `Two` (i + 1/4 and i + 3/4), a `BodyRole` per body (`DepthOnly` hides what lies behind it and
draws nothing itself) and an optional background (none: transparent). Each tile comes back as
straight-alpha sRGB RGBA rows, blended in linear light.
- The orthographic map is the frame's paper map, onto the grid, so lines drawn from the same frame
register with the pixels (to 1e-9 mm in the test).
- Limits: 65,536 px a side, no total cap; each tile under the resolver's `RenderLimits`, as the
product image is; at most 65,536 tiles; the prepared lists as a product image's; pixel tests up to
8 per sample of the picture (128 M for a product image, as before), counted at admission by the
one projection the raster uses, as main counts a product image's.
Not here: the drawing light, stored per-tile bins (S2, measured), the paper scene's picture item
(S3), 4x sampling, and `raster::render`, the snapshot rasteriser, which stays as it is.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Render: time the tile renderer (#5624, W17b S2)
An ignored timing test, as `simplify_timing` is: a 65,548-triangle front view drawn as the
product image, as one 300 dpi picture, and in 64-row strips at 300 and 1200 dpi, each the median
of three runs. It is the measure S2's speed-ups are judged by.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Render: a tile passes over a triangle outside it before painting it (#5624, W17b S2)
Each tile placed and painted every triangle of the picture, then dropped those outside it: the
appearance lookup, the PBR normals and the colour decode ran for every triangle in every tile. A
triangle's work is now three steps, `corners`, `look` and `place`. Preparation runs them in
today's order, so its checks and errors are the same. A tile places a triangle first and paints
only those inside it. What is drawn doesn't change: the pin and the tile tests stay as they were.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Render: one light per picture (#5624, W17b S2)
`raster::shade` normalised its key light and highlight directions again for every sample,
although both depend only on the view. `raster::Light` works them out once per view and shades
with them. The tile renderer and the snapshot rasteriser (`raster::render`) both use it, so the
product light is written in one place. The arithmetic is the same, so every pixel is too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Render: sRGB codes from tables (#5624, W17b S2)
Each shaded sample was stored as sRGB through a power (three per sample), and each output pixel
was averaged from its samples through twelve more and written back through three: the powers
were most of a sample's arithmetic. Decoding is now a 256-entry table of `geom::srgb`'s own
values (#7162), which also ends this file's own copy of the formula. Encoding counts the code
starts (the linear values halfway, in sRGB, between two codes) at or below the value. Within a
billionth of a start, where the formula's rounding could fall either way, `srgb::encode8`
decides, so every code is the one it gives. A test checks both against `geom::srgb` at every
start, the numbers around it, the band's edges and a million values in and outside 0 to 1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Render: a tile's passes run in loops (#5624, W17b S2)
The raster went back through its step loop for every sample: the cancel check, the stage match,
the tile's window and its canvas bounds, once per sample cleared, tested or averaged. Clearing,
the opaque and glass passes and the downsample now each loop on their own up to the step's budget,
counting a unit as before; preparation and the glass sort still take one unit a call. A step
still checks for cancellation before each stage's run and still does at most 16384 units, so the
host's slices and the progress counts are the same.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Render: tests for a picture's light, glass order and test budget (#5624, W17b S2)
Three planted faults went through the image tests; each now has one
that fails:
- an orthographic picture lit from another direction than its eye: a
face square-on to the view is the colour the product image gives it;
- glass placed by a triangle's first corner, not its middle: a tilted
square whose first corners lie in front of the near one, its middles
behind;
- a picture held to the product image's pixel-test budget: a face
across most of an A0 sheet at 1200 dpi is prepared.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing sheets: a shaded view's picture on paper (#5624, W17 V9b)
A saved view in a shaded style draws on its sheet and in drawing.export:
draw puts one picture per entry of the view's parts under its lines, and
ViewPictures renders each on the writer's grid through the frame that
placed the lines. SheetPictures answers for a sheet's images and views.
The styles with lines stay refused until W06's exact lines.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Render: a picture's count of its tiles and its fixed limit, as #6483 has them (#5624)
A triangle counts only where it meets the tiles asked for, and a picture has a fixed 400 M pixel tests,
as #6483 at bf93e890e. V9b's stack holds an older copy of that slice; this drops away when drawings
takes main. PictureTask says what admission counted, for the view's running sum.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drawing views: a shaded view's pictures add up to one limit (#5624, W17 V9b)
A writer asks for a picture a band at a time, and each request is limited on its own, so ViewPictures
keeps what each view's requests have counted and refuses the next one past the limit, by name, before it
paints. That makes 400 M a bound on a whole view.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>