Add aspect-ratio composition band and RAW DNG sidecar capture

This commit is contained in:
2026-09-08 18:43:02 +07:00
parent a16c8734a8
commit d43405a4de
6 changed files with 371 additions and 65 deletions
+44 -2
View File
@@ -3,7 +3,7 @@ import { View, Text, TouchableOpacity, ScrollView } from 'react-native';
import Slider from '@react-native-community/slider';
import * as Haptics from 'expo-haptics';
import { Trash2 } from 'lucide-react-native';
import { Recipe, ColorAdjustments, FrameId } from '../types';
import { Recipe, ColorAdjustments, FrameId, AspectRatio } from '../types';
import { FRAMES } from '../utils/frameUtils';
// Compact bottom sheet above the tool rail:
@@ -12,7 +12,7 @@ import { FRAMES } from '../utils/frameUtils';
// Tapping a parameter chip toggles its slider row; chips stay visible.
// Darkroom-flavoured: amber = active/edited, red = destructive, mono labels.
type TabId = 'recipes' | 'iq' | 'wb' | 'filters' | 'frame';
type TabId = 'recipes' | 'iq' | 'wb' | 'filters' | 'frame' | 'ratio';
// Choice-group keys that open a strip above the chip row: color chrome groups
// (wb tab) and the D.RANGE selector (iq tab).
type GroupKey = 'cx' | 'cxb' | 'dr';
@@ -24,10 +24,16 @@ interface AdjustmentPanelProps {
adjustments: ColorAdjustments;
selectedFrame: FrameId;
useGeotag: boolean;
aspectRatio: AspectRatio;
rawEnabled: boolean;
// RAW (DNG sidecar) is only meaningful while the live camera is the source.
cameraMode: boolean;
onSelectRecipe: (recipe: Recipe) => void;
onUpdateAdjustments: (adjustments: Partial<ColorAdjustments>) => void;
onUpdateFrame: (frameId: FrameId) => void;
onToggleGeotag: (enabled: boolean) => void;
onAspectRatio: (ratio: AspectRatio) => void;
onRawEnabled: (enabled: boolean) => void;
onSaveRecipe: (name: string) => void;
onDeleteRecipe: (id: string) => void;
}
@@ -66,10 +72,15 @@ export default function AdjustmentPanel({
adjustments,
selectedFrame,
useGeotag,
aspectRatio,
rawEnabled,
cameraMode,
onSelectRecipe,
onUpdateAdjustments,
onUpdateFrame,
onToggleGeotag,
onAspectRatio,
onRawEnabled,
onDeleteRecipe,
}: AdjustmentPanelProps) {
// The single parameter whose slider row is open — a new selection replaces
@@ -188,6 +199,7 @@ export default function AdjustmentPanel({
{ key: 'grain', label: 'MONOCHROME GRAIN', value: a.grain, default: 0, min: 0, max: 10, step: 1, display: String, onChange: (v) => onUpdateAdjustments({ grain: v }) },
],
frame: [],
ratio: [],
};
const wbPresetOf = (): string => {
@@ -360,6 +372,36 @@ export default function AdjustmentPanel({
</ScrollView>
);
case 'ratio':
// Composition aspect (FULL = current fullscreen, 4:3 / 3:2 are the
// upright photo ratios) + RAW DNG sidecar toggle (camera captures
// only — dimmed in library mode where the shutter exports a still).
return (
<ScrollView
horizontal
showsHorizontalScrollIndicator={false}
contentContainerStyle={{ alignItems: 'center', paddingHorizontal: 8, paddingVertical: 8 }}
>
{renderChip({
key: 'raw',
label: rawEnabled ? 'RAW ON' : 'RAW OFF',
active: rawEnabled,
disabled: !cameraMode,
onPress: () => onRawEnabled(!rawEnabled),
})}
{choiceChips(
'ratio',
[
{ v: 'full', d: 'FULL' },
{ v: '4:3', d: '4:3' },
{ v: '3:2', d: '3:2' },
],
aspectRatio,
(v) => onAspectRatio(v as AspectRatio)
)}
</ScrollView>
);
default:
return null;
}