/** * 图像处理风格预设配置 * 风格只定义参数组合,不包含 LUT 和算法 */ import type { ProcessingStyle, ProcessingPreset, ParameterConfig } from '../types/imageProcessing'; // 风格预设配置(只包含参数) export const PROCESSING_PRESETS: Record = { '均衡': { style: '均衡', params: { contrast: 5.0, // 增益 detail: 9.0, // 细节 latitude: 25.0, // 动态范围 noise: 12.0, // 噪声模式 brightness: -2.0, // 对比度(前端维护) sharpness: 1.0, // 亮度(前端维护) }, }, '高对比': { style: '高对比', params: { contrast: 7.0, detail: 8.0, latitude: 20.0, noise: 10.0, brightness: 0.0, sharpness: 2.0, }, }, '锐组织': { style: '锐组织', params: { contrast: 6.0, detail: 12.0, latitude: 22.0, noise: 8.0, brightness: -1.0, sharpness: 3.0, }, }, '骨骼': { style: '骨骼', params: { contrast: 8.0, detail: 6.0, latitude: 18.0, noise: 15.0, brightness: 1.0, sharpness: 0.5, }, }, }; // 参数范围配置(根据需求文档) export const PARAMETER_RANGES: ParameterConfig = { gain: { min: -5, max: 45, step: 1, default: 5.0, }, detail: { min: -0.5, max: 24.5, step: 1, default: 9.0, }, latitude: { min: -5, max: 20, step: 1, default: 25.0, }, noise: { min: 0, max: 20, step: 1, default: 12.0, }, brightness: { min: -8, max: 8, step: 1, default: -2.0, }, sharpness: { min: -8, max: 8, step: 1, default: 1.0, }, }; // 算法选项(当前只有一个) export const ALGORITHM_OPTIONS = ['RSymphony']; export const DEFAULT_ALGORITHM = 'RSymphony'; // 预留扩展:从后端获取风格配置的适配器接口 export interface PresetAdapter { fetchPresets: () => Promise>; } // 预留扩展:从后端获取算法列表的适配器接口 export interface AlgorithmAdapter { fetchAlgorithmOptions: () => Promise; } // 默认适配器实现(使用本地配置) export class LocalPresetAdapter implements PresetAdapter { async fetchPresets(): Promise> { return Promise.resolve(PROCESSING_PRESETS); } } export class LocalAlgorithmAdapter implements AlgorithmAdapter { async fetchAlgorithmOptions(): Promise { return Promise.resolve(ALGORITHM_OPTIONS); } }