mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-26 08:49:37 +00:00
Renames OutputType
as DisplayType
and promotes it to a scan target modal.
This commit is contained in:
parent
bfe9704829
commit
396cf72029
@ -147,7 +147,7 @@ void ScanTarget::set_modals(Modals modals) {
|
||||
processing_width_ = std::min(processing_width_, 2048);
|
||||
|
||||
// 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_);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, scan_buffer_name_);
|
||||
|
@ -171,7 +171,7 @@ class ScanTarget: public Outputs::Display::ScanTarget {
|
||||
std::unique_ptr<Shader> input_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);
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -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 =
|
||||
"#version 150\n"
|
||||
|
||||
@ -163,8 +163,8 @@ std::unique_ptr<Shader> ScanTarget::input_shader(InputDataType input_data_type,
|
||||
"uniform usampler2D textureName;"
|
||||
"void main(void) {";
|
||||
|
||||
switch(output_type) {
|
||||
case OutputType::RGB:
|
||||
switch(display_type) {
|
||||
case DisplayType::RGB:
|
||||
fragment_shader += "fragColour = vec4(texture(textureName, textureCoordinate).rrr, 1.0);";
|
||||
break;
|
||||
default:
|
||||
@ -188,7 +188,7 @@ std::unique_ptr<Shader> ScanTarget::input_shader(InputDataType input_data_type,
|
||||
// "uniform sampler2D textureName;"
|
||||
// "void main(void) {";
|
||||
//
|
||||
// switch(output_type) {
|
||||
// switch(display_type) {
|
||||
// default: return nullptr;
|
||||
//
|
||||
// case OutputType::SVideo:
|
||||
|
@ -48,7 +48,7 @@ enum class ColourSpace {
|
||||
YUV
|
||||
};
|
||||
|
||||
enum class OutputType {
|
||||
enum class DisplayType {
|
||||
RGB,
|
||||
SVideo,
|
||||
CompositeColour,
|
||||
@ -123,6 +123,9 @@ struct ScanTarget {
|
||||
/// Describes the format of input data.
|
||||
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.
|
||||
ColourSpace composite_colour_space;
|
||||
|
||||
@ -148,7 +151,7 @@ struct ScanTarget {
|
||||
Rect visible_area;
|
||||
|
||||
/// 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.
|
||||
struct {
|
||||
|
Loading…
Reference in New Issue
Block a user