1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-29 12:50:28 +00:00

Renames OutputType as DisplayType and promotes it to a scan target modal.

This commit is contained in:
Thomas Harte 2018-11-22 14:36:46 -05:00
parent bfe9704829
commit 396cf72029
4 changed files with 11 additions and 8 deletions

View File

@ -147,7 +147,7 @@ void ScanTarget::set_modals(Modals modals) {
processing_width_ = std::min(processing_width_, 2048); processing_width_ = std::min(processing_width_, 2048);
// Establish an input shader. // Establish an input shader.
input_shader_ = input_shader(modals_.input_data_type, OutputType::RGB); input_shader_ = input_shader(modals_.input_data_type, modals_.display_type);
glBindVertexArray(scan_vertex_array_); glBindVertexArray(scan_vertex_array_);
glBindBuffer(GL_ARRAY_BUFFER, scan_buffer_name_); glBindBuffer(GL_ARRAY_BUFFER, scan_buffer_name_);

View File

@ -171,7 +171,7 @@ class ScanTarget: public Outputs::Display::ScanTarget {
std::unique_ptr<Shader> input_shader_; std::unique_ptr<Shader> input_shader_;
std::unique_ptr<Shader> output_shader_; std::unique_ptr<Shader> output_shader_;
static std::unique_ptr<Shader> input_shader(InputDataType input_data_type, OutputType output_type); static std::unique_ptr<Shader> input_shader(InputDataType input_data_type, DisplayType display_type);
}; };
} }

View File

@ -150,7 +150,7 @@ void ScanTarget::enable_vertex_attributes(ShaderType type, Shader &target) {
} }
} }
std::unique_ptr<Shader> ScanTarget::input_shader(InputDataType input_data_type, OutputType output_type) { std::unique_ptr<Shader> ScanTarget::input_shader(InputDataType input_data_type, DisplayType display_type) {
std::string fragment_shader = std::string fragment_shader =
"#version 150\n" "#version 150\n"
@ -163,8 +163,8 @@ std::unique_ptr<Shader> ScanTarget::input_shader(InputDataType input_data_type,
"uniform usampler2D textureName;" "uniform usampler2D textureName;"
"void main(void) {"; "void main(void) {";
switch(output_type) { switch(display_type) {
case OutputType::RGB: case DisplayType::RGB:
fragment_shader += "fragColour = vec4(texture(textureName, textureCoordinate).rrr, 1.0);"; fragment_shader += "fragColour = vec4(texture(textureName, textureCoordinate).rrr, 1.0);";
break; break;
default: default:
@ -188,7 +188,7 @@ std::unique_ptr<Shader> ScanTarget::input_shader(InputDataType input_data_type,
// "uniform sampler2D textureName;" // "uniform sampler2D textureName;"
// "void main(void) {"; // "void main(void) {";
// //
// switch(output_type) { // switch(display_type) {
// default: return nullptr; // default: return nullptr;
// //
// case OutputType::SVideo: // case OutputType::SVideo:

View File

@ -48,7 +48,7 @@ enum class ColourSpace {
YUV YUV
}; };
enum class OutputType { enum class DisplayType {
RGB, RGB,
SVideo, SVideo,
CompositeColour, CompositeColour,
@ -123,6 +123,9 @@ struct ScanTarget {
/// Describes the format of input data. /// Describes the format of input data.
InputDataType input_data_type; InputDataType input_data_type;
/// Describes the type of display that the data is being shown on.
DisplayType display_type = DisplayType::RGB;
/// If being fed composite data, this defines the colour space in use. /// If being fed composite data, this defines the colour space in use.
ColourSpace composite_colour_space; ColourSpace composite_colour_space;
@ -148,7 +151,7 @@ struct ScanTarget {
Rect visible_area; Rect visible_area;
/// Describes the usual gamma of the output device these scans would appear on. /// Describes the usual gamma of the output device these scans would appear on.
float intended_gamma; float intended_gamma = 2.2f;
/// Specifies the range of values that will be output for x and y coordinates. /// Specifies the range of values that will be output for x and y coordinates.
struct { struct {