mirror of
https://github.com/TomHarte/CLK.git
synced 2026-03-15 17:16:33 +00:00
87 lines
2.0 KiB
C++
87 lines
2.0 KiB
C++
//
|
|
// KernelShaders.hpp
|
|
// Clock Signal Kiosk
|
|
//
|
|
// Created by Thomas Harte on 03/02/2026.
|
|
// Copyright © 2026 Thomas Harte. All rights reserved.
|
|
//
|
|
|
|
#pragma once
|
|
|
|
#include "Outputs/ScanTarget.hpp"
|
|
#include "Outputs/OpenGL/Primitives/VertexArray.hpp"
|
|
#include "Outputs/OpenGL/Primitives/Shader.hpp"
|
|
|
|
namespace Outputs::Display::OpenGL {
|
|
|
|
/*!
|
|
Takes input in composite form, i.e.
|
|
|
|
(luma, cos(phase), sin(phase), chroma amplitude)
|
|
|
|
Applies the relevant filter as provided by an instance of Outputs::Display::Filtergenerator to output in S-Video form, i.e.
|
|
|
|
(luma, chroma * cos(phase), luma * sin(phase), 1)
|
|
|
|
Works only in terms of whole lines and uses instances of `DirtyZone` as input to indicate the regions that
|
|
need to be translated. Both source and destination buffers are taken to be the same size.
|
|
*/
|
|
Shader separation_shader(
|
|
API,
|
|
float per_line_subcarrier_frequency,
|
|
int samples_per_line,
|
|
int buffer_width,
|
|
int buffer_height,
|
|
const VertexArray &,
|
|
GLenum source_texture_unit
|
|
);
|
|
|
|
/*!
|
|
Takes input in S-Video form, i.e.
|
|
|
|
(luma, chroma * cos(phase), luma * sin(phase), 1)
|
|
|
|
Applies the relevant filter as provided by an instance of Outputs::Display::Filtergenerator to output in RGB form.
|
|
|
|
Works only in terms of whole lines and uses instances of `DirtyZone` as input to indicate the regions that
|
|
need to be translated. Both source and destination buffers are taken to be the same size.
|
|
|
|
*/
|
|
Shader demodulation_shader(
|
|
API,
|
|
ColourSpace,
|
|
DisplayType,
|
|
float per_line_subcarrier_frequency,
|
|
int samples_per_line,
|
|
int buffer_width,
|
|
int buffer_height,
|
|
const VertexArray &,
|
|
GLenum source_texture_unit
|
|
);
|
|
|
|
/*!
|
|
Fills a set of dirty rects with a fixed colour, supplied each time the shader is bound.
|
|
*/
|
|
class FillShader {
|
|
public:
|
|
FillShader(
|
|
API,
|
|
int samples_per_line,
|
|
int buffer_width,
|
|
int buffer_height,
|
|
const VertexArray &
|
|
);
|
|
FillShader() = default;
|
|
|
|
void bind(float r, float g, float b, float a);
|
|
|
|
bool empty() const { return shader_.empty(); }
|
|
void reset() { shader_.reset(); }
|
|
|
|
private:
|
|
Shader shader_;
|
|
float colour_[4]{};
|
|
};
|
|
|
|
}
|