summaryrefslogtreecommitdiff
path: root/src/effects/ntsc_effect.h
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-03-10 20:42:32 +0100
committerskal <pascal.massimino@gmail.com>2026-03-10 20:42:32 +0100
commit3547424b8c5f3884f84d16fb3f08b47965d62428 (patch)
tree18cfcc23fad133a9cf2e84ba4fb77b1d5826ff8a /src/effects/ntsc_effect.h
parent7ca40818e3d0401f97efae6fe876038df4f5bd00 (diff)
ntsc: factor common code into snippet; add RGB and YIQ input variants
- Extract shared NTSC logic into render/ntsc_common.wgsl snippet - sample_ntsc_signal() hook decouples input format from processing - ntsc_rgb.wgsl: RGB input (converts via rgba_to_luma_chroma_phase) - ntsc_yiq.wgsl: YIQ passthrough for RotatingCube output - Add NtscYiq WgslEffect thin wrapper; register both in tests handoff(Claude): NTSC refactor complete; NtscYiq ready for timeline use with RotatingCube. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'src/effects/ntsc_effect.h')
-rw-r--r--src/effects/ntsc_effect.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/effects/ntsc_effect.h b/src/effects/ntsc_effect.h
index d8624ea..4737291 100644
--- a/src/effects/ntsc_effect.h
+++ b/src/effects/ntsc_effect.h
@@ -1,12 +1,22 @@
-// NTSC post-process effect with fisheye distortion
+// NTSC post-process effects: RGB and YIQ input variants.
#pragma once
#include "effects/shaders.h"
#include "gpu/wgsl_effect.h"
+// RGB input: converts RGB → YIQ internally (standard post-process use).
struct Ntsc : public WgslEffect {
Ntsc(const GpuContext& ctx, const std::vector<std::string>& inputs,
const std::vector<std::string>& outputs, float start_time,
float end_time)
: WgslEffect(ctx, inputs, outputs, start_time, end_time,
- ntsc_shader_wgsl) {}
+ ntsc_rgb_shader_wgsl) {}
+};
+
+// YIQ input: input texture already stores luma/chroma/phase (e.g. RotatingCube output).
+struct NtscYiq : public WgslEffect {
+ NtscYiq(const GpuContext& ctx, const std::vector<std::string>& inputs,
+ const std::vector<std::string>& outputs, float start_time,
+ float end_time)
+ : WgslEffect(ctx, inputs, outputs, start_time, end_time,
+ ntsc_yiq_shader_wgsl) {}
};