import { Activity, BarChart3, CircleDot, Settings } from "lucide-react" import { useCallback, useState } from "react" import { useTranslation } from "react-i18next" import { Button } from "@/components/ui/button" import { Label } from "@/components/ui/label" import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" import { Switch } from "@/components/ui/switch" import { useColorGrading } from "../../services/color-grading-provider" import { ScopeViewer } from "./scope-viewer" type ScopeType = "waveform" | "vectorscope" | "histogram" export function ScopesSection() { const { t } = useTranslation() const { state, dispatch } = useColorGrading() const [activeScope, setActiveScope] = useState("waveform") const [isFullscreen, setIsFullscreen] = useState(false) // Обработчик переключения типа скопа const handleScopeChange = useCallback((scopeType: ScopeType) => { setActiveScope(scopeType) }, []) // Обработчик частоты обновления const handleRefreshRateChange = useCallback( (value: string) => { dispatch({ type: "SET_SCOPE_REFRESH_RATE", value: Number(value), }) }, [dispatch], ) // Обработчик переключения скопов const handleToggleScope = useCallback( (scopeType: ScopeType, enabled: boolean) => { dispatch({ type: "TOGGLE_SCOPE", scopeType, enabled, }) }, [dispatch], ) // Переключение полноэкранного режима const toggleFullscreen = useCallback(() => { setIsFullscreen(!isFullscreen) }, [isFullscreen]) return (
{/* Заголовок секции */}
{t("colorGrading.scopes.description", "Real-time analysis of color and exposure")}
{/* Управление скопами */}
{/* Waveform переключатель */}
handleToggleScope("waveform", checked)} />
{/* Vectorscope переключатель */}
handleToggleScope("vectorscope", checked)} />
{/* Histogram переключатель */}
handleToggleScope("histogram", checked)} />
{/* Настройки частоты обновления */}
{/* Отображение скопов */} {(state.scopes.waveformEnabled || state.scopes.vectorscopeEnabled || state.scopes.histogramEnabled) && (
{/* Переключатель типов скопов */}
{state.scopes.waveformEnabled && ( )} {state.scopes.vectorscopeEnabled && ( )} {state.scopes.histogramEnabled && ( )}
{/* Viewer для активного скопа */}
{/* Подсказки для скопов */}
{activeScope === "waveform" && t("colorGrading.scopes.waveformHint", "Shows luminance distribution across the image")} {activeScope === "vectorscope" && t("colorGrading.scopes.vectorscopeHint", "Shows color saturation and hue distribution")} {activeScope === "histogram" && t("colorGrading.scopes.histogramHint", "Shows tonal distribution for RGB channels")}
)}
) }