Skip to content

File DataTextureLayout.hpp

File List > internal > DataTextureLayout.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 <QtCore/qglobal.h>

namespace QAccelPlot::Internal {

constexpr int kDataTextureWidth{8192};

constexpr int dataTextureHeight(const int floatCount)
{
    return (floatCount + kDataTextureWidth - 1) / kDataTextureWidth;
}

constexpr qint64 dataTextureItemCapacity(const int maxHeight, const int floatsPerItem)
{
    return static_cast<qint64>(kDataTextureWidth) * maxHeight / floatsPerItem;
}

} // namespace QAccelPlot::Internal