Apply a camera profile to every raw from the same camera body
A DCP matrix describes the sensor, so a profile chosen for one frame belongs to all camera-native raws from that body; the panel offers the bulk apply when the library holds more photos than the one on screen. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
import { subscribeClipPreview } from '../lib/clipPreview';
|
||||
import { get16BitSource, getBitmap, getDenoisedBitmap } from '../lib/images';
|
||||
import { rebuildProofCube, restoreProofProfile } from '../lib/softProof';
|
||||
import { photosForCamera } from '../lib/dcpLibrary';
|
||||
import type { Preview16 } from '../lib/preview16';
|
||||
import { useMediaQuery } from '../lib/useMediaQuery';
|
||||
import { usePersistentState } from '../lib/usePersistentState';
|
||||
@@ -271,6 +272,13 @@ export default function Develop({
|
||||
} | null>(null);
|
||||
|
||||
const edits = photo.edits;
|
||||
// A DCP matrix describes the sensor, so one profile can serve every raw from
|
||||
// the same body; the panel offers a bulk apply only when there is more than
|
||||
// this photo to update.
|
||||
const cameraProfileTargets = useMemo(
|
||||
() => photosForCamera(photos, photo.meta?.camera),
|
||||
[photos, photo.meta?.camera],
|
||||
);
|
||||
const activeLocal = (edits.local ?? []).find((layer) => layer.id === localSelected) ?? null;
|
||||
const zoomed = zoom.pct !== 'fit';
|
||||
|
||||
@@ -1555,6 +1563,29 @@ export default function Develop({
|
||||
photo={photo}
|
||||
set={setEdits}
|
||||
cameraNative={Boolean(hdrSource?.rgbCam)}
|
||||
cameraPhotoCount={cameraProfileTargets.length}
|
||||
onApplyToCamera={
|
||||
onUpdateEdits
|
||||
? (profile) => {
|
||||
const count = cameraProfileTargets.length;
|
||||
const camera = photo.meta?.camera || 'this camera';
|
||||
if (
|
||||
!window.confirm(
|
||||
`Apply “${profile.name}” to ${count} photos from ${camera}? ` +
|
||||
'This replaces any camera profile they already use.',
|
||||
)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
onUpdateEdits(
|
||||
cameraProfileTargets.map((target) => target.id),
|
||||
{ cameraProfile: profile },
|
||||
'Camera profile',
|
||||
);
|
||||
return true;
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
<ProofPanel
|
||||
edits={edits}
|
||||
|
||||
Reference in New Issue
Block a user