Files
craft-libs/crates/imaging
aiongg 613b6a82c1 Story canvas: stories draw their old content through StoryPicture
StoryPicture is a story picture whose pixels are a function of the document point, and StoryShape
fills and outlines shapes on it; show_quad takes any picture. The stories show what the old gallery
drew under their control again:
- CropOverlay: the crop tool's landscape under ratio_held, straighten_armed (horizon at 6 degrees)
  and image_mode.
- GradientOverlay: the gradient itself in 64 x 40 cells, on the old line with the old four stops.
- HoverOutline: the light picture with the hovered object in the accent.
- ConnectorHandles, CornerWidgets, RulerOverlay, TransformOverlay: the boxes, rounded shapes,
  measured object and transformed layer in the accent.
- TransformBox and PerspectiveCropQuad: the layer and page with their dark grey edge.
- ColorSamplerMarks: the hue and brightness picture the samplers sit on.
- WideAngleWorkspace and ConstraintLines: the generated picture in place of flat grey.
SmartGuides, RasterDisplay and PixelGrid stories draw their pictures through StoryPicture;
FlatPicture is gone.
2026-11-12 14:32:39 +00:00
..

craft-imaging

Raster image editing for Craft apps.

Without egui, on every target: craft_imaging::scopes (the clipping rule and clipping masks, the vectorscope grid, hue and saturation, and histogram statistics; the app does the colour management and the histogram count), selection (selection preview and Quick Mask rules), trace (mask outline tracing) and layer_style (the Layer Style value model).

With the ui feature, craft_imaging::ui has:

  • the WarpGrid (a warp's mesh on a canvas, with WarpMesh, WarpEdit and the press and release helpers), the WarpFields of its options bar, PinWarp with PinWarpBar, and PerspectiveWarp with PerspectiveBar; TransformPreview shows a transform or warp in progress;
  • the LevelsEditor (a channel's Levels over its histogram) and the editors of the other adjustments: curves (CurvesPanel), brightness and contrast, color balance, hue and saturation, black and white, channel mixer, selective color, photo filter and threshold, over an AdjustSession; LivePreview renders them on a proxy of the image; BlendKeys picks a blend mode from the keyboard;
  • the LayerStyleDialog with the BlendIfBar and the ContourField;
  • the selection tools (MarqueeTool, LassoTool, PolygonLassoTool, MagneticLassoTool), the SelectionOverlay (ants, matte, Quick Mask) and the MaskViewControls;
  • the full-window editors, each a workspace over a session, panel and options bar: SelectMaskWorkspace, ContentAwareFillWorkspace, FilterGalleryWorkspace, LiquifyWorkspace, WideAngleWorkspace and VanishingPointWorkspace (settings in VanishingPointSettings and StampSettings); the limits an app passes to Select and Mask and Content-Aware Fill are SelectMaskLimits and FillLimits, and a refused edit is a LimitRefused or a FillLimit; BlurPinsOverlay and BlurPinsPanel edit blur pins on the canvas;
  • the ChannelsPanel (thumbnails, eyes, selection, rename in place with start_rename, drag, the footer (ChannelsEvent::Footer and FooterDrop) and the menus over plain ChannelRows; ChannelsPanel::style(&UiTokens) gives the look);
  • the ScopePanel (histogram, statistics, tone zones and vectorscope) and the ClippingOverlay for a preview;
  • their stories, registered in craft_ui::testing::stories().

The main types of every module are re-exported at craft_imaging::ui. The panels and editors report what the user did as events and hold no document. Thumbnails load as jobs on craft_host::queue::JobQueue.

The curves editor and the histogram stay in craft-ui.