Expand description
Combine Images: several pictures laid out on one canvas and saved as a
new PNG. In Eagle this is a plugin (combine-images); this is falcon’s
own small version, not a copy of it.
plan is the layout maths: a row scales every picture to the tallest
one’s height, a column to the widest one’s width, and a grid fits each
inside one cell (the largest width by the largest height), centred. The
canvas is kept to MAX_SIDE and MAX_PIXELS: past them everything,
gaps included, is scaled down together.
stage does the work without touching the library, so it can run on
another thread: one picture is decoded at a time, in sRGB and turned by
its EXIF orientation (thumbnail::decode_for_display), an animation
gives its first frame, and the result is 8 bits per channel. The sources
are only read. The caller commits the Staged import.
Structs§
- Cell
- Where one picture goes on the canvas.
- Combined
- A finished combine, ready for
crate::Library::commit_import. - Options
- What the user chose.
- Plan
- A worked-out layout.
Enums§
- Layout
- How the pictures are arranged.
Constants§
- MAX_
PIXELS - The most pixels in a result: 400 MB in memory, which
image’s default 512 MB limit can still read back for the thumbnail and the viewer. - MAX_
SIDE - The longest side of a result. Past it the picture is scaled down.
Functions§
- can_
combine - Formats
stagecan read (lower-case, no dot): what theimagecrate decodes among falcon’s picture formats. SVG, RAW and QuickLook formats aren’t here. - compose
- Draws the pictures at
pathson one canvas.keep_goinghears of each one before it is read, and returning false stops withOk(None). - display_
size - A picture’s size as it will be shown, from its header alone: an EXIF quarter turn swaps the sides.
- plan
- Lays out pictures of these sizes (width, height), keeping the canvas
within
MAX_SIDEandMAX_PIXELS. Fails when there are no pictures, one has no pixels, or they can’t fit even at 1 px each. - stage
- Combines the pictures and stages the PNG for import with
import. Seecomposeforkeep_going; it also hears of the save, as steppaths.len().