OpenShot Library | libopenshot 1.1.1
PreviewSize.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 OpenShot Studios, LLC
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
4#ifndef OPENSHOT_PREVIEW_SIZE_H
5#define OPENSHOT_PREVIEW_SIZE_H
6
7#include <algorithm>
8#include <QSize>
9
10namespace openshot {
11// Apply only to reduced previews, after fitting the aspect ratio. Four RGBA
12// pixels occupy 16 bytes. Align both axes so quarter-turn orientation also
13// produces aligned rows. Tiny previews have a minimum size of 4x4.
14inline QSize AlignPreviewSize(const QSize& size) {
15 return QSize(std::max(4, size.width() / 4 * 4),
16 std::max(4, size.height() / 4 * 4));
17}
18}
19
20#endif
This namespace is the default namespace for all code in the openshot library.
Definition: AnimatedCurve.h:24
QSize AlignPreviewSize(const QSize &size)
Definition: PreviewSize.h:14