1
0
mirror of synced 2025-01-18 00:56:49 +01:00

fix: Average and Median nodes using wrong output types

This commit is contained in:
WerWolv 2023-11-08 11:53:46 +01:00
parent d160aeec4b
commit da851c3c10

View File

@ -709,7 +709,7 @@ namespace hex::plugin::builtin {
class NodeArithmeticAverage : public dp::Node {
public:
NodeArithmeticAverage() : Node("hex.builtin.nodes.arithmetic.average.header", { dp::Attribute(dp::Attribute::IOType::In, dp::Attribute::Type::Buffer, "hex.builtin.nodes.common.input"), dp::Attribute(dp::Attribute::IOType::Out, dp::Attribute::Type::Integer, "hex.builtin.nodes.common.output") }) { }
NodeArithmeticAverage() : Node("hex.builtin.nodes.arithmetic.average.header", { dp::Attribute(dp::Attribute::IOType::In, dp::Attribute::Type::Buffer, "hex.builtin.nodes.common.input"), dp::Attribute(dp::Attribute::IOType::Out, dp::Attribute::Type::Float, "hex.builtin.nodes.common.output") }) { }
void process() override {
const auto &input = this->getBufferOnInput(0);
@ -722,7 +722,7 @@ namespace hex::plugin::builtin {
class NodeArithmeticMedian : public dp::Node {
public:
NodeArithmeticMedian() : Node("hex.builtin.nodes.arithmetic.median.header", { dp::Attribute(dp::Attribute::IOType::In, dp::Attribute::Type::Buffer, "hex.builtin.nodes.common.input"), dp::Attribute(dp::Attribute::IOType::Out, dp::Attribute::Type::Integer, "hex.builtin.nodes.common.output") }) { }
NodeArithmeticMedian() : Node("hex.builtin.nodes.arithmetic.median.header", { dp::Attribute(dp::Attribute::IOType::In, dp::Attribute::Type::Buffer, "hex.builtin.nodes.common.input"), dp::Attribute(dp::Attribute::IOType::Out, dp::Attribute::Type::Float, "hex.builtin.nodes.common.output") }) { }
void process() override {
auto input = this->getBufferOnInput(0);
@ -738,7 +738,7 @@ namespace hex::plugin::builtin {
median = input[medianIndex];
}
this->setIntegerOnOutput(1, median);
this->setFloatOnOutput(1, median);
}
};