OCIO and Fullscreen stubs
This commit is contained in:
@@ -40,6 +40,20 @@ void ApplySize(const JsonValue& root, const char* key, std::size_t& target)
|
||||
target = static_cast<std::size_t>(value->asNumber());
|
||||
}
|
||||
|
||||
void ApplyInt(const JsonValue& root, const char* key, int& target)
|
||||
{
|
||||
const JsonValue* value = Find(root, key);
|
||||
if (value && value->isNumber())
|
||||
target = static_cast<int>(value->asNumber());
|
||||
}
|
||||
|
||||
void ApplyUnsigned(const JsonValue& root, const char* key, unsigned& target)
|
||||
{
|
||||
const JsonValue* value = Find(root, key);
|
||||
if (value && value->isNumber() && value->asNumber() >= 0.0)
|
||||
target = static_cast<unsigned>(value->asNumber());
|
||||
}
|
||||
|
||||
void ApplyPort(const JsonValue& root, const char* key, unsigned short& target)
|
||||
{
|
||||
const JsonValue* value = Find(root, key);
|
||||
@@ -108,6 +122,43 @@ void ApplyOutputConfig(const JsonValue& root, AppConfig& config)
|
||||
config.output.externalKeyingEnabled = false;
|
||||
}
|
||||
|
||||
void ApplyWindowOutputConfig(const JsonValue& root, AppConfig& config)
|
||||
{
|
||||
const JsonValue* window = Find(root, "windowOutput");
|
||||
if (!window || !window->isObject())
|
||||
return;
|
||||
|
||||
ApplyBool(*window, "fullscreen", config.windowOutput.fullscreen);
|
||||
ApplyBool(*window, "borderless", config.windowOutput.borderless);
|
||||
ApplyString(*window, "display", config.windowOutput.display);
|
||||
ApplyInt(*window, "x", config.windowOutput.x);
|
||||
ApplyInt(*window, "y", config.windowOutput.y);
|
||||
ApplyUnsigned(*window, "width", config.windowOutput.width);
|
||||
ApplyUnsigned(*window, "height", config.windowOutput.height);
|
||||
ApplyBool(*window, "vsync", config.windowOutput.vsync);
|
||||
ApplyBool(*window, "allowTearing", config.windowOutput.allowTearing);
|
||||
}
|
||||
|
||||
void ApplyColorPipelineConfig(const JsonValue& root, AppConfig& config)
|
||||
{
|
||||
const JsonValue* color = Find(root, "colorPipeline");
|
||||
if (!color || !color->isObject())
|
||||
return;
|
||||
|
||||
ApplyBool(*color, "ocioEnabled", config.colorPipeline.ocioEnabled);
|
||||
ApplyString(*color, "ocioConfig", config.colorPipeline.ocioConfig);
|
||||
ApplyString(*color, "inputColorSpace", config.colorPipeline.inputColorSpace);
|
||||
ApplyString(*color, "workingColorSpace", config.colorPipeline.workingColorSpace);
|
||||
ApplyString(*color, "outputColorSpace", config.colorPipeline.outputColorSpace);
|
||||
ApplyString(*color, "display", config.colorPipeline.display);
|
||||
ApplyString(*color, "view", config.colorPipeline.view);
|
||||
ApplyString(*color, "look", config.colorPipeline.look);
|
||||
ApplyDouble(*color, "exposure", config.colorPipeline.exposure);
|
||||
ApplyDouble(*color, "gamma", config.colorPipeline.gamma);
|
||||
ApplyString(*color, "workingFormat", config.colorPipeline.workingFormat);
|
||||
ApplyBool(*color, "linearWorkingSpace", config.colorPipeline.linearWorkingSpace);
|
||||
}
|
||||
|
||||
JsonValue InputConfigToJson(const VideoInputAppConfig& input)
|
||||
{
|
||||
JsonValue value = JsonValue::MakeObject();
|
||||
@@ -133,6 +184,39 @@ JsonValue OutputConfigToJson(const VideoOutputAppConfig& output)
|
||||
value.set("keying", keying);
|
||||
return value;
|
||||
}
|
||||
|
||||
JsonValue WindowOutputConfigToJson(const WindowOutputAppConfig& window)
|
||||
{
|
||||
JsonValue value = JsonValue::MakeObject();
|
||||
value.set("fullscreen", JsonValue(window.fullscreen));
|
||||
value.set("borderless", JsonValue(window.borderless));
|
||||
value.set("display", JsonValue(window.display));
|
||||
value.set("x", JsonValue(static_cast<double>(window.x)));
|
||||
value.set("y", JsonValue(static_cast<double>(window.y)));
|
||||
value.set("width", JsonValue(static_cast<double>(window.width)));
|
||||
value.set("height", JsonValue(static_cast<double>(window.height)));
|
||||
value.set("vsync", JsonValue(window.vsync));
|
||||
value.set("allowTearing", JsonValue(window.allowTearing));
|
||||
return value;
|
||||
}
|
||||
|
||||
JsonValue ColorPipelineConfigToJson(const ColorPipelineAppConfig& color)
|
||||
{
|
||||
JsonValue value = JsonValue::MakeObject();
|
||||
value.set("ocioEnabled", JsonValue(color.ocioEnabled));
|
||||
value.set("ocioConfig", JsonValue(color.ocioConfig));
|
||||
value.set("inputColorSpace", JsonValue(color.inputColorSpace));
|
||||
value.set("workingColorSpace", JsonValue(color.workingColorSpace));
|
||||
value.set("outputColorSpace", JsonValue(color.outputColorSpace));
|
||||
value.set("display", JsonValue(color.display));
|
||||
value.set("view", JsonValue(color.view));
|
||||
value.set("look", JsonValue(color.look));
|
||||
value.set("exposure", JsonValue(color.exposure));
|
||||
value.set("gamma", JsonValue(color.gamma));
|
||||
value.set("workingFormat", JsonValue(color.workingFormat));
|
||||
value.set("linearWorkingSpace", JsonValue(color.linearWorkingSpace));
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
bool ApplyAppConfigJson(const JsonValue& root, AppConfig& config, std::string* error)
|
||||
@@ -151,6 +235,8 @@ bool ApplyAppConfigJson(const JsonValue& root, AppConfig& config, std::string* e
|
||||
ApplyDouble(root, "oscSmoothing", config.oscSmoothing);
|
||||
ApplyInputConfig(root, config);
|
||||
ApplyOutputConfig(root, config);
|
||||
ApplyWindowOutputConfig(root, config);
|
||||
ApplyColorPipelineConfig(root, config);
|
||||
ApplyBool(root, "autoReload", config.autoReload);
|
||||
ApplySize(root, "maxTemporalHistoryFrames", config.maxTemporalHistoryFrames);
|
||||
ApplyBool(root, "previewEnabled", config.previewEnabled);
|
||||
@@ -186,6 +272,8 @@ JsonValue AppConfigToJsonValue(const AppConfig& config)
|
||||
root.set("oscSmoothing", NumberValue(config.oscSmoothing));
|
||||
root.set("input", InputConfigToJson(config.input));
|
||||
root.set("output", OutputConfigToJson(config.output));
|
||||
root.set("windowOutput", WindowOutputConfigToJson(config.windowOutput));
|
||||
root.set("colorPipeline", ColorPipelineConfigToJson(config.colorPipeline));
|
||||
root.set("autoReload", JsonValue(config.autoReload));
|
||||
root.set("maxTemporalHistoryFrames", SizeValue(config.maxTemporalHistoryFrames));
|
||||
root.set("previewEnabled", JsonValue(config.previewEnabled));
|
||||
|
||||
Reference in New Issue
Block a user