Skip to content

File LineCurveGapFilter.hpp

File List > QAccelPlot > src > QAccelPlot > series > LineCurveGapFilter.hpp

Go to the documentation of this file

//
// SPDX-FileCopyrightText: 2026 Michal Grabarczyk
// SPDX-License-Identifier: GPL-3.0-only WITH Universal-FOSS-exception-1.0
//
// This file is also available under a separate commercial license.
// See COMMERCIAL-LICENSING.md for contact information.
//
#pragma once

#include "QAccelPlot/renderers/CurveRendererParams.hpp"

#include <vector>

namespace QAccelPlot {

struct DataPointRun {
    int start; 
    int count; 
};

namespace LineCurveGapFilter {

[[nodiscard]] bool isValidPoint(const CurveDataView& data, int index, bool logScaleX, bool logScaleY);

[[nodiscard]] std::vector<DataPointRun> findValidRuns(const CurveDataView& data, int pointCount, bool logScaleX, bool logScaleY);

[[nodiscard]] std::vector<int> planRunSampling(const std::vector<DataPointRun>& runs, int maxSampledPoints);

void appendEnvelopeSamples(const CurveDataView& data, const DataPointRun& run, int sampledCount, std::vector<int>& indices);

} // namespace LineCurveGapFilter

} // namespace QAccelPlot