diff --git a/apps/api/src/autopilot/cropBias.ts b/apps/api/src/autopilot/cropBias.ts new file mode 100644 index 0000000..49a9876 --- /dev/null +++ b/apps/api/src/autopilot/cropBias.ts @@ -0,0 +1,20 @@ +import type { Box } from "../composition/compose.js"; + +/** Soft crop after folding develop commands (autopilot or human). */ +export interface FoldedCrop { + rect: Box; + angle: number; +} + +/** + * Soft crop geometry of a correction: final minus autopilot (centre shift, size, straighten). + * Kept out of `learning.ts` so the desktop app can typecheck `planFrame` without Prisma. + */ +export interface CropBias { + dx: number; + dy: number; + /** Linear size: 1 = same area, >1 looser, <1 tighter. */ + scale: number; + dAngle: number; + scene: "ball" | "group" | "person" | null; +} diff --git a/apps/api/src/autopilot/learning.ts b/apps/api/src/autopilot/learning.ts index 116c8c1..0cdd6ae 100644 --- a/apps/api/src/autopilot/learning.ts +++ b/apps/api/src/autopilot/learning.ts @@ -1,8 +1,10 @@ import type { EditCommand } from "@photoreport/contracts"; import type { Db } from "../db.js"; import type { Box } from "../composition/compose.js"; +import type { CropBias, FoldedCrop } from "./cropBias.js"; import { TONE_KEYS, WB_KEYS } from "./look.js"; +export type { CropBias, FoldedCrop } from "./cropBias.js"; export { TONE_KEYS, WB_KEYS }; /** @@ -40,26 +42,11 @@ const CROP_SCENE = "__crop.scene"; const SCENE_CODE: Record<"ball" | "group" | "person", number> = { ball: 1, group: 2, person: 3 }; const SCENE_FROM: Record = { 1: "ball", 2: "group", 3: "person" }; -export interface FoldedCrop { - rect: Box; - angle: number; -} - export interface FoldedEdits { values: Record; crop: FoldedCrop | null; } -/** Soft crop geometry of a correction: final minus autopilot (centre shift, size, straighten). */ -export interface CropBias { - dx: number; - dy: number; - /** Linear size: 1 = same area, >1 looser, <1 tighter. */ - scale: number; - dAngle: number; - scene: "ball" | "group" | "person" | null; -} - /** Settings after these commands, as far as the autopilot's controls go (merges of whole presets are ignored). */ export function fold(commands: EditCommand[]): FoldedEdits { let values: Record = {}; diff --git a/apps/api/src/composition/planFrame.ts b/apps/api/src/composition/planFrame.ts index 35637b3..3af1f7c 100644 --- a/apps/api/src/composition/planFrame.ts +++ b/apps/api/src/composition/planFrame.ts @@ -2,7 +2,7 @@ import type { EditCommand } from "@photoreport/contracts"; import { type Box, type Detections, type FocusHint, clipsBall, compose, minCropWidth, planCrop } from "./compose.js"; import { biasCrop, constrainRotated, tighter } from "./geometry.js"; import { type Look, WB_KEYS, TONE_KEYS, detailForCrop, lookValues, toneApplied } from "../autopilot/look.js"; -import type { CropBias } from "../autopilot/learning.js"; +import type { CropBias } from "../autopilot/cropBias.js"; /** Straightening beyond this is more likely a creative tilt than a crooked horizon (matches the engine's band). */ const MAX_LEVEL = 8; diff --git a/apps/desktop/package.json b/apps/desktop/package.json index 506c4b4..9f4dc50 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -1,6 +1,6 @@ { "name": "@photoreport/desktop", - "version": "0.3.28", + "version": "0.3.29", "private": true, "type": "module", "scripts": { diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml index 3a3e44c..7d4a6f8 100644 --- a/apps/desktop/src-tauri/Cargo.toml +++ b/apps/desktop/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "photoreport-desktop" -version = "0.3.28" +version = "0.3.29" edition = "2024" publish = false description = "PhotoReport desktop: the web app in a native shell, with keychain sign-in and (later) local FTP and the native engine." diff --git a/apps/desktop/src-tauri/tauri.conf.json b/apps/desktop/src-tauri/tauri.conf.json index ad40402..b43d157 100644 --- a/apps/desktop/src-tauri/tauri.conf.json +++ b/apps/desktop/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "PhotoReport", - "version": "0.3.28", + "version": "0.3.29", "identifier": "pt.photoreport.desktop", "build": { "devUrl": "http://localhost:5173",