Commit Graph
5891 Commits
Author SHA1 Message Date
aiongg 17adf30a85 craft-ui: replay records compare as replayed; replayed members take their stack positions from the arena
`Transcript` equality compares the form a replay registers (`Transcript::placed`, which `focus::replay` uses): a
record under the scope open around the run goes under the open scope, and a replayed scope is no new scope.

A replayed member join and `over` placement take their stack positions from the arena they join in the replaying
pass, as a real run does: the journal notes the members as declared with the layer and clip, and the join and the
`over` placement record their shapes themselves. The `journal` doc says the capture assert fires in a build, not in
`cargo check`.
2026-11-19 07:58:25 +00:00
aiongg 2f8832b099 craft-ui: trials of journal entry and focus transcript equality 2026-11-19 07:43:39 +00:00
aiongg 5b9eb4cf53 egui: repin to storytold/egui#52 head 96ccc118b (PassRecords::first_difference) 2026-11-19 07:39:17 +00:00
aiongg 08a442aeaf craft-ui: journal entries are data, comparable by call and arguments
`runtime::journal(ctx, args, again)` notes a registration as its arguments and a capture-free `again` (a function or
a closure without captures; a capture fails to compile). Two entries are equal when they come from the same `again`
with equal arguments, and `Debug` names the call and its arguments, so a replay can be compared with a real run.

