Initial commit: Luminary photo catalog and RAW editor
Browser-based photo catalog with an optional team server (SQLite + LibRaw). Local database, uploaded photos, build output and dependencies are gitignored. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
+323
@@ -0,0 +1,323 @@
|
||||
export type ViewMode = 'grid' | 'develop';
|
||||
export type Flag = 'none' | 'pick' | 'reject';
|
||||
export type ColorLabel = '' | 'red' | 'yellow' | 'green' | 'blue' | 'purple';
|
||||
/** Contrast filter placed over the lens when shooting black & white film. */
|
||||
export type BwFilter = 'none' | 'yellow' | 'orange' | 'red' | 'green' | 'blue';
|
||||
export type CurveChannel = 'rgb' | 'red' | 'green' | 'blue';
|
||||
|
||||
export interface CurvePoint {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
export interface CropState {
|
||||
/** normalized crop rect inside the straightened frame, origin top-left */
|
||||
x: number;
|
||||
y: number;
|
||||
w: number;
|
||||
h: number;
|
||||
/** straighten angle in degrees */
|
||||
angle: number;
|
||||
/** extra 90° turns applied before the straighten angle, 0–3 */
|
||||
quarter: number;
|
||||
/** locked aspect preset id, "free" or "original" */
|
||||
aspect: string;
|
||||
flipH: boolean;
|
||||
flipV: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* One spot-heal patch. Coordinates are normalized source-image uv (y down),
|
||||
* r is a fraction of the source width, and sx/sy mark the area sampled to cover
|
||||
* the spot.
|
||||
*/
|
||||
export interface HealSpot {
|
||||
x: number;
|
||||
y: number;
|
||||
r: number;
|
||||
/** edge softness 0–100 */
|
||||
feather: number;
|
||||
sx: number;
|
||||
sy: number;
|
||||
}
|
||||
|
||||
export type LocalMaskKind = 'brush' | 'linear' | 'radial' | 'raster';
|
||||
|
||||
/** A generated, low-resolution raster mask (auto subject / sky / background). */
|
||||
export interface RasterMask {
|
||||
/** base64-encoded 8-bit coverage, width × height */
|
||||
data: string;
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
|
||||
export interface LocalPoint {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
export interface LocalStroke {
|
||||
points: LocalPoint[];
|
||||
/** brush radius as a fraction of the source width */
|
||||
size: number;
|
||||
erase?: boolean;
|
||||
}
|
||||
|
||||
/** One non-destructive local adjustment layer. Mask geometry is in source uv. */
|
||||
export interface LocalLayer {
|
||||
id: string;
|
||||
name: string;
|
||||
kind: LocalMaskKind;
|
||||
inverted: boolean;
|
||||
/** softness of the mask edge, 0–100 */
|
||||
feather: number;
|
||||
brush: { strokes: LocalStroke[] };
|
||||
linear: { x1: number; y1: number; x2: number; y2: number };
|
||||
radial: { cx: number; cy: number; rx: number; ry: number };
|
||||
raster?: RasterMask;
|
||||
/** luminance and colour limits applied on top of the shape */
|
||||
range: {
|
||||
enabled: boolean;
|
||||
lumaMin: number;
|
||||
lumaMax: number;
|
||||
hue: number;
|
||||
hueRange: number;
|
||||
satMin: number;
|
||||
};
|
||||
adjust: {
|
||||
exposure: number;
|
||||
contrast: number;
|
||||
highlights: number;
|
||||
shadows: number;
|
||||
temp: number;
|
||||
tint: number;
|
||||
saturation: number;
|
||||
};
|
||||
}
|
||||
|
||||
/** Manual perspective and lens corrections. */
|
||||
export interface LensCorrections {
|
||||
distortion: boolean;
|
||||
tca: boolean;
|
||||
vignetting: boolean;
|
||||
}
|
||||
|
||||
export interface LensProfile {
|
||||
/** Lensfun maker/model and the sensor crop used for calibration. */
|
||||
maker: string;
|
||||
model: string;
|
||||
crop: number;
|
||||
cameraMaker?: string;
|
||||
cameraModel?: string;
|
||||
corrections: LensCorrections;
|
||||
distance?: number;
|
||||
}
|
||||
|
||||
export interface GeometryEdits {
|
||||
/** barrel/pincushion, -100–100 */
|
||||
distortion: number;
|
||||
/** vertical keystone, -100–100 */
|
||||
vertical: number;
|
||||
/** horizontal keystone, -100–100 */
|
||||
horizontal: number;
|
||||
/** fine rotation in degrees, -15–15 */
|
||||
rotate: number;
|
||||
/** scale in percent, 50–200; hides transformed edges */
|
||||
scale: number;
|
||||
}
|
||||
|
||||
export interface Edits {
|
||||
temp: number;
|
||||
tint: number;
|
||||
exposure: number;
|
||||
/** pulls clipped highlights back into range without shifting hue */
|
||||
recovery: number;
|
||||
contrast: number;
|
||||
highlights: number;
|
||||
shadows: number;
|
||||
whites: number;
|
||||
blacks: number;
|
||||
texture: number;
|
||||
clarity: number;
|
||||
dehaze: number;
|
||||
vibrance: number;
|
||||
saturation: number;
|
||||
bw: boolean;
|
||||
/** colored filter simulated in black & white mode */
|
||||
bwFilter: BwFilter;
|
||||
/** how strongly that filter acts, 0–100 */
|
||||
bwFilterAmount: number;
|
||||
curve: Record<CurveChannel, CurvePoint[]>;
|
||||
/** region tone shaping applied on top of the point curve */
|
||||
parametric: { highlights: number; lights: number; darks: number; blacks: number };
|
||||
hsl: { hue: number[]; sat: number[]; lum: number[] };
|
||||
grading: {
|
||||
shadows: { h: number; s: number };
|
||||
highlights: { h: number; s: number };
|
||||
balance: number;
|
||||
};
|
||||
/** lensSoftness compensates for edge softness, 0–100 */
|
||||
sharpen: { amount: number; radius: number; detail: number; mask: number; lensSoftness: number };
|
||||
/** paper/output simulation for soft proofing */
|
||||
proof: { enabled: boolean; paper: 'matte' | 'gloss' | 'newsprint'; blackPoint: number; gamut: boolean };
|
||||
/** chroma is the colour-noise amount; chromaDetail trades smoothing for fine colour */
|
||||
noise: { luminance: number; detail: number; chroma: number; chromaDetail: number };
|
||||
/**
|
||||
* Server-rendered, detail-preserving denoise. `key` is the parameter hash of a
|
||||
* generated asset and is null until one exists; `amount` blends it over the
|
||||
* source. Separate from `noise`, which is a small GPU-side filter.
|
||||
*/
|
||||
aiDenoise: { amount: number; key: string | null; model: string };
|
||||
/** fringe removal amounts for the two casts lens CA produces */
|
||||
defringe: { purple: number; green: number };
|
||||
/** spot healing, applied to the source before grading */
|
||||
heal: HealSpot[];
|
||||
/** local adjustment layers, composited after the global grade */
|
||||
local: LocalLayer[];
|
||||
/** lens distortion and perspective correction, applied while sampling */
|
||||
geometry: GeometryEdits;
|
||||
/** optional Lensfun calibration profile; focal/aperture come from the photo */
|
||||
lens?: LensProfile;
|
||||
vignette: { amount: number; midpoint: number; feather: number };
|
||||
/** roughness leans from creamy clumps (0) to crisp per-pixel bite (100) */
|
||||
grain: { amount: number; size: number; roughness: number };
|
||||
crop: CropState;
|
||||
}
|
||||
|
||||
export interface PhotoMeta {
|
||||
camera?: string;
|
||||
lens?: string;
|
||||
iso?: number;
|
||||
aperture?: number;
|
||||
shutter?: string;
|
||||
focal?: number;
|
||||
}
|
||||
|
||||
export interface HistoryEntry {
|
||||
label: string;
|
||||
ts: number;
|
||||
edits: Edits;
|
||||
}
|
||||
|
||||
export interface Snapshot {
|
||||
id: string;
|
||||
name: string;
|
||||
ts: number;
|
||||
edits: Edits;
|
||||
}
|
||||
|
||||
export interface MetadataPreset {
|
||||
id: string;
|
||||
name: string;
|
||||
creator?: string;
|
||||
copyright?: string;
|
||||
keywords: string[];
|
||||
}
|
||||
|
||||
export interface SmartCollection {
|
||||
id: string;
|
||||
name: string;
|
||||
filters: Filters;
|
||||
eventId?: string;
|
||||
sort: SortKey;
|
||||
asc: boolean;
|
||||
}
|
||||
|
||||
export interface MergeInfo {
|
||||
kind: 'hdr' | 'panorama' | 'focus';
|
||||
sourceIds: string[];
|
||||
}
|
||||
|
||||
export interface PhotoRecord {
|
||||
id: string;
|
||||
eventId: string;
|
||||
/** manual sort position inside the event */
|
||||
order?: number;
|
||||
name: string;
|
||||
width: number;
|
||||
height: number;
|
||||
size: number;
|
||||
mime: string;
|
||||
addedAt: number;
|
||||
takenAt?: number;
|
||||
meta: PhotoMeta;
|
||||
thumb: string;
|
||||
rating: number;
|
||||
/** set when the photo sits in the trash; cleared on restore */
|
||||
deletedAt?: number;
|
||||
flag: Flag;
|
||||
color: ColorLabel;
|
||||
keywords: string[];
|
||||
title?: string;
|
||||
caption?: string;
|
||||
creator?: string;
|
||||
copyright?: string;
|
||||
/** virtual copies point at the master but keep their own edits */
|
||||
copyOf?: string;
|
||||
copyName?: string;
|
||||
snapshots?: Snapshot[];
|
||||
/** set on files generated by HDR / panorama / focus merge */
|
||||
merge?: MergeInfo;
|
||||
edits: Edits;
|
||||
history: HistoryEntry[];
|
||||
/** true when the original is a camera raw decoded by the server */
|
||||
raw?: boolean;
|
||||
/** how the editable proxy was produced */
|
||||
decode?: 'libraw' | 'embedded';
|
||||
/** server URL for the editable proxy (raw only) */
|
||||
previewUrl?: string;
|
||||
/** server URL for the grid thumbnail */
|
||||
thumbUrl?: string;
|
||||
/** timestamp of the last rendered client proof published to the server */
|
||||
proofAt?: number;
|
||||
/** Account this cached record belongs to (server workspaces). */
|
||||
workspace?: string;
|
||||
/** Set when the photo is proxied from a dashboard bridge session. */
|
||||
bridgeSource?: { sessionId: string; sourceId: string };
|
||||
/** Photos sharing a stack id collapse to their lowest-index member. */
|
||||
stackId?: string;
|
||||
stackIndex?: number;
|
||||
}
|
||||
|
||||
export interface EventRecord {
|
||||
id: string;
|
||||
name: string;
|
||||
date?: number;
|
||||
createdAt: number;
|
||||
notes?: string;
|
||||
/** sidebar position */
|
||||
order?: number;
|
||||
/** Account this cached record belongs to (server workspaces). */
|
||||
workspace?: string;
|
||||
/** Set when this event is a temporary import from the dashboard bridge. */
|
||||
bridge?: {
|
||||
sessionId: string;
|
||||
sourceEventId: string;
|
||||
/** Where "Back to dashboard" goes. */
|
||||
dashboardUrl: string;
|
||||
expiresAt: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface Filters {
|
||||
minRating: number;
|
||||
flag: Flag | 'any';
|
||||
colors: ColorLabel[];
|
||||
text: string;
|
||||
editedOnly: boolean;
|
||||
unrated: boolean;
|
||||
/** only photos picked by a client in a proofing gallery */
|
||||
proofed: boolean;
|
||||
/** client approval state from the proofing gallery */
|
||||
clientStatus: 'any' | 'approved' | 'changes';
|
||||
}
|
||||
|
||||
export type SortKey = 'taken' | 'added' | 'name' | 'rating' | 'custom';
|
||||
|
||||
export interface Preset {
|
||||
id: string;
|
||||
name: string;
|
||||
group: string;
|
||||
edits: Partial<Omit<Edits, 'crop'>>;
|
||||
custom?: boolean;
|
||||
}
|
||||
Reference in New Issue
Block a user