4874066423
There are a few benefits to using smart pointers from the standard library: - std::unique_ptr has move semantics. With move semantics, transfer of ownership can be properly expressed - std::shared_ptr is more efficient than QSharedPointer - more developers are used to them, making contributions for newcomers easier We're also already using a mix of both; because Qt shared pointers provide no benefits, porting to standard smart pointers improves consistency in the code base. Because of that, this commit ports most of the uses of QSharedPointer to std::shared_ptr, and some uses of QScopedPointer to std::unique_ptr
37 lines
731 B
C++
37 lines
731 B
C++
/*
|
|
KWin - the KDE window manager
|
|
This file is part of the KDE project.
|
|
|
|
SPDX-FileCopyrightText: 2022 Xaver Hugl <xaver.hugl@gmail.com>
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
#pragma once
|
|
|
|
#include <QVector>
|
|
#include <memory>
|
|
|
|
#include "kwin_export.h"
|
|
|
|
namespace KWin
|
|
{
|
|
|
|
class ColorTransformation;
|
|
|
|
class KWIN_EXPORT ColorLUT
|
|
{
|
|
public:
|
|
ColorLUT(const std::shared_ptr<ColorTransformation> &transformation, size_t size);
|
|
|
|
uint16_t *red() const;
|
|
uint16_t *green() const;
|
|
uint16_t *blue() const;
|
|
size_t size() const;
|
|
std::shared_ptr<ColorTransformation> transformation() const;
|
|
|
|
private:
|
|
QVector<uint16_t> m_data;
|
|
const std::shared_ptr<ColorTransformation> m_transformation;
|
|
};
|
|
|
|
}
|