Files
tdesktop/Telegram/SourceFiles/ui/top_background_gradient.h
allhaileris afb81b8278
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Close stale issues and PRs / stale (push) Successful in 13s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
init
2026-02-16 15:50:16 +03:00

80 lines
1.8 KiB
C++

/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
namespace Data {
struct UniqueGift;
struct UniqueGiftBackdrop;
} // namespace Data
namespace Ui::Text {
class CustomEmoji;
} // namespace Ui::Text
class PeerData;
namespace Ui {
struct PatternPoint {
QPointF position;
float64 scale = 1.;
float64 opacity = 1.;
};
[[nodiscard]] QImage CreateTopBgGradient(
QSize size,
const Data::UniqueGift &gift);
[[nodiscard]] QImage CreateTopBgGradient(
QSize size,
const Data::UniqueGiftBackdrop &backdrop);
[[nodiscard]] QImage CreateTopBgGradient(
QSize size,
QColor centerColor,
QColor edgeColor,
bool rounded = true,
QPoint offset = QPoint());
[[nodiscard]] QImage CreateTopBgGradient(
QSize size,
not_null<PeerData*> peer,
QPoint offset = QPoint());
[[nodiscard]] const std::vector<PatternPoint> &PatternBgPoints();
[[nodiscard]] const std::vector<PatternPoint> &PatternBgPointsSmall();
void PaintBgPoints(
QPainter &p,
const std::vector<PatternPoint> &points,
base::flat_map<float64, QImage> &cache,
not_null<Ui::Text::CustomEmoji*> emoji,
const Data::UniqueGift &gift,
const QRect &rect,
float64 shown = 1.);
void PaintBgPoints(
QPainter &p,
const std::vector<PatternPoint> &points,
base::flat_map<float64, QImage> &cache,
not_null<Ui::Text::CustomEmoji*> emoji,
const Data::UniqueGiftBackdrop &backdrop,
const QRect &rect,
float64 shown = 1.);
void PaintBgPoints(
QPainter &p,
const std::vector<PatternPoint> &points,
base::flat_map<float64, QImage> &cache,
not_null<Ui::Text::CustomEmoji*> emoji,
const QColor &patternColor,
const QRect &rect,
float64 shown = 1.);
} // namespace Ui