The focus `Transcript` and the records it holds (`StopRec`, `ScopeRec`, `RowGroups`, `Stop`, `Group`, `KeyUse`,
`KeyRole`) derive `PartialEq`. The journal's argument types gain `PartialEq` or `Debug` where they lacked them;
`UiTokens` compares by its content key. The docking generics that journal drop spots require `PartialEq + Debug` of
the panel type.
2026-11-19 07:37:16 +00:00
aiongg 98b1810f8f Merge pull request #2320 from aiongg/stack-command-defs
ui-macros: CommandSet::defs builds each command in its own function
2026-11-18 22:41:15 -05:00
aiongg ee151c5758 Merge pull request #2319 from aiongg/docs-no-pr-cache
docs workflow: pull requests do not save a dependency cache
2026-11-18 22:41:03 -05:00
aiongg 9f234ae3ec Merge pull request #2299 from aiongg/next-sync-1118
Sync main into next (18 Nov)
2026-11-18 22:14:22 -05:00
aiongg 16e50264ca ui-macros: CommandSet::defs builds each command in its own function
The derive pushed every variant's definition inline, so one frame held a CommandDef temporary per variant (175 KB for the largest set in PhotoCraft at opt-level 0). Each variant is now a non-capturing closure in a table of function pointers, and defs loops over the table.
2026-11-19 02:27:44 +00:00
aiongg 3b4f5079e4 docs workflow: pull requests do not save a dependency cache 2026-11-19 02:23:06 +00:00
David Mann 815e6a2389 Merge pull request #2283 from davidmann4/anchor/12708-edit-existing
Add Anchor: select and edit existing anchors and handles (photocraft#12708)
2026-11-19 03:22:06 +01:00
aiongg 147e122d8e Merge remote-tracking branch 'upstream/next' into next-sync-1118 2026-11-19 01:56:16 +00:00
aiongg 43bf8e87bc Revert "Lazy::show_or: the first child takes room only when it shows, so a dock group's extent is the same run or replayed"
This reverts commit 4f3b9e8594.
2026-11-19 01:56:16 +00:00
aiongg 4f3b9e8594 Lazy::show_or: the first child takes room only when it shows, so a dock group's extent is the same run or replayed
A host view that leaves its group to the dock left an empty scope in the
settling view's Ui, which moved the group below it. The view's extent then
differed between a run of the group and a replay of it, and the pointer over
one tab ran every group again.
2026-11-19 01:47:46 +00:00
aiongg b013967b02 Sync fixes: main's JXL capability test, settling layer through runtime::egui 2026-11-19 01:35:39 +00:00
David Mann 93e68f35a1 Merge remote-tracking branch 'origin/next' into anchor/12708-edit-existing
# Conflicts:
#	crates/draw/src/ui/pen/bezier/mod.rs
#	crates/draw/tests/it/bezier.rs
2026-11-19 02:31:29 +01:00
David Mann ad32b91d50 Merge pull request #2284 from davidmann4/anchor/12709-alt-subpath
Add Anchor: Alt selects or copies the whole subpath (photocraft#12709)
2026-11-19 02:15:12 +01:00
David Mann 117389d4a1 Merge pull request #2306 from davidmann4/fix/next-red-dock-settle
Lazy::show_or: a view that leaves its room takes none (next is red since #2273)
2026-11-19 02:14:53 +01:00
aiongg 9d599676d1 Sync fix: name private items in public docs as code, not links 2026-11-19 00:48:51 +00:00
aiongg f6532f9835 Sync fix: keep main's uri_decode import in the glTF tests 2026-11-19 00:32:21 +00:00
aiongg 7086f23162 Sync fixes: restore the rust-cache lock entries, drop a duplicate import, format 2026-11-19 00:27:45 +00:00
David Mann 15fee07c8d Merge branch 'fix/next-red-dock-settle' into HEAD 2026-11-19 00:56:30 +01:00
David Mann 7fcf44cb93 Merge branch 'fix/next-red-dock-settle' into HEAD 2026-11-19 00:56:29 +01:00
David Mann b5b1300783 Lazy::show_or: a view that leaves its room takes none
next has been red since #2273 on two counts, both in the dock's settling
host view (3bcc5bec4):

- design-lint: contract/lazy.rs named `egui::LayerId` for the run's
  layer. The run now holds the runtime's `Layer`, the type `Place` and
  `replay::close` already use.
- hovering_a_tab_runs_only_its_group: the dock ran its host view in a
  `scope_builder`, which takes room and item spacing in the Lazy's
  child even when the host leaves the group to the dock. A replayed
  group then sat 4 points lower in flow than a group that ran, so the
  child's extent changed whenever a hovered group ran, layout memory
  asked for a discard pass, and that pass ran every group (5 runs
  where 1 is expected).

`show_or` now runs `add` in a child `Ui` that takes room only when it
returns `Some`, so `otherwise` takes the same place whether it runs or
replays.
2026-11-19 00:55:45 +01:00
aiongg e8e713ee26 Merge storytold main into next (18 Nov sync)
Merges main at 3b8e426a26.

- crates/ui: main's e-sign dialog (crates/ui/src/esign) moves to craft-cloud-ui beside the
  share dialog, behind craft-cloud-ui's esign feature; craft-ui forwards `esign` and
  re-exports the module.
- crates/proof: main's can_suggest_cased goes to affix/check.rs and its tests to
  affix/tests.rs (next split affix.rs); French wiring in lib.rs.
- crates/svg: main's validated resolver and raster validation stay under tree-render, which
  now also enables gif and image-webp; the shared image-codec helpers are gated on tree.
- craft-ai-agents: main's rev (craft-ai-integrations main), one entry.
- crates/craft: facade dependencies, features and re-exports for main's new crates.
2026-11-18 23:07:38 +00:00
David Mann 04ba41419b Merge pull request #2242 from ljkx/fix/15540-dialog-first-field-selected
Dialogs: a dialog that opens on a text field selects its text (photocraft#15540)
2026-11-18 23:27:59 +01:00
Dylan M. Taylor 3b8e426a26 feat(exr): add f32/f16 RGBA writer, compression modes, and chromaticities (#2281) 2026-11-18 17:20:52 -05:00
David MannandClaude Opus 5.5 4d78bb2de2 Add Anchor: Alt selects or copies the whole subpath
In the reference application Alt does not turn Add Anchor Point into
Delete Anchor Point: an Alt click on a segment selects every anchor of
its subpath and adds nothing, an Alt drag moves a copy of the subpath
(the copy ends up selected), an Alt click on an anchor deletes nothing,
and the cursor is the arrow with a plus.

The overlay now does the same under Add Anchor, reusing Direct
Selection's Alt segment press (`PathEdit::DuplicateSubpath`, or the
subpath itself on a path that takes no copies). Delete Anchor with Alt
still adds an anchor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 23:03:09 +01:00
David MannandClaude Opus 5.5 0274c3e5a0 Add Anchor: select and edit existing anchors and handles
In the reference application the Add Anchor Point tool edits the
anchors and handles a path already has as Direct Selection does; only
a press on a segment adds an anchor. The overlay took a press on an
anchor and did nothing with it, and never took a handle.

Under Add Anchor a press on an anchor now selects and drags it as
Direct does (Shift adds to the selection), a press on a shown handle
drags it (Alt moves it alone), and a click on empty canvas deselects
the anchors and keeps the path. Alt on an anchor is still Delete
Anchor's click, and a click on a segment still adds an anchor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 22:59:49 +01:00
Dylan M. Taylor 010702ee9b chore: sync Cargo.lock with workspace (#2279) 2026-11-18 16:37:32 -05:00
Dylan M. Taylorandtexjer 6c034902b2 craft-develop: extract spline, curve, and lut modules from LightCraft (#587) (#2274)
Co-authored-by: texjer <texjer@gmail.com>
2026-11-18 16:30:48 -05:00
FredApps bba249ecbf Merge pull request #2270 from FredApps/fix/786-psd-tagged-descriptor-prefix
psd: add bounded recovering descriptor-block prefixes
2026-11-19 04:28:10 +07:00
aiongg 18ffc07519 Merge pull request #2273 from aiongg/frame-cost
Frame cost: shown-chord table, settling host views, one gate answer per frame
2026-11-18 16:19:20 -05:00
Dylan M. Taylor 816f745c02 Merge pull request #2023 from el-j/feat/video-mjpeg-frame
craft-video: Motion JPEG frames convert to VideoFrame (#1231)
2026-11-18 16:11:50 -05:00
aiongg e79a3ed16e TransformBox: trial that a frame run twice reports each drag move once
A frame's second pass runs the box's update again with the press still
held at the same point. The proposal it makes equals the one the first
pass reported, and the gesture reports an equal proposal only once, so a
host that applies each Update applies it once per move. The trial runs
a drag with every frame run twice and counts the updates.
2026-11-18 20:59:41 +00:00
aiongg 0392fc439d Commands: the gate answers each command once per frame
The board asked the app's gate again for every resolution: each reader
of a command, the measuring and the real run of each component, and the
re-resolution of every shown reader at the start of each pass. The gate
is a snapshot of what the app knew before the frame, so the board keeps
its answers for the frame and asks once per command. CommandRef::key_text
gives the key without allocating for a command without parameters; the
keymap's lookups and the board's answers use it.
2026-11-18 20:59:41 +00:00
aiongg 3bcc5bec46 Dock: a host view settles under its panel's content version
DockPanels::group_view ran in every pass, while the dock's own groups
settle their bodies under DockPanels::content. A host view now runs in a
settling Lazy under the shown panel's content version, the group's
panels and its shown tab, and repaints its last run while they hold.

Lazy::show_or carries the host's answer: the view runs first, and where
the host leaves the group to the dock, the dock's group shows in the
same child and that run is not kept, so the next pass asks the host
again. The run-count trial checks that a settled frame runs neither the
view nor the versioned body.
2026-11-18 20:59:41 +00:00
aiongg a23d8c68c6 Menu bar: one MenuHelp constructor, over a function that lists the entries
MenuHelp had two constructors, one over a list the caller built every
frame and one over a function the bar calls only while the Help menu is
open. Only the second keeps closed menus from paying for the list, so it
is the one constructor: MenuHelp::new takes the function.
2026-11-18 20:59:16 +00:00
.CooCoo b130ac1fa4 image-codecs: find the JPEG-LS frame header past 64 segments, and add detect_prefix (#2178)
* image-codecs: find the JPEG-LS frame header past 64 segments, and add detect_prefix

detect walked at most 64 marker segments looking for the SOF55 frame
header, so a JPEG-LS file with more segments before its frame header,
such as an ICC profile split over 255 APP2 segments, was reported as
JPEG. The walk now runs until it reaches a frame or scan header or the
end of the bytes. Each step moves forward at least one byte, so the walk
takes at most one step per byte.

detect also reported JPEG for a buffer that ended before the frame
header, which is what a caller that reads only the start of a file
passes. The new detect_prefix returns Detection::NeedBytes(n) in that
case, with the length the next step reads, and otherwise the answer
detect gives. The doc comment on detect now says that it needs the bytes
up to the frame header.

* image-codecs: walk each JPEG marker segment once when detecting in steps

detect_prefix walks the marker segments from the SOI on every call, so a
caller that reads exactly the length each Detection::NeedBytes asks for
walks the earlier segments again on each call. Over a file with many
small segments before its frame header, the total walk grows with the
square of the segment count.

The new PrefixDetector keeps the offset of the marker where its last
walk stopped and starts the next walk there. Its detect gives the same
answer and asks for the same lengths as detect_prefix, and
detect_prefix now runs a single step of a new PrefixDetector.

* image-codecs: read past a JPEG-LS restart interval segment and stop at FF 00

The JPEG-LS frame walk treated a DRI segment before the SOF55 frame header
as the end of the walk, so a file with one was detected and decoded as
JPEG. DRI now takes the length-prefixed path. The decoder accepts a 2-, 3-
or 4-byte interval of 0, reports a nonzero interval as unsupported, and
rejects other segment sizes as malformed.

`FF 00` after the SOI is a stuffed zero, not a marker, so the walk now ends
there instead of asking for a length field.

A PrefixDetector whose walk stopped at another frame header answers JPEG
for bytes that start with `FF D8 FF`, without walking from the SOI again.

* image-codecs: apply the JPEG-LS restart interval in effect at each scan

A later DRI with an interval of 0 turns restarts off again, and an
interval of at least the frame height puts a non-interleaved scan in
one interval with no restart marker. Both decode again. A nonzero
interval shorter than the frame height is still unsupported.

* image-codecs: reject a restart marker after a JPEG-LS scan of one interval

A restart marker comes only between two restart intervals. When the
interval in effect is at least the frame height, the scan is one
interval, so a restart marker after it, with or without fill bytes
before it, is now an error instead of being skipped.

Adds a test that a PrefixDetector starts each call at the marker where
its previous walk stopped.
2026-11-18 15:52:55 -05:00
.CooCoo 37724ad48d craft-image-codecs: lossy WebP encoding no longer copies the luma plane for every macroblock (#1975)
The VP8 encoder cloned the whole luma reconstruction before each
macroblock's B_PRED trial and restored it when a whole-block mode won,
so encoding P pixels copied about P^2/256 bytes. The trial writes only
the current macroblock, and the whole-block path writes every pixel of
that macroblock again without reading the trial's values, so the copy
and the restore are removed.

The output is byte-identical: a new test pins the SHA-256 of ten
encoded files (1x1 to 640x480, sizes that are not multiples of 16,
qualities 10 to 95) taken before the change, and decodes each with
image-webp. An ignored test prints encode times for 512 to 4096
squares; in release on one machine, 4096x4096 took 162.9 s before and
1.36 s after.
2026-11-18 15:51:10 -05:00
aiongg 57ecf973e1 Keymap: shown chords from a table built when the bindings change
Keymap::shown_chord ran a lookup for each single-press binding of the
command, and Board::resolve calls it for every command it resolves, so
each frame repeated those lookups for every command row, tool and button.
The keymap works out each command's shown chord when it is built and
whenever its bindings change, and shown_chord reads the table. The lookup
and the table share one ranking (Keymap::winners), which replaces the
separate press_runs copy of it.
2026-11-18 20:43:24 +00:00
Kevin Joseph 041bafa259 craft-docx: keep a table style's w:tblInd on read and save (#2196)
* craft-docx: keep a table style's w:tblInd on read and save

A table style's own indent was dropped on read, so it was gone on save.
pandoc's Table style sets it to 0, and Word for Mac places a table whose
style chain sets no indent about 5.4 pt further right than one set to 0.

craft-wordmodel gains TableStyleParts::indent, merged through basedOn.
The reader takes a dxa indent (nil is 0; pct and auto set none) and the
writer emits it in schema order, 0 included.

Part of storytold/wordcraft#5767.

* craft-docx: a table style's w:tblInd without w:w is 0

CT_TblWidth's w:w defaults to 0, so the style resets a based-on style's
indent instead of inheriting it. The test helper now fails when a saved
style is missing rather than matching an empty string.

* craft-docx: the tblInd override test checks the base sets an indent

Without it the test would pass if the reader dropped the base style's
indent, since there would be nothing to override.
2026-11-18 15:35:42 -05:00
Kevin Joseph 0c3793eadd craft-docx: theme font slots survive a save (#2197)
* craft-docx: theme font slots survive a save

w:rFonts' w:eastAsiaTheme and w:cstheme slots are kept on read and written
back. Word picks the East Asian and complex-script fonts through them, so
dropping them changed which font Word used for East Asian punctuation and
its line breaks. The Latin slots (w:asciiTheme, w:hAnsiTheme) are kept when
the run's font came from them and written back only while they still name
that font in the document's theme, so a font chosen later is not hidden.

craft-wordmodel: a one-byte ThemeFont and CharProps font_ascii_theme,
font_hansi_theme, font_ea_theme and font_cs_theme. Overlaying a named font
without its slot clears the slot; minus keeps a slot whose font stays.

Ported from storytold/wordcraft#5772.

* craft-docx: keep the theme's East Asian and script fonts; exact slot replacement

The saved theme wrote empty a:ea and a:cs faces and no per-script fonts, so
a kept w:eastAsiaTheme or w:cstheme slot named no font in Word. The reader
now keeps the theme's ea, cs and a:font script entries (THEME_FONTS) and
the writer puts them back.

craft-wordmodel: a named font replaces both Latin slots with its own, so a
patch with one slot no longer leaves the other stale. minus keeps a font
equal to the base's when its slots differ, so a font that clears the
base's slots still clears them when overlaid. latin_slot compares the
theme face without cloning it.

* craft-docx: theme fonts keep faces and scripts apart; limit only usable scripts

THEME_FONTS lines now say whether they hold a default face (a:ea, a:cs) or a
per-script font, so an a:font script="cs" is no longer written back as the
a:cs face. The 256-entry limit applies to usable per-script fonts only, so
empty default faces no longer push the last one out.

A test pins down Latin slots that name different faces: the model has one
Latin font, so only the slot that still names it is written.

* craft-docx: a long theme script id never pushes out one font resolution uses

The kept per-script fonts count script ids of 8 characters or fewer (the
ones font resolution takes) and longer ones (language tags such as
zh-Hant-TW) apart, 256 each, so a long one can't use up the place of a
mapping resolution keeps.

* craft-docx: THEME_FONTS names both per-script caps
2026-11-18 15:35:36 -05:00
Kevin JosephandNghiathan13 6242f65262 craft-docx: a table border without w:sz is width 0, and ODT and RTF keep it (#2203)
* craft-docx: a DOCX border without w:sz is an eighth of a point

* craft-docx: a table border without w:sz is width 0, and ODT and RTF keep it

A table, cell or table-style border without w:sz gives the same output in
Word as w:sz="0" and takes no room; read as half a point, rows below a
pandoc table's header rule moved down half a point. PropCtx::table_borders
now reads it as 0, as PropCtx::borders does since #1488.

ODT and RTF have no border that is drawn and takes no room, so a drawn
width-0 cell side is written at Border::THINNEST instead of being dropped.
Where two ODT cells share an edge, a line with a width wins over a width-0
one, whichever cell states it.

Table half of storytold/wordcraft#5764.

---------

Co-authored-by: Nghiathan13 <201675788+Nghiathan13@users.noreply.github.com>
2026-11-18 15:35:29 -05:00
ARCandARC 1846851756 fix(docx): a VML shape whose v:stroke is off or fully transparent has no outline (#2226)
The VML reader took a shape's outline from its stroked and strokecolor
attributes only, so a v:stroke child with on="f" or opacity="0" was
ignored and the shape got a black 0.75 pt outline. Google Docs writes
its horizontal rules this way (a 0.05 pt v:rect with a transparent
stroke): Word shows nothing, and after a save every rule became a
visible line.

Each stroke property (on, color, opacity, endcap) now resolves as Word
does: the shape's own v:stroke, then the shape's attribute (stroked,
strokecolor), then the same two on its shapetype. A fully transparent
line is kept as a shape without an outline, and freeforms take the
resolved opacity, inherited ones included. Opacity is read in all three
forms a file can use (0, 0% and 65536ths such as 0f).

Moved from storytold/wordcraft#3829, where it was reviewed, now that
the DOCX reader lives here.

Co-authored-by: ARC <261443955+arc-uri-el@users.noreply.github.com>
2026-11-18 15:35:22 -05:00
ARCandARC da69193a2f fix(docx): write and read a turned object's effect extent as Word does (#2227)
From 45° up to 135° and from 225° up to 315°, Word measures the room a
turned object's rotated bounds take against its frame with width and
height exchanged, so a quarter turn records no effect extent. craft-docx
measured it against the unturned frame, so saving a picture turned 90°
wrote half the difference between its sides as negative top and bottom
extents, which Word draws as a crop, and the text after it moves up.
Reading had the same mismatch the other way: a picture Word turned 60°
gained phantom effects room above and below.

Float::effect_spin_pad gives the overhang in Word's measure, choosing the
frame from the angle as it is saved (60000ths of a degree), so an angle
such as 44.999996° is measured as the 45° it is written as. The docx
reader and both writers use it; a bare turn (Float::is_bare_turn) still
records none, and layout keeps spin_pad and line_pad.

The test reads and saves a 254 x 337 pt picture with the extents Word
for Microsoft 365 (build 16.0.20527) writes at 60° and 90° and on both
sides of each boundary (44/45, 134/135, 224/225, 314/315), and reads the
saved file back. Two existing tests asserted the old values and now use
Word's.

Moved from storytold/wordcraft#3828, where it was reviewed, now that the
DOCX reader and writer live here.

Co-authored-by: ARC <261443955+arc-uri-el@users.noreply.github.com>
2026-11-18 15:35:16 -05:00
.CooCoo 95cd2c0eb7 Add craft-color-transform: RGB spaces, white balance, OkLab, tone curves and PQ tone mapping (#1995)
* Add craft-color-transform: RGB spaces, white balance, OkLab, tone curves and PQ tone mapping

craft-color-transform builds on craft-color. It holds RGB spaces from
primaries and a white point with Bradford adaptation, white balance by
correlated color temperature and tint, OkLab and OkLCh for any RGB space,
monotone tone curves and 1D lookup tables, and the BT.2408-8 Annex 5 EETF
with a maxRGB tone map. The per-pixel functions take f32 and do not
allocate, and the crate builds for wasm32-unknown-unknown.

Moved from StudioCraft's craft-color-transform
(blamejs/StudioCraft crates/craft-color-transform). The README names the
LightCraft and FilmCraft modules parts of it started from.

* Color transform: compose, interpolate and invert at extreme values

Lut1::compose samples the densest grid of at most MAX_LUT entries that holds both tables' points, so a short inner table, or one that crosses an outer peak between its own points, keeps the outer table's points to within one grid step. Lut1::eval weights the two entries in f64, so entries as far apart as -f32::MAX and f32::MAX no longer give NaN or infinity. MonotoneCurve::new compares the tangent pair's length with 3|d|, so a subnormal secant next to a normal one no longer gives a NaN tangent. Mat3::inverse divides the matrix by its largest entry before taking the determinant, so diag(1e110) and diag(1e-200) invert. OkLab::for_space falls back to XYZ_TO_LMS when a matrix has no inverse or an entry beyond f32.

* Color transform: build the matrix arithmetic on craft_cms::math

craft_cms::math gains the two hardened functions the color transforms
need, and craft-color-transform calls them instead of carrying its own
copies.

- math::inverse divides the matrix by its largest entry before taking
  the determinant, so a matrix whose own determinant overflows or
  underflows still inverts, and it returns None for NaN, infinite or
  all-zero input and for an inverse beyond f64. math::invert keeps its
  absolute 1e-12 floor, which profile construction uses to validate ICC
  matrices.
- math::bradford_checked returns None when a white's cone response is
  not finite or not above 0, or the ratios overflow. math::bradford
  still divides without the check.
- math::BRADFORD is public.
- Mat3::mul, apply, determinant and inverse, Xy::to_xyz, BRADFORD and
  bradford_xyz call craft_cms::math.
- oklab::lms_matrices gives OkLab::for_space's matrices in f64.

* Color transform: keep the EETF's black lift rising for a high target black

The BT.2408 Annex 5 lift minLum * (1 - E2)^4 has a slope of 1 - 4 minLum
at E2 = 0, so a target black above a quarter of the normalized range
made the output fall near black, and it raised the peak well above the
target peak.

The lift is now minLum * (1 - E2 / r)^k with r = max(T, min(1, 2 -
4 minLum)) and k = min(4, r / minLum), where T is the top of the output
(the smaller of maxLum and 1). It equals the Annex's lift up to minLum
0.25, keeps the output rising, changes continuously with the target
black, and from minLum 0.5 reaches 0 at the top of the output. A target
black above the source peak reads as the source peak.

* Color transform: state the composition bound for the fallback grid
2026-11-18 15:35:09 -05:00
Tex Jernigan db9e24391a craft-develop-model and craft-geom: develop settings and crs: import, from LightCraft (#1132)
* craft-geom and craft-develop-model: develop settings and crs: import, from LightCraft

craft-develop-model is lightcraft-develop (settings, controls, presets,
segmentation masks, process versions) plus the crs: import from
lightcraft-engine (crs.rs, crs_masks.rs). craft-geom is lightcraft-geom,
which the model and the coming develop pipeline both need. Step 3 of #587.

* craft-develop-model, craft-geom: review fixes to copy, presets, section reset and crs: import

Copy and presets: to_json_for_merge states every setting the stored JSON
leaves out at its default, so copying a group turns HDR, the camera's local
tone and Lens Blur's optional settings off on the target, and a preset at an
amount starts from them. A preset at no amount adds no mask, and its Lens
Blur focus mask follows its mask to the id the photo gives it.

Reset and range: reset_section resets the sliders of point colours and red
eyes, Upright with its guides, and the two Optics switches. Settings from
outside the app keep the list sliders in range. is_unedited counts a chosen
white balance as an edit.

crs: import: a brush dab that is not a finite number is dropped instead of
failing the whole packet, brush runs that differ in MaskInverted stay two
components, RetouchInfo is read only without RetouchAreas, and an XMP preset
keeps its masks. SegMask::from_logits does not overflow on an absurd side.

craft-geom: Homography::from_quads solves a mapping that sends the origin
to infinity, by solving again about the middle of the source quad.

Docs: the links to LightCraft's light-v3.md and grain.md point at that
repository, and xmp-interop.md says when the older fields are read. The
README lists what now differs from LightCraft.

* craft-develop-model, craft-geom: second round of review fixes to crs: import, mask grids, crop and quads

A range mask with a number that is not one failed the whole merge; a straight legacy ToneCurve and a
photo's switched-off masks or spots were left unsaid, so the photo kept what it had; a mask grid of a
side past the limit was cut to 32 bits; a crop restored under a new angle could reach outside the
photo; a quad mapping onto a collapsed quad solved to a matrix that does not map it.
2026-11-18 15:35:02 -05:00
mmazzieriandMauro Mazzieri 5bd7eb9e88 craft-rtf: read text boxes and drawing shapes from \shpinst (#2059)
Ported from storytold/wordcraft#6242 (issue storytold/wordcraft#6212), written before the RTF reader
moved here. Rectangles, ellipses, triangles, diamonds, block arrows and text boxes are read from
the shape's properties (position, size, wrap, fill, line, text); the \defshp picture Word writes
after a shape it read, also inside \shppict, is not imported as a second copy.

Co-authored-by: Mauro Mazzieri <mauro.mazzieri@talete.net>
2026-11-18 15:31:52 -05:00
.CooCoo a19d58c5f6 dds: read R16G16 as red and green, and open 16-bit textures at 16 bits (#2124)
R16G16_UNORM stores a red and a green channel
(https://learn.microsoft.com/en-us/windows/win32/api/dxgiformat/ne-dxgiformat-dxgi_format),
but craft-dds read it as gray and alpha, so a two-channel normal map
opened with its green channel as transparency. It now reads as RGB with
blue 0, as BC5 and G16R16 channel masks already do. encode16 still
writes two-channel 16-bit pixels as R16G16; they read back as red and
green.

craft-image-codecs decoded every DDS at 8 bits. Texture::bits_per_channel
gives the widest stored channel, and textures wider than 8 bits (R16,
R16G16, R16G16B16A16, legacy FourCC 36, and channel masks with a 10- or
16-bit field) now open as U16 through decode16. craft-raster-codecs'
decode_levels does the same for every mip level.
2026-11-18 15:31:45 -05:00
ljkx 68df8bf16c fix(rtf): list levels keep their number format, start and level text (#2085) (#2259)
The `doc` reader kept only "numbered or not" for each level of an RTF
list table and gave every list paragraph start 1 and no label, so every
numbered list read as 1., 2., 3.

Each `\listlevel` now keeps its number format (`\levelnfc`/`\levelnfcn`,
the MSONFC codes, as the Word 97 reader maps them), the number of its
first item (`\levelstartat`, held to Word's 0..=32767) and its
`\leveltext`, read in a destination of its own and bounded to 256
characters. A list paragraph's `ListInfo` gets the level's start and a
label from `Label::of_level` (placeholders 0 to 8 as %1 to %9; a bullet
level's character as its bullet). A level without level text keeps no
label, as before.
2026-11-18 15:30:54 -05:00